How can I download a package with 'invalid active developer path'? [duplicate] - r

I just upgraded R and R Studio to the most recent versions.
I am trying to load the package RHRV and R Studio aborts the session due to a fatal error. It is associated with the following error:
loading package: tcltk
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Loading required package: tkrplot
The command:
library("tcltk")
gives the following error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning message:
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Running the following command crashes R Studio:
library("tkrplot")
Here is some additional information of interest:
sessionInfo("tcltk")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] tcltk
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tools_3.2.2
[15] utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26 stats_3.2.2
[22] datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2 gridExtra_2.0.0
[29] RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2 effects_3.0-4
[36] rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29 foreign_0.8-65
[43] proto_0.3-10
sessionInfo("tkrplot")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
character(0)
other attached packages:
[1] tkrplot_0.0-23
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tcltk_3.2.2
[15] tools_3.2.2 utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26
[22] stats_3.2.2 datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2
[29] gridExtra_2.0.0 RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2
[36] effects_3.0-4 rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29
[43] foreign_0.8-65 proto_0.3-10
Matt

With many thanks to Ben, I can provide a solution to the problem. The issue is that El Capitan has a somewhat unknown xcode issue.
Open the Terminal App and enter:
xcode-select --install
It takes a few minutes to load the patch needed to run xcode. The error described above is highlighted in several instances, and this was the workaround.
I then restarted my computer and loaded the package "tkrplot" directly from the source with the code:
install.packages("tkrplot", type="source")
Once I completed these three steps, I was able to load the package "RHRV" and the associated packages "tkrplot" and "tcltk" without issue.

You'll only have the "invalid active developer path" problem when you build package from source. If you use the pre-compiled versions from CRAN, you won't have to worry about it. Try
install.packages("tkrplot", type="binary")

Related

Trouble installing rlang in R [duplicate]

I just upgraded R and R Studio to the most recent versions.
I am trying to load the package RHRV and R Studio aborts the session due to a fatal error. It is associated with the following error:
loading package: tcltk
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Loading required package: tkrplot
The command:
library("tcltk")
gives the following error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning message:
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Running the following command crashes R Studio:
library("tkrplot")
Here is some additional information of interest:
sessionInfo("tcltk")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] tcltk
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tools_3.2.2
[15] utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26 stats_3.2.2
[22] datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2 gridExtra_2.0.0
[29] RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2 effects_3.0-4
[36] rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29 foreign_0.8-65
[43] proto_0.3-10
sessionInfo("tkrplot")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
character(0)
other attached packages:
[1] tkrplot_0.0-23
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 Formula_1.2-1 cluster_2.0.3 magrittr_1.5 splines_3.2.2 MASS_7.3-43 grDevices_3.2.2
[8] munsell_0.4.2 colorspace_1.2-6 lattice_0.20-33 minqa_1.2.4 stringr_1.0.0 plyr_1.8.3 tcltk_3.2.2
[15] tools_3.2.2 utils_3.2.2 nnet_7.3-10 grid_3.2.2 gtable_0.1.2 nlme_3.1-121 latticeExtra_0.6-26
[22] stats_3.2.2 datasets_3.2.2 survival_2.38-3 lme4_1.1-10 digest_0.6.8 base_3.2.2 Matrix_1.2-2
[29] gridExtra_2.0.0 RColorBrewer_1.1-2 nloptr_1.0.4 reshape2_1.4.1 ggplot2_1.0.1 acepack_1.3-3.3 graphics_3.2.2
[36] effects_3.0-4 rpart_4.1-10 stringi_1.0-1 methods_3.2.2 scales_0.3.0 Hmisc_3.17-0 lmerTest_2.0-29
[43] foreign_0.8-65 proto_0.3-10
Matt
With many thanks to Ben, I can provide a solution to the problem. The issue is that El Capitan has a somewhat unknown xcode issue.
Open the Terminal App and enter:
xcode-select --install
It takes a few minutes to load the patch needed to run xcode. The error described above is highlighted in several instances, and this was the workaround.
I then restarted my computer and loaded the package "tkrplot" directly from the source with the code:
install.packages("tkrplot", type="source")
Once I completed these three steps, I was able to load the package "RHRV" and the associated packages "tkrplot" and "tcltk" without issue.
You'll only have the "invalid active developer path" problem when you build package from source. If you use the pre-compiled versions from CRAN, you won't have to worry about it. Try
install.packages("tkrplot", type="binary")

error "object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet' " while loading Lime package in R -

I've successfully installed Lime (and glmnet) in R but when I try loading it i receive an error:
> require(lime)
Loading required package: lime
Error: package or namespace load failed for ‘lime’:
object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet'
Searched online and can't seem to find a solution for this.
This is my sessioninfo()
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] glmnet_3.0 Matrix_1.2-17
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 rstudioapi_0.10 magrittr_1.5 tidyselect_0.2.5 munsell_0.5.0 colorspace_1.4-1 lattice_0.20-38 R6_2.4.0 rlang_0.4.1
[10] foreach_1.4.7 dplyr_0.8.3 tools_3.6.1 grid_3.6.1 gtable_0.3.0 iterators_1.0.12 lazyeval_0.2.2 assertthat_0.2.1 tibble_2.1.3
[19] crayon_1.3.4 purrr_0.3.3 ggplot2_3.2.1 codetools_0.2-16 shape_1.4.4 glue_1.3.1 compiler_3.6.1 pillar_1.4.2 scales_1.0.0
[28] pkgconfig_2.0.3
I've updated all my packages.
glmnet loads successfully
> library(glmnet)
Loaded glmnet 3.0
The recent major update of glmnet (which now does not export coef.cv.glmnet anymore) appears to have broken lime. You can see errors with the same cause in the CRAN tests. You can expect a fix by the package maintainer soon (or the package will be archived by CRAN). See also this bug report and the answer by the maintainer:
This is due to a recent breaking change in glmnet—lime will be updated soon to fix this

Error in loading package SASxport: object ‘label<-.data.frame’ is not exported by 'namespace:Hmisc'

I'm trying to read data in the XPT format into R (the format can be found for example in the NHANES data). I found two functions doing this:
library("Hmisc")
sasxport.get("C:/path/file.XPT")
and
library("SASxport")
read.xport("C:/path/file.XPT")
The sasxport.get works, so I'm basically fine, but still inquisitive enough to understand (and solve) the following error: after the installation of the SASxport package, I cannot load it. When I run library("SASxport"), I get the error message:
Error: package or namespace load failed for ‘SASxport’:
object ‘label<-.data.frame’ is not exported by 'namespace:Hmisc'
Adopting this suggestion, I also ran
remove.packages(c("SASxport", "Hmisc"))
install.packages('Hmisc', dependencies = TRUE)
install.packages('SASxport', dependencies = TRUE)
what did not change the error message.
This is my sessionInfo():
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Hmisc_4.1-1 ggplot2_2.2.1 Formula_1.2-2 survival_2.41-3 lattice_0.20-35
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 pillar_1.0.1 compiler_3.4.3 RColorBrewer_1.1-2 plyr_1.8.4
[6] base64enc_0.1-3 iterators_1.0.9 tools_3.4.3 rpart_4.1-11 digest_0.6.13
[11] tibble_1.4.1 gtable_0.2.0 htmlTable_1.11.1 checkmate_1.8.5 rlang_0.1.6
[16] icenReg_2.0.7 Matrix_1.2-12 foreach_1.4.4 rstudioapi_0.7 yaml_2.1.16
[21] gridExtra_2.3 coda_0.19-1 stringr_1.2.0 cluster_2.0.6 knitr_1.18
[26] htmlwidgets_0.9 grid_3.4.3 nnet_7.3-12 data.table_1.10.4-3 foreign_0.8-69
[31] latticeExtra_0.6-28 magrittr_1.5 scales_0.5.0 backports_1.1.2 codetools_0.2-15
[36] htmltools_0.3.6 splines_3.4.3 colorspace_1.3-2 stringi_1.1.6 acepack_1.4.1
[41] lazyeval_0.2.1 munsell_0.4.3
The last update of SASxport happend nearly two years ago (2016-03-11). So the Hmisc package it imports might have changed in the meantime. Looking up the Hmisc archive I found the version number on 2016-03-11 to be 3.17-2. So installing this version fixes the problem:
library("devtools")
install_version("Hmisc", version = "3.17-2")
Two reasons speak against using SASxport in this case:
You need to use a old version of a package which might happer your work in later steps.
SASxport needs Hmisc for a task that Hmisc can do already by itself, so SASxport is expendable when reading in XPT files.

"caught segfault" when installing rgdal for tmap R package

My goal is to install tmap R package from CRAN. I have followed through this installation procedure prior to installing the tmap package:
https://github.com/mtennekes/tmap/blob/master/ubuntu_17_installation.sh
After install.packages("tmap") I receive an error message that identifies the problem to be with the rgdal package.
Calling install.packages("rgdal"), I received the following:
Beginning of Traceback error message:
installing to /home/larnsce/R/x86_64-pc-linux-gnu-library/3.4/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** caught segfault ***
address 0x1e, cause 'memory not mapped'
End of Traceback error message:
22: tools:::.test_load_package("rgdal", "/home/larnsce/R/x86_64-pc-linux-gnu-library/3.4")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
ERROR: loading failed
* removing ‘/home/larnsce/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
My sessionInfo():
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_CH.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_CH.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_CH.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 ggalt_0.4.0 mapdata_2.2-6 maps_3.2.0 sp_1.2-5 ggmap_2.6.1 dplyr_0.7.4
[8] purrr_0.2.3 readr_1.1.1 tidyr_0.7.1 tibble_1.3.4 ggplot2_2.2.1.9000 tidyverse_1.1.1
loaded via a namespace (and not attached):
[1] reshape2_1.4.2 haven_1.1.0 lattice_0.20-35 colorspace_1.3-2 yaml_2.1.14 rlang_0.1.2 foreign_0.8-69
[8] glue_1.1.1 RColorBrewer_1.1-2 modelr_0.1.1 readxl_1.0.0 jpeg_0.1-8 bindr_0.1 plyr_1.8.4
[15] stringr_1.2.0 munsell_0.4.3 gtable_0.2.0 cellranger_1.1.0 rvest_0.3.2 RgoogleMaps_1.4.1 mapproj_1.2-5
[22] psych_1.7.5 labeling_0.3 knitr_1.17 forcats_0.2.0 extrafont_0.17 parallel_3.4.2 Rttf2pt1_1.3.4
[29] broom_0.4.2 proto_1.0.0 Rcpp_0.12.13 KernSmooth_2.23-15 geosphere_1.5-5 scales_0.5.0.9000 jsonlite_1.5
[36] proj4_1.0-8 mnormt_1.5-5 digest_0.6.12 rjson_0.2.15 hms_0.3 png_0.1-7 stringi_1.1.5
[43] ash_1.0-15 grid_3.4.2 tools_3.4.2 magrittr_1.5 lazyeval_0.2.0 extrafontdb_1.0 pkgconfig_2.0.1
[50] MASS_7.3-47 xml2_1.1.1 lubridate_1.6.0 assertthat_0.2.0 httr_1.2.1 R6_2.2.2 nlme_3.1-131
[57] compiler_3.4.2
Installing rgdal from source gives the following different segfault message:
*** caught segfault ***
address 0x7fe075206833, cause 'invalid permissions'
This might be relevant:
./configure: line 2112: 21315 Aborted ./proj_conf_test2
checking PROJ.4: epsg found and readable... yes
./configure: line 2187: 21324 Aborted ./proj_conf_test3
checking PROJ.4: conus found and readable... yes
Other related questions I have explored
trouble in installing rgdal on ubuntu 16.04
rgdal installation difficulty on ubuntu 16.04 LTS
This is also posted as an issue on GitHub
https://github.com/mtennekes/tmap/issues/150

Installed caret in R but unable to use in library

This is the code and error message I am getting:
> library(caret)
Error : object ‘semester’ is not exported by 'namespace:lubridate'
Error: package or namespace load failed for ‘caret’
I am using a mac. I also use this at work on a PC and haven't had any problems.
I also ran sessionInfo() as adivsed
> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5
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] lattice_0.20-34 factoextra_1.0.5 FactoMineR_1.36 e1071_1.6-8
[5] GGally_1.3.0 ggrepel_0.6.5 RColorBrewer_1.1-2 stringr_1.2.0
[9] tidyr_0.6.1 dplyr_0.7.3 data.table_1.10.4 ggplot2_2.2.1
loaded via a namespace (and not attached):
[1] reshape2_1.4.1 kernlab_0.9-25 splines_3.3.3
[4] colorspace_1.3-2 prodlim_1.6.1 survival_2.40-1
[7] rlang_0.1.2 ModelMetrics_1.1.0 glue_1.1.1
[10] bindrcpp_0.2 foreach_1.4.3 bindr_0.1
[13] plyr_1.8.4 lava_1.5 dimRed_0.1.0
[16] robustbase_0.92-7 timeDate_3012.100 munsell_0.4.3
[19] gtable_0.2.0 leaps_3.0 codetools_0.2-15
[22] class_7.3-14 DEoptimR_1.0-8 Rcpp_0.12.9
[25] scales_0.4.1 flashClust_1.01-2 ipred_0.9-6
[28] scatterplot3d_0.3-40 CVST_0.2-1 stringi_1.1.2
[31] RcppRoll_0.2.2 ddalpha_1.2.1 grid_3.3.3
[34] tools_3.3.3 magrittr_1.5 lazyeval_0.2.0
[37] tibble_1.3.4 cluster_2.0.5 DRR_0.0.2
[40] pkgconfig_2.0.1 MASS_7.3-45 Matrix_1.2-8
[43] lubridate_1.5.6 gower_0.1.2 assertthat_0.1
[46] reshape_0.8.6 iterators_1.0.8 R6_2.2.0
[49] rpart_4.1-10 nnet_7.3-12 nlme_3.1-131
You may have outdated dependencies. Try updating all installed packages. Then install "caret" with all dependencies : (install.packages("caret", dependencies = TRUE)). Worked for me!
I just ran into the same issue, except I got stuck at updating (reinstalling) the lubridate package. Some of the errors I got looked something like:
./cctz/include/civil_time_detail.h:37: error: expected nested-name-specifier before ‘year_t’
./cctz/include/civil_time_detail.h:37: error: ‘year_t’ has not been declared
./cctz/include/civil_time_detail.h:37: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:37: error: expected unqualified-id before ‘=’ token
turned out my gcc compiler (running RHEL 6.8) was too old (4.4.7). Since I couldn't upgrade the compiler itself, I installed a devtoolset.
then, I fixed my problem by enabling the devtoolset before running R:
scp enable devtoolset-4 R

Resources