Installing RStudioAMI on Amazon Web Services error: - r

I have set up an AWS and I am trying to install a package. I run the following but get an error.
> devtools::install_github("https://github.com/nwstephens/RStudioAMI.git")
Downloading GitHub repo nwstephens/RStudioAMI#master
✔ checking for file ‘/tmp/RtmpEH49ON/remotes33643b988bf8/nwstephens-RStudioAMI-8507ced/DESCRIPTION’
─ preparing ‘RStudioAMI’:
✔ checking DESCRIPTION meta-information ... OK
Warning in file(con, "r") :
cannot open file 'man': No such file or directory
ERROR
computing Rd index failed:cannot open the connection
Error in (function (command = NULL, args = character(), error_on_status = TRUE, :
System command error
Running also:
> install.packages("RStudioAMI")
Installing package into ‘/home/msmith/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘RStudioAMI’ is not available (for R version 3.4.4)
I have tried updating my R version.
> install.packages("installr")
Installing package into ‘/home/msmith/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘installr’ is not available (for R version 3.4.4)
I am not sure how I can proceed with this from here… Do you know of something I can run in the terminal to install this package?
EDIT: Using Ubuntu 18

Solved (I think)
I downloaded the package from GitHub: https://github.com/nwstephens/RStudioAMI
Uploaded this .zip to the server and then;
In R studio I created a new Project and then selected build -> Build Source Package which seemed to work.

Related

Is there any way to install RMongo package as its officially removed from CRAN?

I need to install RMongo to connect to my local MongoDB database. On installing RMongo I am getting this error:
Warning in install.packages :
package ‘RMongo’ is not available (for R version 3.5.3)
I also downloaded RMongo tar file and stored in R directory where all packages get installed and tried to install the package by writing this command in R environment
install.packages("C:/Users/Akash/Documents/R/win-library/3.5/RMongo_0.0.25.tar", repos = NULL, type="source")
On trying to download the package through tar file I am getting this error,
Warning: invalid package 'C:/Users/Akash/Documents/R/win-library/3.5/RMongo_0.0.25.tar'
Error: ERROR: no packages specified
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/Akash/Documents/R/win-library/3.5/RMongo_0.0.25.tar’ had non-zero exit status
Any help is appreciated
Thanks in Advance

How can I install source R packages from a local CRAN and binary for its dependencies?

I have a package which I wrote that is deployed on a local CRAN. I built the tgz with R CMD build and deployed it to a local cran initialised with miniCRAN. Of course, this package is deployed by miniCRAN as source.
Now, in a packrat environment I have to install this package and its dependencies, but the dependencies come from CRAN. I do
> install.packages("mypackage", repos=c("file:///path/to/my/localCRAN", "https://mran.microsoft.com/snapshot/2018-08-01"), type="source")
However, this forces every package to build as source, and this fails because I don't have stuff to compile, say, dplyr or other stuff. I want to download the binaries for those.
If I issue instead
> install.packages("mypackage", repos=c("file:///path/to/my/localCRAN", "https://mran.microsoft.com/snapshot/2018-08-01"))
then install.packages tries to install also my package as binary and stops first with this error
Error in read.dcf(file = tmpf) : cannot open the connection
In addition: Warning message:
In read.dcf(file = tmpf) :
cannot open compressed file '/Users/username/my/localCRAN/bin/macosx/el-capitan/contrib/3.5/PACKAGES', probable reason 'No such file or directory'
So I created an empty PACKAGES file at that path, and now it fails with the following error
package ‘mypackage’ is available as a source package but not as a binary
Warning message:
package ‘mypackage’ is not available (as a binary package for R version 3.5.3)
How can I install my package as source, and its CRAN dependencies as binary?

Package ‘Rstem’ is not available (for R version 3.5.1)

I am trying to install the Rstem package, but I am getting the message that there is no version available for the version of R 3.5.1. I'm using the macOs El Captain.
The error is:
> install.packages('Rstem', repos = 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz')
Installing package into ‘/Users/ls_rafael/Library/R/3.5/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib/PACKAGES'
Warning in install.packages :
package ‘Rstem’ is not available (for R version 3.5.1)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
I already tried the suggested options in this link issues in installing Rstem package and also downloading the package locally from the official website Rstem Package, but the result is also unsatisfactory.
I'm studying how to do an sentiment analysis with Twitter data. I would like to know if there is any alternative to this package or if there is any trick to install it.
RStem package has been removed from the CRAN repository. You can download using the following command:-
install.packages('Rstem', repos = "http://www.omegahat.net/R")
Make sure you have RTools installed on your machine. You can download it from this link -
Building R for Windows
RStem is now provided by OmegaHat.
Try the command below:
install.packages("Rstem", repos = "http://www.omegahat.net/R", type = "source")

R Studio installing stringi fails

I'm trying to invoke knit which tells me that it needs an updated version of rmarkdown which needs the package stringi.
When installing stringi I get the following error:
> install.packages("stringi")
Installing package into ‘C:/Users/matan/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
stringi 1.1.5 1.1.6 TRUE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.5.zip'
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.5.zip': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.5.zip'
Warning in install.packages :
download of package ‘stringi’ failed
How can I fix this so I can finally knit my .RMD in peace?
Edit (Solution):
Download windows binary (r-release: stringi_1.1.6.zip) from https://cran.r-project.org/web/packages/stringi/index.html
Install by > install.packages(".../Downloads/stringi_1.1.6.zip", repos = NULL, type = "source")
Simplest solution is download .zip or .tar.gz file from here and install it choosing in RStudio Tool -> Install packages..., change Install from: to Package Archive File and choose your downloaded file.

Replacing installed package with development version in R

I'm cobbling together instructions for how to install the development version of a package when I already have the package installed, but I'm a bit confused. My specific need is to install the development version of lme4 so I can use the predict function.
First, I know that I should FIND the development version of lme4, which I've located (in a general sense) at this URL. I'm running Mac OSX 10.6.8 (Snow Leopard), and R version 2.14.1, so I navigate to the correct folder and download the *.tgz file. But when I attempt to install the package using the command:
install.packages("~/Downloads/lme4_0.99999911-2.tgz", repos = NULL)
I receive an error messaging stating:
Warning in install.packages :
package ‘~/Downloads/lme4_0.99999911-2.tgz’ is not available (for R version 2.14.1)
(1) How do I find out which version of R I need to be running in order to access the development version of the package, and (2) How do I update my version of R and/or replace the pre-existing version of lme4?
UPDATE:
I've tried another approach by using the command:
> library("devtools")
> install_github("lme4",user="lme4")
Unfortunately, this yields the output..
Installing github repo(s) lme4/master from lme4
Installing lme4.zip from https://github.com/lme4/lme4/zipball
Installing lme4
Installing dependencies for lme4:
RcppEigen, minqa, RcppEigen
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/leopard/contrib/2.14/minqa_1.2.1.tgz'
Content type 'application/x-gzip' length 945252 bytes (923 Kb)
opened URL
==================================================
downloaded 923 Kb
The downloaded packages are in
/var/folders/IZ/IZlpzJbtHEq7NQxUHPvExk+++TI/-Tmp-//Rtmpt8YCsF/downloaded_packages
* checking for file '/private/var/folders/IZ/IZlpzJbtHEq7NQxUHPvExk+++TI/-Tmp-/Rtmpt8YCsF/lme4-lme4-7a6f816/DESCRIPTION' ... OK
* preparing 'lme4':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'lme4_0.99999911-2.tar.gz'
ERROR: dependency 'RcppEigen' is not available for package 'lme4'
* removing '/Library/Frameworks/R.framework/Versions/2.14/Resources/library/lme4'
Error: Command failed (1)
In addition: Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘RcppEigen’ is not available (for R version 2.14.1)
> install.packages("~/Downloads/RcppEigen_0.3.1.2.1.tgz", repos = NULL)
Thanks! Hopefully my question will be useful to other R novices out there...
UPDATE 2
Based on the output above, I've upgraded to R 3.0.0. However, now I'm getting the following error when I try to install the package I've downloaded:
> install.packages("~/Downloads/lme4_0.99999911-2.tgz", repos = NULL)
Warning in install.packages :
package ‘~/Downloads/lme4_0.99999911-2.tgz’ is not available (for R version 3.0.0)
Installing package into ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library’
(as ‘lib’ is unspecified)
'.path.package' is deprecated.
Use 'path.package' instead.
See help("Deprecated")

Resources