new installation of RStudio not working properly - macos

I am having a lot of OS issues with the new version of RStudio. I am working on a Mac.
It does not recognize the packages that I had to reinstall. The current problem I am dealing with is that source('filename.R') is not working.
I get the following:
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
trying URL 'https://cran.mirrors.hoobly.com/src/contrib/rmarkdown_2.19.tar.gz'
Content type 'application/x-gzip' length 3243575 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
* installing *source* package ‘rmarkdown’ ...
** package ‘rmarkdown’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rmarkdown)
The downloaded source packages are in
‘/private/var/folders/yk/spk56bkn22n8w43h0mr6x59xtb6t8m/T/RtmpTD79O7/downloaded_packages’
Error in eval(ei, envir) : object 'xfun' not found
I have re installed various libraries including xfun
I was having a lot of trouble knitting a markdown file so I tried to run the code from an r-script.
But I have the same error.
I am confused why it is trying to install rmarkdown and dplyr when I use source() in the script file.
Both dplyr and rmarkdown have already been installed as well as xfun.
So I think there is a problem with a path name where to find the various packages but I don't know how to fix this.

Related

Unable to load libraries

I recently updated R and Rstudio and since then have not been able to load any libraries, including ggplot2, tidyverse.
Just for clarity, let me share the messages I get when I install tidyverse and try to load the library:
install.packages("tidyverse")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
**https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Computer User 1/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/tidyverse_1.3.2.zip'
Content type 'application/zip' length 428970 bytes (418 KB)
downloaded 418 KB
package ‘tidyverse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Computer User 1\AppData\Local\Temp\RtmpQZdI11\downloaded_packages**
**> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.2.2/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
**
Also, to be clear, I did install the latest version of Rtools.
Now I tried reading through several messages on google regarding the same error but failed to understand the solution. The main thing I do not understand is why the packages are installed here: C:\Users\Computer User 1\AppData\Local\Temp\RtmpQZdI11\downloaded_packages, and then are loaded from here: C:/Program Files/R/R-4.2.2/library/stats/libs/x64/stats.dll.
I have tried specifying the library path but have not been successful at solving the problem. I don't know why R is unable to load the libraries. Also, on running .libpaths(), I get two libraries:
[1] "C:/Users/Computer User 1/AppData/Local/R/win-library/4.2"
[2] "C:/Program Files/R/R-4.2.2/library"
And when I try to install tidyverse here: C:/Program Files/R/R-4.2.2/library, I get this error: the folder is unwritable.
I don't know how to solve this issue. Please help.

rgl package has non-zero status

installing to /home/mhasanyar/R/x86_64-pc-linux-gnu-library/3.4/rgl/libs
** R
** demo
** inst
** preparing package for lazy loading
Error : object ‘hcl.colors’ is not exported by 'namespace:grDevices'
ERROR: lazy loading failed for package ‘rgl’
removing ‘/home/mhasanyar/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
You are using an old R version, earlier than R 3.6.0 where hcl.colors was introduced. The best thing you can do would be to update R, and then things should work.
If you can't do that or don't want to, then you can install rgl into versions as early as R 3.3.0, but you need to get the development version to do that. It contains a number of fixes to get it working in old R versions. The easiest way to do this is to install the remotes package, then run
remotes::install_github("dmurdoch/rgl")

How to fix library dependence in a conan package

I am trying to install qt/5.14.2 with conan.
Using
qt/5.14.2#bincrafters/stable
I receive
ERROR: libpq/11.5: Error in package_info() method, line 211
self.cpp_info.components["pq"].requires.append("zlib::zlib")
AttributeError: 'Component' object has no attribute 'requires'
OK, there is a bug in libpq/11.5
I am trying to downgrade to
libpq/11.4#bincrafters/stable
ERROR: Conflict in qt/5.14.2#bincrafters/stable:
'qt/5.14.2#bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4#bincrafters/stable' requires 'zlib/1.2.11#conan/stable'.
To fix this conflict you need to override the package 'zlib' in your root package.
BTW:
Why is it not enough to require the correct version of the library, and requiring the same repository? (and require two different repositories in two different packages for the same dependence)
OK, I attempted
zlib/1.2.11#bincrafters/stable
WARN: libpq/11.4#bincrafters/stable: requirement zlib/1.2.11#conan/stable overridden by your conanfile to zlib/1.2.11#bincrafters/stable
zlib/1.2.11#bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11#bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11#bincrafters/stable: Trying with 'minres'...
zlib/1.2.11#bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11#bincrafters/stable' from 'libpq/11.4#bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11#bincrafters/stable' in remotes
Finally, I arrived at
libpq/11.4#bincrafters/stable
zlib/1.2.11#conan/stable
qt/5.14.2#bincrafters/stable
After this, it looks like it was oK:
Installing (downloading, building) binaries...
qt/5.14.2#bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2#bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2#bincrafters/stable: Downloaded package revision 0
However, the install fails with
CMake was unable to find Qt5, put qmake in your path or set
QTDIR/QT_QMAKE_EXECUTABLE.
The package is downloaded, I see all components in the corresponding subdirectory in my home directory. However, unlike the other components, it is not installed, before CMake attempts to find it.
What do I wrong?
In case of any strange behavior of conan, upgrade! For me, switch 1.24.0 -> 1.28.1 with configs clean up fixed the same problem with libpq/11.5

Issue installing library(plyr) in R (Windows)

I have R version 3.2.2 and am working on Windows 10. I am trying to install library(plyr), but could not install 'Rcpp' dependency (see warning in bold fonts). Install message and warnings below. Any suggestions?
Thanks!
utils:::menuInstallPkgs()
also installing the dependency ‘Rcpp’
trying URL >'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.2/Rcpp_0.12.1.zip'
Content type 'application/zip' length 3189850 bytes (3.0 MB)
downloaded 3.0 MB
trying URL
'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.2/plyr_1.8.3.zip'
Content type 'application/zip' length 1114768 bytes (1.1 MB)
downloaded 1.1 MB
package ‘Rcpp’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation > >‘C:\Users\xxx\Documents\R\win-library\3.2\file2e0437cc54d8\Rcpp’ to
‘C:\Users\xxx\Documents\R\win-library\3.2\Rcpp’
package ‘plyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mydejesus\AppData\Local\Temp\Rtmp0yK2yD\downloaded_packages
library(plyr)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
vI[[j]]) :
there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘plyr’
Looks like it's a permissions setting in Windows. I changed the permission on the folder to share with everyone and it installed successfully.

Error running Rstudio after install

I get the following error message when installing Rstudio:
"Error installing package: '\corp.corpcommon.com\users\E212\MY Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing source package 'rstudio' ...
** R
** inst
Warning in file.create(to[okay]) :
cannot create file '\corp.corpcommon.com/users/E212/MY Documents/R/win-
library/3.1/rstudio/CITATION', reason 'No such file or directory'
** preparing package for lazy loading
** help
* installing help indices
** building package indices
** testing if installed package can be loaded
* arch - i386
* arch - x64
ERROR: loading failed for 'i386', 'x64'
* removing '\corp.corpcommon.com/users/E212/MY Documents/R/win-library/3.1/rstudio'
Error installing package: '\corp.corpcommon.com\users\E212\MY Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing source package 'manipulate' ...
** R
** preparing package for lazy loading
** help
* installing help indices
** building package indices
** testing if installed package can be loaded
* arch - i386
* arch - x64
ERROR: loading failed for 'i386', 'x64'
* removing '\corp.corpcommon.com/users/E212/MY Documents/R/win-library/3.1/manipulate'"
Do anyone know what it is, what it means, and how I can fix it?`
Thanks in advance :)
Rename MY Documents to MYDocuments. so the file path will be '\corp.corpcommon.com\users\E212\MYDocuments'.

Resources