How to install R packages when github is blocked using papaja as an example - r

I thought I would post this as an answer to anyone having problems installing papaja (or other packages) when behind a firewall that doesn't allow github
The problem
For reasons I dont fully understand, the only way I am able to use github R packages is to download them into my github desktop and then use them using the remotes::install_local("C:\\[path]\\GitHub\\papaja") function. This has worked for all the R packages available from github (CRAN installations are fine).
However this is not the case with papaja which gives me the error:
'Error in curl::curl_fetch_memory(url, handle = h) :
Failed to connect to api.github.com port 443: Connection refused'
I suspect this is because a call is being made to github during the package installation (otherwise why dont I get this issue with all of the other packages I've installed this way).

The attempts
So I went ahead and tried
remotes::install_local("C:\\[path]\\GitHub\\papaja",dependencies=FALSE)
It gave me the error:
ERROR: dependencies 'bookdown', 'rmdfiltr' are not available for package 'papaja'
The answer
So I installed these separately from CRAN and then re ran
remotes::install_local("C:\\[path]\\GitHub\\papaja",dependencies=FALSE)
and the papaja successfully installed. So I guess the installation for the dependencies bookdown and rmdfiltr are making a call to github when they could be installed from CRAN?
So I guess if you get the same error, switch off dependecy installation and install them separately

Related

Using R, how to install github library without `devtools`

Let's say I wanted to install a library off of github without devtools. How would I do that?
I was helping a student in office hours today, and devtools required a lot of dependencies. It took nearly a half-an-hour just to get him ready to use it. I know that install.packages works for local files, is the github setup going to enable this?
Let's say: https://github.com/laresbernardo/lares
I understand that devtools::install_github is just a wrapper for remote::install_github which explains some of the dependency issues with these packages (and tidyverse in general - haven was broken today for Windoze).
Can I not install a package directly using install.packages from R:base using the remote source?

How to install MVPARTwrap package in R version 3.6.1?

I am trying to install mvpart and MVPARTwrap packages in R version 3.6.1.
I install on my PC the folder of these two packages in zip version and load them in the relative folder of the package.
When I run the script library(mvpart) I get this message:
ERROR: 'mvpart' package was built before R 3.0.0: please reinstall it."
I try to load this library in the old version of R (version 2.15) and the message is
in install.packages (mvpart): object 'mvpart' not found".
I do not understand why it is impossible to load this package. Thanks so much.
Maybe the answer is no more relevant, but I just had to install those libraries so maybe it will still help someone later. I suggest the install from github as it will install dependencies, you need however to be able to compile the source. So here we go :
first install rtools if it is not already installed go here and follow the instruction
update/install devtools if necessary as described here
using this command, it should work now. you may be asked to update some packages, accept all
devtools::install_github("cran/mvpart")

errors when installing older dplyr package in R

Im a bit new to R and need to use/adapt someone else code in R.
My supervisor uses R version 3.2.2 with the dplyr package version 0.4.3 (to overcome errors and problems with the original code).
I tried to install the older dplyr package with different methods:
- installed devtools package and then used the url devtools::install_url("http://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.1.2.tar.gz")
- manual installation (where I downloaded the file and tried to install it.) Installation seemed to have worked but when I run the code it gives a fatal error massage
Every way I've tried so far either gives a lot of error messages or a fatal error and shutdown.
When using help ?dplyr it gives a pop-up that there is an error. Does anybody have any other ideas to install this package?
Thanks!

R Install Packages Undable to Access Repository

I'm new to R, and I'm trying to install the "Reshape" package, but I get this error
install.packages("reshape")
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.2
Warning message:
package ‘reshape’ is not available (for R version 3.2.1)
I've searched around, seems this should definitely be available for download, but I can't figure out whats causing the issue
I had the same problem... I went to the Default CRAN Mirror to an HTTP mirro and that seems to have resolved it.
I hope this helps you too.
Felipe
I got exactly the same error message. I got it with loading other packages too, but after I downloaded the latest versions of R and R Studio I was able to load them but seems there is not a 'reshape' version compatible with R 3.2.1 yet.

Package installation issues with R 3.1.0

My Fedora system (Fedora 20, all up to date) has just had R updated to version 3.1.0. Since then, I've had issues installing multiple packages. glmnet failed previously, and now I'm having trouble with treemap. More specifically, I get an error during treemap installation that httpuv has zero exit status.
I never had issues with the previous version of R. Any reason this version should have such problems??
There could be many causes to do with your OS, version, permissions, other installed packages/software, etc, etc. Without seeing the full error message it's hard to know.
One possibility specific to httpuv is root privileges. I've noticed a few threads on various forums when searching for installation errors with this package and Linux, many of them mentioning root v. non-root issues. In another case, libuv needed to be upgraded.
I encounter package installation problems daily and I have some more general work-arounds as well. Hopefully one of these will solve your problem.
Install the package from source
download.file(url="http://cran.r-project.org/src/contrib/httpuv_1.3.0.tar.gz", destfile = "httpuv.tar.gz")
install.packages("httpuv.tar.gz", type = "source", repos = NULL)
Install using devtools via GitHub if the package supports it
Install RTools and re-try your package installation
Install an older version of the package
If those above do not work, then I dig deeper by referring to advice given to me by a VP of IT in my company. These comments were made in reference to frequent package installation problems I encountered when switching from Windows to Solaris:
There are two types of install/make problems. Missing .h files
and/or missing .so/.a libs. The reason for these are multiple:
1.- the package that delivers these is not installed. This means that those files cannot be found anywhere in the /usr tree. Solution is
install right package, make sure the files are there
2.- the includes are not found by the install configurator. This means some environment variable or install option is not properly set (this
is our case for RODBC). Figuring out which variable to set is
challenging without looking at the package documentation [fortunately, documentation is not hard to find!]
3.- the libs are not in the LD_LIBRARY_PATH, easy to fix.
4.- There is a deeper compile/link error, meaning the package is not compatible with the rest of the sw, or has not been properly ported.

Resources