Installing 'tm' package and getting a warning - r

I'm starting to learn R and text mining capabilities. Lately when I have been using install.packages('tm'), I get this error
Warning in install.packages :
unable to move temporary installation ‘\\HKDC01\Folder Redirection\myname\Documents\R\R-3.2.3\library\file1c1427307792\tm’ to ‘\\HKDC01\Folder Redirection\myname\Documents\R\R-3.2.3\library\tm’
The downloaded binary packages are in
C:\Users\myname\AppData\Local\Temp\RtmpsRcIY8\downloaded_packages
And when I call library(tm), I get an error as it hasn't been installed properly.

Related

Error reading file while installing package devtools (R)

I've recently installed devtools looking to create my first package. At some point I tried loading the library, and got an error when 'devtools' tried to load the dependent library 'usethis'. Whenever I'd try to install it I'd get "error reading from connection". All solutions I could find online involved restarting R and my computer. Neither worked.
Finally, I manually deleted the folder, downloaded the .zip file from CRAN, and manually installed 'usethis'. I can now load 'usethis'.
I then tried loading 'devtools' but got the same error, but now for devtools.
> install.packages(pkgs = "C:/Users/.../Downloads/devtools_2.4.3.zip",repos = NULL)
Installing package into ‘C:/Users/.../OneDrive/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
package ‘devtools’ successfully unpacked and MD5 sums checked
> library(devtools)
Loading required package: usethis
Error: package or namespace load failed for ‘devtools’ in readRDS(nsInfoFilePath):
error reading from connection
In addition: Warning messages:
1: package ‘devtools’ was built under R version 4.1.3
2: package ‘usethis’ was built under R version 4.2.0
3: In readRDS(nsInfoFilePath) : error reading the file
I tried reinstalling the package, both from CRAN and manually. I restarted R and restarted my computer, all multiple times. I even reinstalled 'usethis'.
When I reinstall devtools manually the installation exists without an error. But when I actually load it, I get the error above.
My computer is a standard personal Windows PC. No fancy configurations or firewall (beyond the standard - though that shouldn't be an issue when manually installing anyway I think). I've used this same set up for months, and have installed and used dozens of packages.
Any help would be highly appreciated.

Unable to access libraries in RStudio but not in R

I am facing a problem in RStudio when installing and using packages. I'm very very new to it so please bear with me while I describe it:
This is a new R and Rstudio installation in my PC, R version 4.1.2. For remote work due to life stuff. I usually run these same commands in my job computer with no problem (always in administrator mode).
However, when installing "readxl" to open an excel file:
> install.packages("readxl")
Installing package into ‘C:/Program Files/R/R-4.1.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/readxl_1.3.1.zip'
Content type 'application/zip' length 1717234 bytes (1.6 MB)
downloaded 1.6 MB
package ‘readxl’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘readxl’
Warning in install.packages :
problem copying C:\Program Files\R\R-4.1.2\00LOCK\readxl\libs\x64\readxl.dll to C:\Program Files\R\R-4.1.2\readxl\libs\x64\readxl.dll: Permission denied
Warning in install.packages :
restored ‘readxl’
The downloaded binary packages are in
C:\Users\Andrés RM\AppData\Local\Temp\Rtmp2RhFPr\downloaded_packages
I've read about deleting 00lockto avoid this problem but I can't find the file anywhere.
And when i check my libraries using libpath()
> .libPaths()
[1] "C:/Program Files/R/R-4.1.2" "C:/Program Files/R/R-4.1.2/library"
Then, if I want to load the library
> library(readxl)
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/Users/my_user/Documents": The system cannot find the path specified
It returns a path that I never specified in the first place and where I don't keep any other R library.
If i try to load an excel file:
R_meristem_measures <- read_excel("C:/Users/my_user/Desktop/R meristem measures.xlsx")
Error: Evaluation error: zip file 'C:\Users\my_user\Desktop\R meristem measures.xlsx' cannot be opened.
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/Users/Andrés RM/Desktop/R meristem measures.xlsx": The system cannot find the path specified
After this, .libPaths()keeps returning the same results.
This happens with some other packages that I use daily (in my other computer) and the warning is the same.
However, I just tried to run this same code in native R (R x64 4.1.2) and it went perfect with no issues.
I am at a loss here. Among others I've tried sys.setenv(R_LIBS_USER)and also changing the same environment variables from the Control panel.R_LIBS="C:/R/library"also does not work.
At work I am using R 4.0 and libPaths()returns
.libPaths()
[1] "C:/Users/my_user/Documents/R/win-library/4.0" "C:/Program Files/R/R-4.0.2/library"
which is expected since my_user/etc is where i keep my packages.
Is this a problem with my computer or with something particular from RStudio? R itself works perfect but is a pain to use and I would like to use RStudio even if I can run my stuff in R console.
Thanks to everyone

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

Unable to install bbplot package in R

I am unable to install "bbplot" package, I thought to install through devtools package, but it is not downloading as well. The following error appears while installing "devtools";
Warning in install.packages :
error 1 in extracting from zip file
Warning in install.packages :
cannot open compressed file 'DT/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
I have also tried to download using the following method but no success:
path <- "https://github.com/bbc/bbplot"
install.packages(path, repos = NULL, type = "source")
The following error appears, while installing through above method:
Error in getOctD(x, offset, len) : invalid octal digit
Warning in install.packages :
installation of package ‘C:/Users/work/AppData/Local/Temp/RtmpyC6V4z/downloaded_packages/bbplot’ had non-zero exit status
For the beginning user who is not familiar with loading packages into R Studio, you will need to do the following in this order: 1) install the devtools package. 2) Restart R Studio 3) Open the devtools library 4) Use devtools to install the BBplot package 5) Run the bbplot package
install.packages("devtools") # Adds the devtools package to R Studio library
# Reboot Computer
libaray(devtools) # opens the devtools
devtools::install_github('bbc/bbplot') # Uses devtools to install bbplot package
library(bbplot) # opens bbplot

Error installing R package - Kernsmooth

I am getting error while installing package KernSmooth. How can I install this pacakge ?
Getting warning messages on not able to access index for repository and one with package not available. Below are example warning message-
Warning: unable to access index for repository
http://lib.stat.cmu.edu/R/CRAN/src/contrib Warning message: package
‘KernSmooth’ is not available (for R version 3.2.1)

Resources