Unable to install lmtest package - r

I'm unable to download packages in R when using a Mac. I've tried the simple suggested solutions. Please help.
ERROR: compilation failed for package ‘lmtest’
* removing ‘/Users/Saundy/Library/R/3.4/library/lmtest’
Warning in install.packages :
installation of package ‘lmtest’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/b7/6zytq47j2k5d3knkv0zjtzbm0000gn/T/RtmpMY0uuf/downloaded_packages’

R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS High Sierra 10.13.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2 yaml_2.1.14

Related

Error loading lme4 and glmmTMB in RStudio

I'm having trouble loading lme4 (as well as some other packages such as glmmTMB, all with the same error messages). The error message is as below,
Loading required package: Matrix
Error: package or namespace load failed for ‘lme4’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/statmod/libs/statmod.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/statmod/libs/statmod.so, 6): Library not loaded: /usr/local/gfortran/lib/libgfortran.5.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/statmod/libs/statmod.so
Reason: image not found
My sessionInfo() is as below as well,
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.3
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Matrix_1.2-18
loaded via a namespace (and not attached):
[1] compiler_3.6.2 tools_3.6.2 splines_3.6.2 grid_3.6.2 packrat_0.5.0 lattice_0.20-40
It was all working fine and then all of sudden this happened, I'm not even sure why or how. Would really appreciate any help!
For anyone stuck with this or a similar issue, this was solved by installing a the package statmod. Please see here for more details

R project "unexpected string constant" error when program start

When I turn on my R project, this strange error occurred.
Error: 1:41: unexpected string constant
4:
5: if(capabilities("
^
I reinstalled it twice, but the same problem happened. The same problem occurred when installing the lower-version(3.3.1).
Due to this error, I can not make any R markdown document.
This is my session information.
sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.2 tools_3.6.2
I'm really want to know how to deal with this strange error. Thank you!

R-Rcpp package linking to nlopt library

In some ways this is a continuation of this older post, R packages with Rcpp and nloptr.
Mostly, this solution proved temporary, for several reasons, some minor, but mostly I am working to prefect this project for a cran submission and this remains the last hurdle.
That said, I attempted and failed to get this example running https://github.com/jyypma/nloptr/issues/39.
The error here is "..../sourceCpp_2.so Reason: image not found"
After, this I made a test package with nlopt installed into the 'inst' folder and 'makevars' and 'makevars.win' in the 'src' along with the test example from above.
This package is now on GitHub: https://github.com/shortyatz/Nlopt-and-Rcpp.
And gives me a similar error message to the one above.
Here is my session info:
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Rcpp_0.12.18
loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0 RcppArmadillo_0.8.600.0.0 yaml_2.2.0

Can't install package RWeka

I am trying to install the RWeka package.
install.packages("RWeka")
When I do this I get the following errors.
** package ‘RWeka’ successfully unpacked and MD5 sums checked
Need at least Java version 1.7/7.0.
ERROR: configuration failed for package ‘RWeka’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RWeka’
Warning in install.packages :
installation of package ‘RWeka’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/qq/lyrzyp0119x1zmld972mbfz00000gn/T/Rtmp9xnRxx/downloaded_packages’
I have tried updating/altering Java but that does not seem to be the problem
Here is the session info:
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] rsconnect_0.4.3 tools_3.3.1

RStudio crashes with call to getURL in RCurl

I am using the latest stable release of R (3.2.0) with RStudio (0.98.1103) on Mac OS 10.10.3.
When calling getURL from the RCurl package RStudio terminates with a fatal error.
This does not happen when using R from the command line, only in RStudio.
library("RCurl")
getURL("http://www.omegahat.org/RCurl/")
Checking the output of sessionInfo(), system.file(), and .libPaths() after library("RCurl") does indeed lead me to believe I am using the same version of R and RCurl in both scenarios.
Executing R from the command line:
> library("RCurl")
Loading required package: bitops
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.6 bitops_1.0-6
> system.file()
[1] "/Library/Frameworks/R.framework/Resources/library/base"
> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library"
and then from inside RStudio:
> library("RCurl")
Loading required package: bitops
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.6 bitops_1.0-6
loaded via a namespace (and not attached):
[1] tools_3.2.0
> system.file()
[1] "/Library/Frameworks/R.framework/Resources/library/base"
> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library"
Any help greatly appreciated.
This seems to have been fixed with upgrading to Mac OS 10.10.5, RStudio Version 0.99.489 and the latest R 3.2.3

Resources