I’m trying to create a package to use as a personal repository of pre-compiled Stan models and utility functions I use on a regular basis. Everything was going fine, but I started to get the error “Error in is(module, “character”) : object ‘m’ not found” when trying to document the package. The manual files for everything in the package ended up being deleted somehow after this. I spent hours trying to figure out the issue, but no luck. I ended up uninstalling R, R Studio, Rtools and deleting all of the files and libraries from my computer to get a completely fresh start.
After getting everything set up again, with the latest versions, I try to create a package.
rstan_package_skeleton(path="Stanpackage2")
Everything goes fine, and it gets to the following
- installing source package ‘Stanpackage2’ … (955ms)
** libs
C:/Rtools/mingw_64/bin/g++ -m64 -std=c++1y -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -I"…/inst/include" -I""C:/PROGRA~1/R/R-35~1.1/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"
" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -I"C:/Users/Brandon/Documents/R/win-library/3.5/BH/include" -I"C:/Users/Brandon/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/Brandon/Documents/R/win-library/3.5/RcppEigen/include" -I"C:/Users/Brandon/Documents/R/win-library/3.5/rstan/include" -I"C:/Users/Brandon/Documents/R/win-library/3.5/StanHeaders/include" -O3 -Wno-unused-variable -Wno-unused-function -c init.cpp -o init.o
C:/Rtools/mingw_64/bin/g++ -m64 -std=c++1y -shared -s -static-libgcc -o Stanpackage2.dll tmp.def init.o -LC:/PROGRA~1/R/R-35~1.1/bin/x64 -lR
installing to C:/Users/Brandon/AppData/Local/Temp/RtmpeKWLei/devtools_install_1a945327d00/Stanpackage2/libs/x64- DONE (Stanpackage2)
After which it immediately throws this same error!
In R CMD INSTALL
Error in is(module, “character”) : object ‘m’ not found
What is this error, and what can I do to fix this that a complete re-installation of the R environment won’t fix?
Below is the session/system info:
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252attached base packages:
[1] stats graphics grDevices utils datasets methods baseother attached packages:
[1] Rcpp_0.12.19 rstantools_1.5.1loaded via a namespace (and not attached):
[1] rstan_2.18.1 RcppEigen_0.3.3.4.0 clisymbols_1.2.0 tidyselect_0.2.5
[5] purrr_0.2.5 lattice_0.20-35 colorspace_1.3-2 usethis_1.4.0
[9] stats4_3.5.1 loo_2.0.0 base64enc_0.1-3 rlang_0.3.0.1
[13] pkgbuild_1.0.2 pillar_1.3.0 glue_1.3.0 withr_2.1.2
[17] bindrcpp_0.2.2 matrixStats_0.54.0 plyr_1.8.4 bindr_0.1.1
[21] stringr_1.3.1 munsell_0.5.0 commonmark_1.6 gtable_0.2.0
[25] inline_0.3.15 callr_3.0.0 ps_1.2.0 parallel_3.5.1
[29] backports_1.1.2 scales_1.0.0 desc_1.2.0 pkgload_1.0.1
[33] Stanpackage2_0.0.0.9000 StanHeaders_2.18.0 jsonlite_1.5 fs_1.2.6
[37] gridExtra_2.3 ggplot2_3.1.0 stringi_1.2.4 processx_3.2.0
[41] gh_1.0.1 dplyr_0.7.7 grid_3.5.1 rprojroot_1.3-2
[45] BH_1.66.0-1 cli_1.0.1 tools_3.5.1 magrittr_1.5
[49] lazyeval_0.2.1 tibble_1.4.2 crayon_1.3.4 whisker_0.3-2
[53] pkgconfig_2.0.2 Matrix_1.2-14 xml2_1.2.0 prettyunits_1.0.2
[57] assertthat_0.2.0 roxygen2_6.1.0 httr_1.3.1 rstudioapi_0.8
[61] R6_2.3.0 compiler_3.5.1