Error using install_github for statsr package - r

I'm trying to install the companion R package for a Coursera course, with the following commands:
library(devtools)
install_github("StatsWithR/statsr")
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Couldn't resolve host name
Bet the error is due to the firewall, because at home (where I have no firewall, but exactly the same versions of R and RStudio) I can install flawlessly. Is it possible to fix it? Otherwise, since I've been able to download the package from Github on my pc, how do I install the package manually?

Please change you DNS to public one.
You can try Google DNS (8.8.8.8 and 8.8.4.4) .
It worked fine for me.
Click here to see how to set public DNS

to solve this problem you have to install these packages which worked for me.
install.packages("devtools")
install.packages("dplyr")
install.packages("rmarkdown")
install.packages("ggplot2")
install.packages("broom")
install.packages("gridExtra")
install.packages("shiny")
install.packages("cubature")
library(devtools)
install_github("StatsWithR/statsr")
or use this
install.packages(data.table)
devtools::install_github("arunsrinivasan/cran.stats")

you can try to install Rtools first and then run the commands.
https://cran.r-project.org/bin/windows/Rtools/

Related

Couldn't install packages in R on Linux Redhat (CXX14 is not defined)

I need install 'metaSEM' package in R. It's not allowed to use internet so I tried to use install by the souce file. But it doesn't work. The warning shows as :
ERROR: dependency 'OpenMX' is not availabe for package.
Could you please give my any suggestion about this situation? Thanks a lot.

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

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

Problem with installing dev tools packadge

So , I am following instructions given to us on how to install dev.tools package.
But, I am running into a problem where after being successful at using these commands:
install.packages("devtools")
library(devtools)
I am instructed to use this command:
build_github_devtools()
Which produces this error :
Error in build_github_devtools() :
could not find function "build_github_devtools"
I have no idea how to solve this, could anyone help?
You may be following outdated instructions. According to the install guide at https://cran.r-project.org/web/packages/devtools/readme/README.html , you are good to go!
If you were successful with
install.packages("devtools")
library(devtools)
That's it, mission accomplished

unable to install gganimate package from Github, both automatically and manually

I am currently trying to install the gganimate package but seem unable to.
I am running Win 10, Rx64 3.3.0 and Rstudio 0.99.896;
the following command:
devtools::install_github("dgrtwo/gganimate")
will throw this error:
Downloading GitHub repo dgrtwo/gganimate#master
from URL https://api.github.com/repos/dgrtwo/gganimate/zipball/master
Error in curl::curl_fetch_memory(url, handle = handle) :
Problem with the SSL CA cert (path? access rights?)
So after a few hours of despair, I decided to try and install the package manually. I followed this link:
here
the following command:
install.packages(pkgs = "C:/Users/Superzucca/Desktop/gganimate-master.zip", repos = NULL)
results in:
Installing package into ‘C:/Users/Superzucca/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
but then when I call:
library("gganimate-master") #### -> as suggsted by R itself!!
this error is thrown:
Error in library("gganimate-master") : there is no package called ‘gganimate-master’
please, help. I don't have any problems installing other pkgs and honestly don't know what else to try.
Thank you in advance,
Superzucca
Try out this. It's working for me.
library(devtools)
library(RCurl)
library(httr)
set_config( config( ssl_verifypeer = 0L ) )
devtools::install_github("dgrtwo/gganimate")
Figured out the problem, updating with an answer if anybody in the future might need it.
this LINK to another SO question partially solved my problem;
I also had to add R, Rstudio and the library folder to my AntiVirus' excption list, and of course running as administrator :)
I had the same problem like you but I was successful at last.
Generally, you have to deal with two issues: first, connecting to github; second, installing both Rcpp and gganimate.
library(devtools)
library(RCurl)
library(httr)
set_config( config( ssl_verifypeer = 0L ) )
devtools::install_github("RcppCore/Rcpp")
devtools::install_github("dgrtwo/gganimate")
Try the following:
install.packages("gganimate")
Note: This will depend on the version of R installed and if you are downloading from the Cran site.

How to manually install rChart?

I can't install rChart from Rstudio due to some firewall settings in my company computer, so I wonder if I can install it manually. I know it is possible to do that by using install.packages, but it seems the installation was not successful. Here is what I did:
download the master file from https://github.com/ramnathv/rCharts
used the following code to install:
install.packages('\rCharts-master.zip',destdir = "/R/win-library/3.2",repos = NULL)
load the package library(rCharts-master) and resulted in the following error message:
Error in library(rCharts - master) : 'package' must be of length 1
rChart is a package on GitHub, try
install.packages("devtools")
library(devtools)
install_github('ramnathv/rCharts')
library(rCharts)
It should work.
The name of the package you're trying to load is "rCharts", and not "rCharts-master". Try
library(rCharts)

Resources