How to install RtidyHTML on Mac? - r

Any ideas how I can install RTidyHTML when I get the following error message?
install.packages("RTidyHTML", repos = "http://www.omegahat.org/R", type="source")
trying URL 'http://www.omegahat.org/R/src/contrib/RTidyHTML_0.2-1.tar.gz'
Content type 'application/x-gzip' length 554953 bytes (541 Kb)
opened URL
==================================================
downloaded 541 Kb
* installing *source* package ‘RTidyHTML’ ...
./configure: line 3: make: command not found
ERROR: configuration failed for package ‘RTidyHTML’
* removing ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML’

You need to install XCode on your Mac if you want to compile from source. (Roman's comment only applies to Windows machines.) I just tried installing it on an XCode-equipped Mac running R 2.13.0 and get first a warning during compliation
ld warning: in libtidy/libtidy.a, file is not of required architecture
installing to /Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64
... and then get an error during the test load that is part of the install script:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64/RTidyHTML.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64/RTidyHTML.so, 6): Symbol not found: _tidyBufFree
Referenced from: /Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64/RTidyHTML.so
Expected in: dynamic lookup
I suppose it is possible that it may compile under a 32 bit version of R on the Mac.64-bit. See Simon Urbanek's web page: for more specifics and some installers for other packages.
EDIT: Installation while running 32bit R from the GUI was successful with a current R (version 2.13.1 RC (2011-07-03 r56263) )

Related

problem installing nloptr 2.0.0 on debian 9 with R 4.2.0 and cmake 3.23.1

on my machine debian 9 (stretch), i have installed R4.2.0 from source.
i have problem to install nloptr 2.0.0 using syntax:
if (!require("nloptr", quietly = TRUE)) BiocManager::install("nloptr")
the error i get is:
/opt/R/4.2.0/lib/R/etc/Makeconf:177: recipe for target 'test-C-API.o' failed
make: *** [test-C-API.o] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr’
The downloaded source packages are in
‘/tmp/Rtmpqk35gk/downloaded_packages’
Warning message:
In install.packages(...) :
installation of package ‘nloptr’ had non-zero exit status
I have tried, also, to install it by copying compiled binaries i have found online, but then i have this error:
> library(nloptr)
Error: package or namespace load failed for ‘nloptr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so':
/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so: invalid ELF header
I have checked the header and machine info, but i dont know what to do next:
base) root#kanta:/home/ezop/R/x86_64-pc-linux-gnu-library/4.2# file /home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so
/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so: Mach-O 64-bit x86_64 dynamically linked shared library, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|NO_REEXPORTED_DYLIBS|HAS_TLV_DESCRIPTORS>
(base) root#kanta:/home/ezop/R/x86_64-pc-linux-gnu-library/4.2# uname -a
Linux kanta 4.9.0-18-amd64 #1 SMP Debian 4.9.303-1 (2022-03-07) x86_64 GNU/Linux
I was having the same problem a few minutes ago. I tried installing cmake and gfortran but with little success. I noticed, when I was trying install.packages("nloptr") for the last time, this error message: There are binary versions available but the source versions are later. Do you want to install from sources the package which needs compilation?.
Jenny Bryan explains here that a simple "No" would do.
I hope this is useful for you too.

Loading packages in R and RStudio gives image not found error

When trying to load packages in RStudio or R, I get "image not found" errors, e.g.:
> install.packages("Rcpp")
Installing package into ‘/Users/blah/Library/R/4.0/library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/Rcpp_1.0.6.tgz'
Content type 'application/x-gzip' length 3203922 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
The downloaded binary packages are in
/var/folders/q5/9z9mngy52lx6gbjtc_tg5w2wwn7x6k/T//RtmpZwoJ1y/downloaded_packages
> library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/blah/Library/R/4.0/library/Rcpp/libs/Rcpp.so':
dlopen(/Users/blah/Library/R/4.0/library/Rcpp/libs/Rcpp.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Users/blah/Library/R/4.0/library/Rcpp/libs/Rcpp.so
Reason: image not found
> detach("package:Rcpp", unload = TRUE)
Error in detach("package:Rcpp", unload = TRUE) : invalid 'name' argument
The same thing happens for many other packages in the User Library e.g. sp, kernlab, gplots, gtools (but not all of them e.g. crayon loads ok). Packages in the System library load fine.
Similar things happen in R, but not with the same set of packages e.g. Rcpp works here but kernlab still does not:
> library(Rcpp)
> detach("package:Rcpp", unload = TRUE)
> library(kernlab)
Error: package or namespace load failed for ‘kernlab’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/blah/Library/R/4.0/library/kernlab/libs/kernlab.so':
dlopen(/Users/blah/Library/R/4.0/library/kernlab/libs/kernlab.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
Referenced from: /Users/blah/Library/R/4.0/library/kernlab/libs/kernlab.so
Reason: image not found
> detach("package:kernlab", unload = TRUE)
Error in detach("package:kernlab", unload = TRUE) :
invalid 'name' argument
I'm running on MacOS 11.2.3 and recently updated XCode (12.4) and CommandLineTools - this seemed to break a few things so I suspect there may be a connection. R is version 4.0.4 and RStudio is version 1.4.1106.
How do I go about trying to fix this?
I fixed this by using brew to uninstall R and Rstudio and reinstalling - but it only worked if I installed R from the cask, although the versions of R and RStudio remained the same.
The main difference I can see is that my new Makeconf file has a -mmacosx-version-min=10.13 flag set for CC, CXX, CXX11 etc (compiler is clang).

Unable to install library functions of qdap on mac

I'm working on a project on R studio and I got a error message while installing qdap on my mac and running the library function.
And this is what I got.
install.packages('qdap')
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/qdap_2.3.0.tgz'
Content type 'application/x-gzip' length 4164745 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
The downloaded binary packages are in
/var/folders/0v/c58lzwxd513g64xxc0gd85rm0000gn/T//RtmphbntNA/downloaded_packages
> library('qdap')
Error: package or namespace load failed for ‘qdap’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found
I found that the problem is that R is not able to locate Java_home correctly.
Steps to follow:
Download and install Java JDK if you haven't already done so.
In Terminal, find java location by typing which java
Set JAVA_HOME in R as Sys.setenv("JAVA_HOME" = 'your java location such as /usr/bin/java').
Try reinstalling the packages openNLP, rJava, and qdap.

Error running RNetCDF library in R

I'm having difficulty installing this R package. It seems to install, but then fails to run with the following error. The type='source' also fails. Any idea what's going wrong?
> install.packages('RNetCDF')
Installing package into ‘/Users/robinedwards/Library/R/3.1/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.ma.imperial.ac.uk/bin/macosx/mavericks/contrib/3.1/RNetCDF_1.6.2-3.tgz'
Content type 'application/x-gzip' length 2112407 bytes (2.0 Mb)
opened URL
==================================================
downloaded 2.0 Mb
The downloaded binary packages are in
/var/folders/_s/ppznw4sx7p51kwv__hj3d8540000gn/T//RtmptxKC3g/downloaded_packages
> require(RNetCDF)
Loading required package: RNetCDF
Error : .onLoad failed in loadNamespace() for 'RNetCDF', details:
call: NULL
error: I/O error (udunits)
The problem appears to be udunits2, which RNetCDF uses and ncdf does not. Specifically
>> --with-udunits-lib='/soft/local/udunits-2.1.23/lib'"
is that path in the ld.so cache or in LD_LIBRARY_PATH? If not, it will not be found by dlload.
I actually found several threads about this error and every one of them involved Mac OS X. Is that what you're running?
Source: https://stat.ethz.ch/pipermail/r-help/2011-September/289074.html

R bioconductor mzR library load error

Hope somebody could help me .. I'm trying to install the mzmatch.R package for metabolomics, following the instructions here: http://mzmatch.sourceforge.net/tutorial.mzmatch.r.php
I'm completely new to R so this is my first time doing this sort of thing. First, I downloaded the latest version of R and installed it on Mac OSX 10.7. This is the version of R that I have running:
R 2.15.0 GUI 1.51 Leopard build 64-bit (6148)
Then I launched R64.app and typed the following commands (as specified in the instructions in the link above) to install the package and all its dependencies.
> source("http://bioconductor.org/biocLite.R")
> biocLite(c("faahKO", "xcms", "multtest"))
> install.packages(c("rJava","XML","snow","caTools","bitops","ptw"))
> source ("http://puma.ibls.gla.ac.uk/mzmatch.R/install_mzmatch.R")
The last step will always fail with the following message:
trying URL 'http://puma.ibls.gla.ac.uk/mzmatch.R/mzmatch.R.tar.gz'
Content type 'application/x-gzip' length 104535 bytes (102 Kb)
opened URL
==================================================
downloaded 102 Kb
* installing *source* package ‘mzmatch.R’ ...
** R
** preparing package for lazy loading
Error : .onLoad failed in loadNamespace() for 'mzR', details:
call: value[[3L]](cond)
error: failed to load module Ramp from package mzR
could not find function "errorOccured"
Error : package ‘mzR’ could not be loaded
ERROR: lazy loading failed for package ‘mzmatch.R’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mzmatch.R’
Warning message:
In install.packages(pkgs = "mzmatch.R.tar.gz", repos = NULL, type = "source") :
installation of package ‘mzmatch.R.tar.gz’ had non-zero exit status
I thought this was because the library "mzR" cannot be loaded, so I tried:
> biocLite("mzR")
> library("mzR")
and sure enough, the same error appeared:
Loading required package: Rcpp
Error : .onLoad failed in loadNamespace() for 'mzR', details:
call: value[[3L]](cond)
error: failed to load module Ramp from package mzR
could not find function "errorOccured"
Error: package/namespace load failed for ‘mzR’
I'm quite lost now, and not sure what to do at all. Thanks for reading !
Assuming you are running mzR v1.2.1 and Rcpp v0.9.12, the problem you see is an unfortunate and unexpected incompatibility between the two. In the meantime, downgrading to Rcpp_0.9.10.zip will fix the issue. Hope to commit a proper fix soon.
Laurent
UDAPE: The issue was the result of compiler/linker error and required a fresh mzR build, which is now available through biocLite.

Resources