Install R packages problem using RStudio Package Manager - r

I tried to install R packages using RStudio Package Manager using the following code:
install.packages("dplyr", type = "source")
and
install.packages("dplyr")
and it gives the following error:
Error in install.packages : invalid version specification 'r56550'
What should I do? I tried to google the error but nothing comes up. I have tried to delete and reinstall R and RStudio but i still received the error. I tried to download both the existing binary and the source file and neither ways worked. I tried to install different packages and repeated in both R and Rstudio and nothing worked.
Thank you!
Update 1: I'm using R version 4.0.5 and RStudio version 1.4.1106. I have also downloaded Rtools40 according to the instruction in the following website: https://cran.r-project.org/bin/windows/Rtools/. I'm using Windows. By 'R Manager' I meant the package manager console in RStudio.
Update 2: I'm not sure if there is no network issue or proxy. If I download the packages directly through the CRAN mirror, then it works. But we are trying to download packages in an offline environment, that's why I need RStudio Package Manager.

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.

Tidyverse not installing

I'm having a bit of a pickle right now with the package tidyverse, that I need for an assignment on layering maps. I tried installing the package using install.packages("tidyverse") and install.packages ("tidyverse", dependencies = TRUE) but when I ran library(tidyverse) it wasn't installed. I searched online and found that I had an older version of RStudio IDE so I uploaded the latest version (1.3.1056).
After installing the newest version, I reinstalled the package but R tells me the following:
"Rtools is required to build R packages but is not currently
installed".
So, I did it, but the R tells me Rtools package is not available for R version 3.5.3.
What can I do to use tidyverse?
It could be a permissions issue, try setting the directory for where you install R packages/libraries on your computer using libpaths. I have to do this on my work laptop because the university has it set up to store things like this in a tempporary directory on the remote server which isn't desirable.
.libPaths("C:/R")
.libPaths()

package ‘titletoc’ in R

I got the error message: "package ‘titletoc’ is not available (for R version 3.6.0)" but I checked MiKTeX Console that the package "titlesec" is in the list of packages and all the packages are updates. I am using a Mac (not sure if it matters).
Then I searched online to try to install the package "titletoc" separately, but I found nowhere to download this package. Something must be wrong, anyone has a clue?

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 while running a shiny app on ubuntu

I have made a shiny app which works fine on windows, but when I tried running the same on my ubuntu system the app exists abruptly and I get following error
Loading required package: TTR
Version 0.4-0 included new data defaults. See ?getSymbols.
Error in library(rstudio) : there is no package called ‘rstudio’
After this I tried installing the 'rstudio' package and I am getting the following message:
Warning in install.packages :
package ‘rstudio’ is not available (for R version 3.2.1)
My R version is: 3.2.1 and my RStudio version is: 0.99.467
Note: I am new to ubuntu and the only reason I shifted to ubuntu, was to to use shiny-server.
The rstudio package comes with the installation of RStudio (Desktop or Server). If you need to use the rstudio package, you probably need to install RStudio (Dekstop or Server version).
You can do that from here:
https://www.rstudio.com/products/rstudio/download-server/
That said, I'm not clear on why you would need to load the rstudio package.
That is because there is no package called rstudio (at least not on CRAN anyways). Either there is a typo and you really meant the rstudioapi package, or on your windows system you actually did install a package named rstudio that, however, was distributed from another source other than CRAN. I'd suggest try removing the line library(rstudio) and see if it works.

Resources