Installing Pandoc in Windows 7 using R - r

I'm trying to install Pandoc on Windows 7 from R 3.1.1 using installr package. I used the following code:
library(installr)
install.pandoc()
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") : unsupported URL scheme
How can I resolve these errors?

please run:
setInternet2(TRUE)
And then try again.

Related

Troubles installing catboost in R

I keep getting the error message:
Warning in file(con, "r") :
cannot open file 'C:PROGRA~1RR-42~1.2/share/Rd/macros/system.Rd': No such file or directory
Error in file(con, "r") : cannot open the connection
Execution halted
Error: Failed to install 'unknown package' from URL:
! System command 'Rcmd.exe' failed
when I try to install catboost in R. I have tried following the docs regarding the installation process but can't get catboost working on R. Here's my code
Sys.setenv(RETICULATE_PYTHON="C:/Users/jasmi/AppData/Local/Programs/Python/Python311/")
library(reticulate)
library(devtools)
devtools::install_url('https://github.com/catboost/catboost/releases/download/v0.16.5/catboost-R-Windows-0.16.5.tgz')
library(catboost)
boxing <- readRDS('datafullboxingdatasetnew.RDS')
p <- import("pandas")
cat_model <- p$read_pickle("catmodelsummary.pkl")

R Studio gzfile error when using library() function

I am getting an error when trying to utilize any installed packages.
Here is the code I use.
install.packages("tidyverse")
> library(tidyverse)
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file 'C:/Users/M/Appdata/Local/R/win-library/4.2/vctrs/R/vctrs.rdx', probable reason 'No such file or directory'
Error: package or namespace load failed for ‘tidyverse’:
unable to load R code in package ‘vctrs’
I have tried the following:
restarting R Studio
re-installing R Studio
downloading the packages and putting them in wd()
tried moving the wd()
appreciate the help

Installing package stringi: icudt could not be downloaded. check your internet connectivity

I was trying to install stringi on R and I have this error:
on R gui interface
icudt download failed
Error in eval(ei, envir) :
icudt could not be downloaded. check your internet connectivity
* removing 'C:/Users/zzaroca/AppData/Local/Programs/R/R-4.2.0/library/stringi'
Warning message:
In install.packages(files[tarballs], .libPaths()[1L], repos = NULL, :
and this on R studio:
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.2:
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/PACKAGES'
What I can do to solve this problem? My connection to internet works perfectly and I'm trying to install on my company's computer.

error message while installing R Markdown on R version 4.0.1 on Windows

I am new to R and trying to install R Markdown on RStudio but it keeps giving me error messages eg
Warning in install.packages :
package ‘(tools)’ is not available (for R version 4.0.1)
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.0:
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/PACKAGES'
Are you sure you have internet? try install.packages("Rmarkdown", dep = TRUE) you may also need to install latex for your system

install.packages("devtools") fails

I'm new to installing packages and R,
It looks like my devtools library is missing.
I was trying to install swirl,
I got the following message :
> install.packages("swirl")
Installing package into ‘C:/Users/cory/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open destfile 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ\filef6c6874433a', reason 'No such file or directory'); using local file 'C:/PROGRA~1/R/R-35~1.1/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository https://cran.cnr.berkeley.edu/src/contrib:
cannot open destfile 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ\filef6c4b9547', reason 'No such file or directory'
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning messages:
1: package ‘swirl’ is not available (for R version 3.5.1)
2: In gzfile(file, mode) :
cannot open compressed file 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ/libloc_194_4cc5b48b.rds', probable reason 'No such file or directory'
I then tried the following :
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
So I downloaded devtools in zip format and tried loading it
> getwd()
[1] "C:/Users/cory/Documents"
I downloaded the devtools zip in the same folder, and renamed it to devtoolz zip
I tried running the command again
> install.packages("devtools")
Installing package into ‘C:/Users/cory/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open destfile 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ\filef6c77f36a9', reason 'No such file or directory'
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning messages:
1: package ‘devtools’ is not available (for R version 3.5.1)
2: In gzfile(file, mode) :
cannot open compressed file 'C:\Users\cory\AppData\Local\Temp\RtmpuA5tgZ/libloc_194_4cc5b48b.rds', probable reason 'No such file or directory'
What steps should I take to get the devtools installed?
Many thanks! :)
I found a way around this,
In case it helps someone else :
*In Rstudio, it tuns out it is possible to install a package without downloading locally and without pointing to an URL (which I also had tried). Because it is integrated with CRAN-mirrors, I was able to simply type devtools in the box and select it from the existing drop-down menu.
It proved more efficient than trying to manually import it through RGui.*
I had the same issue, I just closed my RStudio and opened it, and it worked.

Resources