70863

attempt to apply non-function when using roxygenise(), can't find source of error

Question:

I'm trying to use add documentation to my arbitrary Rcpp package using roxygen2, and I keep getting the same error message

> roxygen2::roxygenise("anRpackage") First time using roxygen2. Upgrading automatically... Error in .f(.x[[i]], ...) : attempt to apply non-function In addition: Warning message: roxygen2 requires Encoding: UTF-8

I do not have ".f(.x[[i]])" anywhere in my source code, and I don't recognize the form ".f". Is this some kind of hidden function? How should I debug this error? I'm quite new to writing R packages, perhaps I'm missing something.... Thanks in advance!

library(Rcpp) library(RcppArmadillo) library(roxygen2) sessionInfo()

The output is the following:

R version 3.4.2 (2017-09-28) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) 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.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] roxygen2_6.1.0 RcppArmadillo_0.9.100.5.0 Rcpp_0.12.18 loaded via a namespace (and not attached): [1] compiler_3.4.2 R6_2.2.2 magrittr_1.5 tools_3.4.2 yaml_2.1.14 [6] xml2_1.1.1 stringi_1.1.6 stringr_1.2.0 commonmark_1.4

Answer1:

This is not an answer but I want to record my failed attempt at reproducing the issue. Since I am using a more current version of R and have no windows environment available, I am using a docker container with your R version. Preperations

$ docker run --rm -it rocker/r-ver:3.4.2 bash # apt-get update # apt-get install libxml2-dev # install2.r -r https://cloud.r-project.org/ RcppArmadillo roxygen2

Session info:

> library(Rcpp) > library(RcppArmadillo) > library(roxygen2) > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 9 (stretch) Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.19.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] roxygen2_6.1.0 RcppArmadillo_0.9.100.5.0 [3] Rcpp_0.12.18 loaded via a namespace (and not attached): [1] compiler_3.4.2 R6_2.2.2 magrittr_1.5 tools_3.4.2 xml2_1.2.0 [6] stringi_1.1.6 stringr_1.2.0 commonmark_1.5

Your commands:

> RcppArmadillo.package.skeleton("anRpackage"); compileAttributes("anRpackage");roxygen2::roxygenise("anRpackage") Calling package.skeleton to create basic package. Creating directories ... Creating DESCRIPTION ... Creating NAMESPACE ... Creating Read-and-delete-me ... Saving functions and data ... Making help files ... Done. Further steps are described in './anRpackage/Read-and-delete-me'. Adding RcppArmadillo settings >> added Imports: Rcpp >> added LinkingTo: Rcpp, RcppArmadillo >> added useDynLib and importFrom directives to NAMESPACE >> added Makevars file with Rcpp settings >> added Makevars.win file with RcppArmadillo settings >> added example src file using armadillo classes >> added example Rd file for using armadillo classes >> invoked Rcpp::compileAttributes to create wrappers First time using roxygen2. Upgrading automatically... Updating roxygen version in /anRpackage/DESCRIPTION Loading anRpackage Re-compiling anRpackage Running /usr/local/lib/R/bin/R CMD INSTALL /anRpackage \ '--library=/tmp/RtmpbM1VEb/devtools_install_7e040f6ccc8' --no-R --no-data \ --no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch \ --no-test-load --preclean * installing *source* package ‘anRpackage’ ... ** libs g++ -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/RcppArmadillo/include" -I/usr/local/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o g++ -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/RcppArmadillo/include" -I/usr/local/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -UNDEBUG -Wall -pedantic -g -Og -fdiagnostics-color=always -c rcpparma_hello_world.cpp -o rcpparma_hello_world.o g++ -std=gnu++11 -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o anRpackage.so RcppExports.o rcpparma_hello_world.o -fopenmp -L/usr/local/lib/R/lib -lRlapack -lblas -lgfortran -lm -lquadmath -L/usr/local/lib/R/lib -lR installing to /tmp/RtmpbM1VEb/devtools_install_7e040f6ccc8/anRpackage/libs * DONE (anRpackage) Warning: The existing 'NAMESPACE' file was not generated by roxygen2, and will not be overwritten. Warning message: roxygen2 requires Encoding: UTF-8

The only differences I am seeing are the OS and some not attached packages that are slightly newer in my docker container. Nothing that would explain the failure on your side.

Recommend

  • How to change the cost matrix in R with caret and C5.0Cost?
  • R— repeating linear regression in a large dataset
  • Installing Pytorch on Windows 10
  • Cannot get table data - HTML
  • Hosting web app bundled with webpack
  • Can we reuse allocated memory
  • Changing date format in Pentaho using javascripting
  • Get-AzureRmAppServicePlan and Get-AzureRmWebApp return exceptions in Runbook
  • How to avoid Tabs on footer when redirecting to next page [duplicate]
  • adding scopes programatically in wso2 APIM
  • Confusion about CUDA unified virtual memory
  • maven compile fails because i have a non-maven jar
  • Ansible sudo hangs after 5 tasks
  • Sinatra server won't start - “wrong number of arguments”
  • Return list of all users in BOX Enterprise Account
  • OpenSSL::X509::Certificate Showing Certificate for Wrong Domain
  • Maven, ActionBarSherlock v4 and Roboguice v2 - How do I get it to build?
  • QObject::findChild() returns None without obvious reason
  • “Complex Header” not responsive in current DataTables.net build?
  • How to browse android SDK sources in Android studio 2.0
  • Easy Way to Get Averages Based on Names in List
  • Objective-C : getting error on console while trying to display app on ipad device?
  • Get the negative of an Optional Chain
  • NHibernate proxyexception
  • UIButton Borders Function Only Gives Back White Borders
  • C# 4 and CLR Compatibility
  • How do I capture a rsolr Sunspot exception raised on a different thread from a model callback?
  • Query pkg-config variable through autotools
  • Segmentation Fault on MySQL2 / Ruby 1.9.3 / Rails 3.2
  • Cypher - matching two different possible paths and return both
  • get path to groovy source file at runtime
  • C# fibonacci function returning errors
  • How to get current document uri in XSLT?
  • Sonar maven jacoco code coverage for Multimodule project
  • Convert Type Decimal to Hex (string) in .NET 3.5
  • What is the purpose of TaskExecutor in spring?
  • Installing iPhone App to iPhone
  • Could not find rake using whenever rails
  • Cannot resolve symbol 'MyApi'
  • How do i call multiple functions using if statements that have multiple parameters in C++