How to manually install rChart? - r

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)

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.

Trying to install library 'quantmod' in R

I'm trying to download library 'quantmod' in R:
install.packages("quantmod")
console:
The downloaded source packages are in
‘/tmp/RtmpwSKGIl/downloaded_packages’
then:
library("quantmod", lib.loc="/tmp/RtmpwSKGIl/downloaded_packages")
console:
Error in library("quantmod", lib.loc = "/tmp/RtmpwSKGIl/downloaded_packages") :
there is no package called ‘quantmod’
What is the problem?
I get no problem when I try to load this package.Have you tried to provide R the full name path to your package file directory ?C:/Users/...Is your R version up to date ? Try to check if you have the latest, I tried and it worked with :
R 3.3.3
If you are a Windows or MAC user you might want to force the download of the package from source to binary, this can be done by setting the right options in the install.packages command:
options(install.packages.check.source = "no")
https://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html
I guess I am a year late, but just got out of this situation by installing the Package from R (instead of RStudio) by changing the CRAN.
You can then run library(quantmod) in Rstudio. Hope this works(worked?) for you too.
I am ready to go now!

Error using install_github for statsr package

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/

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.

Unable to install ggplot2

I'm having trouble installing ggplot2 into R. I've looked around here and haven't seen the same error that I'm getting.
> install.packages('ggplot2', dep=TRUE)
Warning in install.packages("ggplot2", dep = TRUE) :
'lib = "C:/Program Files/R/R-2.13.1/library"' is not writable
Error in install.packages("ggplot2", dep = TRUE) :
unable to install packages
Can anybody help?
It would actually suffice to invoke as follows:
> install.packages('ggplot2', dep=TRUE, lib=NULL)
and R should substitue lib with the default location, as in my comment.
Or you could change the environment variable itself.
R needs to have write access to your library to install a package there. The other advice you're getting is good and should be preferred, but you can run R (or RStudio) as an administrator (right-click on the .exe and "Run as Administrator" is an option) which should give it write access to your library.
In RStudio:
Try going to "Tools";
At the top you have "Install packages", click on that;
Then click on "Install to Library", change that to another library and save there.

Resources