R Packages Error Not A Number
Contents |
Posted on February 12, 2013 by Jonathan Callahan This entry is part 5 of 20 in the series Using RThe post titled Installing Packages .libpaths() in r described the basics of package installation with R. The process is wonderfully
R There Is No Package Called
simple when everything goes well. But it can be maddening when it does not. Error messages give a hint as error in install.packages object not found to what went wrong but do not necessarily tell you how to resolve the problem. This post will collect some of the error messages we've encountered while installing R packages and r unable to install packages not writable describe the reasons for the error and the workarounds we've found. 1) Older version of R Warning message:
In install.packages(c("sp")) : package ‘sp’ is not available This is the message that you get when the CRAN package you're interested in requires a more recent version of R than you have. Remember, the default behavior of install.packages() is to grab the latest version of
Error In Library(rcurl) : There Is No Package Called ‘rcurl’
a package. In this case you have to poke around in the "Old sources" link on the CRAN page for that package and use trial-and-error to find an older version of the package that will work with your version of R. You should start by determining what version of R you have: R --version R version 2.8.1 (2008-12-22) 12 R --versionR version 2.8.1 (2008-12-22) This version of R was released at the end of 2008 and any version of the "sp" package released in 2008 should work. At least some of the 2009 releases should also work. Perusing the sp archive, we might try installing version 0.9-37, the last of the 0.9-3x series which was released in May of 2009: wget http://cran.r-project.org/src/contrib/Archive/sp/sp_0.9-37.tar.gz sudo CMD INSTALL sp_0.9-37.tar.gz ... # Success! 1234 wget http://cran.r-project.org/src/contrib/Archive/sp/sp_0.9-37.tar.gzsudo CMD INSTALL sp_0.9-37.tar.gz...# Success! 2) Unable to execute files in /tmp directory ERROR: 'configure' exists but is not executable -- see the 'R Installation and Administration Manual' By default, R uses the /tmp directory to install packages. On security conscious machines, the /tmp directory is often marked as "noexec" in the /etc/fstab file. This means that no file
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company error in install.packages : updating loaded packages Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs r cannot install packages Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just
The Downloaded Binary Packages Are In
like you, helping each other. Join them; it only takes a minute: Sign up “Error in library(rjson): There is no package called rjson” up vote 2 down vote favorite My rjson package randomly doesn't work. As in, http://mazamascience.com/WorkingWithData/?p=1185 it works fine sometimes, sometimes it fails to load. Not sure why. I get this error. Error in library("rjson") : there is no package called ‘rjson’ To try and alleviate this, despite knowing its installed, I added an install line in my script. install.packages("rjson", repos="http://cran.rstudio.com/") library(rjson) Now I get.... Installing package(s) into ‘C:/Users/Tom/Documents/R/win-library/2.15’ (as ‘lib’ is unspecified) trying URL 'http://cran.rstudio.com/bin/windows/contrib/2.15/rjson_0.2.13.zip' Content type 'application/zip' length 491848 bytes (480 Kb) opened URL downloaded 480 Kb package http://stackoverflow.com/questions/32720990/error-in-libraryrjson-there-is-no-package-called-rjson ‘rjson’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘rjson’ The downloaded binary packages are in C:\Users\Tom\AppData\Local\Temp\RtmpiOfTqK\downloaded_packages In R, when I go to "Packages --> Load" for some reason rjson is NOT there. It never has been, even when it worked. I've naviaged to... C:\Users\Tom\Documents\R\win-library\2.15 I can confirm the folder for rjson is there. No idea what to do. r package rjson share|improve this question edited Sep 22 '15 at 16:55 ekstroem 1,0801520 asked Sep 22 '15 at 15:31 Jibril 1299 1 This is quite typical when you install a new version on top of an old or at least it has happened to me quite a few times. Delete (remove the folder) the old package and re-install using install.packages('rjson') and it will work. –LyzandeR Sep 22 '15 at 15:34 Worked perfectly, good idea. Thanks! –Jibril Sep 22 '15 at 16:48 Np, glad I could help :). It has happened to me many times and I can say it is quite annoying. I 'll post it as an answer just in case it helps someone in the future. Feel free to accept if you like. –LyzandeR Sep 22 '15 at 18:31 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted This has happened to me q
= contrib.url(repos, type), method, available = NULL, destdir = NULL, dependencies = NA, type = getOption("pkgType"), configure.args = getOption("configure.args"), configure.vars = getOption("configure.vars"), clean = FALSE, Ncpus = getOption("Ncpus", 1L), verbose = getOption("verbose"), libs_only = FALSE, INSTALL_opts, quiet = FALSE, https://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html keep_outputs = FALSE, ...) Arguments pkgs character vector of the names of packages https://stat.ethz.ch/R-manual/R-devel/library/base/html/library.html whose current versions should be downloaded from the repositories. If repos = NULL, a character vector of file paths. These can be source directories or archives or binary package archive files (as created by R CMD build --binary). (http:// and file:// URLs are also accepted and the files will be downloaded and installed error in from local copies.) On a CRAN build of R for macOS these can be ‘.tgz’ files containing binary package archives. Tilde-expansion will be done on file paths. If this is missing or a zero-length character vector, a listbox of available packages is presented where possible in an interactive R session. lib character vector giving the library directories where to install the packages. Recycled as needed. If missing, there is no defaults to the first element of .libPaths(). repos character vector, the base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as "https://cloud.r-project.org". For more details on supported URL schemes see url. Can be NULL to install from local files, directories or URLs: this will be inferred by extension from pkgs if of length one. contriburl URL(s) of the contrib sections of the repositories. Use this argument if your repository mirror is incomplete, e.g., because you burned only the ‘contrib’ section on a CD, or only have binary packages. Overrides argument repos. Incompatible with type = "both". method download method, see download.file. Unused if a non-NULL available is supplied. available a matrix as returned by available.packages listing packages available at the repositories, or NULL when the function makes an internal call to available.packages. Incompatible with type = "both". destdir directory where downloaded packages are stored. If it is NULL (the default) a subdirectory downloaded_packages of the session temporary directory will be used (and the files will be deleted at the end of the session). dependencies logical indicating whether to also install uninstalled packages which these packages depend on/link
warn.conflicts = TRUE, quietly = FALSE, verbose = getOption("verbose")) require(package, lib.loc = NULL, quietly = FALSE, warn.conflicts = TRUE, character.only = FALSE) Arguments package, help the name of a package, given as a name or literal character string, or a character string, depending on whether character.only is FALSE (default) or TRUE). pos the position on the search list at which to attach the loaded namespace. Can also be the name of a position on the current search list as given by search(). lib.loc a character vector describing the location of R library trees to search through, or NULL. The default value of NULL corresponds to all libraries currently known to .libPaths(). Non-existent library trees are silently ignored. character.only a logical indicating whether package or help can be assumed to be character strings. logical.return logical. If it is TRUE, FALSE or TRUE is returned to indicate success. warn.conflicts logical. If TRUE, warnings are printed about conflicts from attaching the new package. A conflict is a function masking a function, or a non-function masking a non-function. verbose a logical. If TRUE, additional diagnostics are printed. quietly a logical. If TRUE, no message confirming package attaching is printed, and most often, no errors/warnings are printed if package attaching fails. Details library(package) and require(package) both load the namespace of the package with name package and attach it on the search list. require is designed for use inside other functions; it returns FALSE and gives a warning (rather than an error as library() does by default) if the package does not exist. Both functions check and update the list of currently attached packages and do not rel