4

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.

hzhou
  • 55
  • 6

2 Answers2

2

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)
akrun
  • 874,273
  • 37
  • 540
  • 662
  • I have followed your suggested steps and it seems it's not working, as I am getting some error message as per below: library(versions) > install.versions('panelr', '3.6.3') Error in if (!all(df$available)) { : missing value where TRUE/FALSE needed In addition: Warning message: In current.version(pkgs) : The current version and publication date of panelr could notbe detected – hzhou Aug 29 '20 at 20:01
  • @hzhou sorry, the version number I showed was a typo. I copied from your R version instead of the version of the package. Can you try now – akrun Aug 29 '20 at 20:03
  • I have tried with the last version of panelr and getting this error message now: install.versions('panelr', '0.7.3') Error in download.file(url, file, quiet = TRUE) : cannot open URL 'https://mran.revolutionanalytics.com/snapshot' – hzhou Aug 29 '20 at 20:04
  • @hzhou Also, before you try `install.versions`, it may be better to check the versions available in the repo il.e `available.versions('panelr')` It is possible that the version number in the MRAN repo would be different one. – akrun Aug 29 '20 at 20:05
  • @hzhou another option is to download the tar file into local repo from [here](https://cran.r-project.org/src/contrib/Archive/panelr/) and then use `install.packages('path/to/tar.gz', repos = NULL, type = 'source')` – akrun Aug 29 '20 at 20:08
  • Have followed your suggestion and now I'm getting this: Warning: invalid package 'path/to/tar.gz' Error: ERROR: no packages specified Warning in install.packages : installation of package ‘path/to/tar.gz’ had non-zero exit status – hzhou Aug 29 '20 at 20:17
  • @hzhour I meant the path as path where you download your file. If the tar file is in a specific location, you can either use `file.choose()` to direct to that location or have the path of that file where it is stored – akrun Aug 29 '20 at 20:20
  • may you kindly advise on how I can use the file.choose() function together with this code you initially gave me install.packages('path/to/tar.gz', repos = NULL, type = 'source') as the file is in my downloads. Thanks. – hzhou Aug 29 '20 at 20:31
  • @hzhou that would be `install.packages(file.choose(), repos = NULL, type = 'source')`, it would pop up a GUI where you can locate to where the file is stored once you find it, select and enter – akrun Aug 29 '20 at 20:34
  • I have done so and now got another error message (not sure how best to deal with this now): ERROR: dependencies 'jtools', 'lmerTest' are not available for package 'panelr' * removing 'C:/Users/hzhou/Documents/R/win-library/3.6/panelr' Warning in install.packages : installation of package ‘C:/Users/hzhou/Downloads/panelr_0.7.3.tar.gz’ had non-zero exit status – hzhou Aug 29 '20 at 21:16
  • @hzhou that is a different error. It means that you need to download those dependency tar files as well. YOu may try to install those packages otherwise as well, i.e `install.packages('lmerTest')` and `install.packages('jtools')` before doing the installation of panelr – akrun Aug 29 '20 at 21:21
  • @hzhou I can understand your issue as I had gone through the same source of issue while working with a specific R version in prod env. Only way to fix is to download all the packages that are needed as dependency because the panelr is removed from CRAN and I don't find any github devel page for panelr. – akrun Aug 29 '20 at 21:32
  • @hzhou i find one [github](https://github.com/jacob-long/panelr) page, please check if you could install those – akrun Aug 29 '20 at 21:33
  • 2
    you a star! I just installed those packages and It's all done now and I'm good to go. Thanks so much. – hzhou Aug 29 '20 at 22:10
0

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

Poza
  • 336
  • 1
  • 16