Failing to install panelr package - r

I am failing to read in the panelr package from the library. I used the package utilising its wbm() function on some panel data earlier this year and I have even tried to install it and I get this message: Warning in install.packages : package ‘panelr’ is not available (for R version 3.6.3).
Has the package been removed? Kindly assist on how I can install it or the new version of it.

If we want a specific version, use the versions package
install.packages('versions')
Then use
library(versions)
install.versions('panelr', '0.7.3')
If that version is not available in the MRAN repo, check the available versions with
available.versions('panelr')
If there are no versions available, then it returns an error. In that case, an option is to download the archived tar file from https://cran.r-project.org/src/contrib/Archive/panelr/ and then use install.packages to with source = TRUE
install.packages('path/to/.../...tar.gz', source = TRUE, repos = NULL)

Regarding your other question: Yes, it seems as it has been removed.

Related

Cannot install packages in Rstudio

I just installed R studio and I was trying to install rmarkdown. However, I got the error as below. I unchecked the box ''Tools -> Global Options -> Packages -> Use secure download method for HTTP'' as someone suggested. No help. I tried other packages, I got the same error.
You should remove the package and reinstall it using dependencies = TRUE:
remove.packages("rmarkdown")
install.packages("rmarkdown", dependencies = TRUE)
library(rmarkdown)
Output:
Warning message:
package ‘rmarkdown’ was built under R version 4.1.2
I had the same issue and it was due to the newest version of the toolboxes include the names is under new package names. Go to the URL https://cran.rstudio.com/src/contrib/PACKAGES and search for "rmarkdown". Find the package name and try to install that instead. It's like a .zip file that includes several packages to your library. Try install.packages("accucor"). It worked for me at least, and then try to install the rmarkdown package.

Can't install package 'nutshell' from O'Reilly book 'R in a Nutshell' onto Mac

My first post in an early programming career - any help very welcome.
I am studying R, and using a book called R in Nutshell (O'Reilly). The book is supported by a package that was previously available on CRAN. The package on CRAN has been archived - it is still there though as nutshell_2.0.tar.gz.
I am running MacOS Catalina, R version 3.2.1.(after downgrading from 4.02 to try and solve this issue , without success), and RStudio version 1.3.1093.
When I try to install the package into R via RStudio I have this experience:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz
install.packages(packageurl,contriburl=NULL,type="source")
Warning in install.packages :
package ‘https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz’ is not available (for R version 3.2.1)
I have a similar experience if I download the tar.gz file and try to import it directly under Tools/Install Packages.
I am able to install other packages on CRAN successfully.
Many thanks
Up front, I'm doing this on windows and not on macos, but the packages here have no compiled code so there should be few if any differences. Also, I tested on R-4.0.2; I don't think this will be a problem, because these packages appear to have been last-updated in 2012, so if they install on my 4.0.2, then they are likely to work on every version of R since then (including your 4+ year-old R-3.2).
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell.audioscrobbler/nutshell.audioscrobbler_1.0.tar.gz", "nutshell.audioscrobbler_1.0.tar.gz")
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell.bbdb/nutshell.bbdb_1.0.tar.gz", "nutshell.bbdb_1.0.tar.gz")
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz", "nutshell_2.0.tar.gz")
install.packages("nutshell.audioscrobbler_1.0.tar.gz", repos = NULL)
install.packages("nutshell.bbdb_1.0.tar.gz", repos = NULL)
install.packages("nutshell_2.0.tar.gz", repos = NULL)
I tried reproducing installation from archive. I got error that dependencies of this package are not available.
ERROR: dependencies 'nutshell.bbdb', 'nutshell.audioscrobbler' are not available for package 'nutshell'
* removing 'C:/Program Files/R/R-3.6.2/library/nutshell'
Warning in install.packages :
installation of package ‘D:/Profile/maszpa1/Desktop/nutshell_2.0.tar.gz’ had non-zero exit status
Did you get the same error? If yes, then did you try to install them and try again?
As per the accepted answer, the solution was to install the missing dependent packages first, then the Nutshell package.
I was then able to update to R4.02
audioscrobbler_1.0.tar.gz
nutshell.bbdb_1.0.tar.gz
nutshell_2.0.tar.gz

MacOS Rstudio devtools loading fails

I need to install the package devtools in R on my mac. The R version is 3.2.3.
It gives an error saying
Warning in install.packages :
download had nonzero exit status
Warning in install.packages :
download of package ‘curl’ failed
Other posts addressing similar issues provide solutions to Linux (with the apt-get command, etc) but doesn't seem to have a Mac solution. Highly appreciate if someone with insight can offer some guide here.
The problem pertains to the download, have a look at this discussion. You can consider downloading the package first and installing a package from a local zip file.
install.packages("local_package_file", repos = NULL)
or more specifically:
install.packages("devtools.zip", repos = NULL, type = "source")
as shown on the devtools # GitHub.
You didn't mentioned, but I understand that you have the Xcode installed as well. Alternatively, it could be informative to check if your R compiler has no problems with connecting to the Internet, you can use the code: is.character(getURL("www.google.com")).

installing an archived package

The package is available on this website.
http://cran.r-project.org/src/contrib/Archive/rlandscape/
When I use:
install.packages("rlandscape",
repos = "http://cran.r-project.org/src/contrib/Archive/rlandscape/",
type="source")
I get the following error:
package 'rlandscape' is not available (for R version 3.1.2)
I have tried older versions too but no luck..
The devtools package has a function that can install archived versions. Try:
library("devtools")
install_version("rlandscape",version="1.0",
repos="http://cran.r-project.org")
(You should be able to use repos=getOption("repos")["CRAN"] instead, but it looks like your repos option is slightly messed up, i.e. the URL is missing the http://.)
(The repos argument is necessary to work around what I think is a glitch in install_version, i.e. it assumes that repos is a length-1 character vector.)
This should, I think, also automatically install appropriate dependencies -- although it's a bit of a catch-22 if they are in the CRANextra repository for Windows, since that has to be suppressed in order to get install_version to work ...
It may also be the case that install_version automatically assumes that you want the package and all dependencies installed as source (not binary) installations, in which case you will need to have compilation tools installed. The rlandscape package doesn't actually have any compiled code included, but its dependencies do ...
This is an old (archived) package that is no longer supported. If you really need it, you can install it using R CMD INSTALL but you need also to install all its dependencies manually.
Installing your desired package gave me the following:
>R CMD INSTALL ~/Downloads/rlandscape_1.0.tar.gz
* installing to library ‘/Users/mohamedahmed/Rlibs’
ERROR: dependencies ‘spatstat’, ‘deldir’, ‘gWidgets’, ‘gWidgetsRGtk2’ are not available for package ‘rlandscape’
* removing ‘/Users/mohamedahmed/Rlibs/rlandscape’
I am not sure all dependencies are still available on CRAN, but it seems to be challenging task.

How to force older packages to install on newer versions of R?

I cannot install proj4string into my current version of R (2.15.1):
Warning message:
package ‘proj4string’ is not available (for R version 2.15.1)
I assume this is because 2.15.1 is fairly new and the package just hasn't been updated. Is there a general mechanism for forcing R to install an older version of a binary package (realizing that there may be bugs that result)?
(upgraded from a comment)
Download the relevant package (zip, tarball, whatever) from the archives and install it locally, e.g.
install.packages("proj4string_x.y.z.zip",repos=NULL)
(this is not literal: x.y.z represents the package version)
sorry to bump this post again, but i had the same problem . then i found that I can use the following lines for the package:
install.packages("devtools")
devtools::install_github("slowkow/ggrepel")
replaced "slowkow/ggrepel" by the package and github repo.
What i noticed that many packages on github will have details to that. Hope that helps.
You can use install_version from the package devtools to install a specific package version.
To find the package version:
Search for the CRAN page of the package. E.g. for ggmap it is https://CRAN.R-project.org/package=ggmap
Check the archived packages. See heading "Downloads" and "Old Sources:"
Example code for package ggmap
devtools::install_version(
"ggmap",
version = "2.6",
repos = "http://cran.us.r-project.org"
)

Resources