Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in .f(.x[[i]], ...) : attempt to apply non-function when running document() #1855

Closed
BillPetti opened this issue Aug 30, 2018 · 8 comments

Comments

@BillPetti
Copy link

I am trying to update a man file for my package and when trying to run devtools::document() I am getting a strange error:

devtools::document()
Updating baseballr documentation
Loading baseballr
Error in .f(.x[[i]], ...) : attempt to apply non-function

I've been unsuccessful searching for any reference to that error when running document(). The closest I came was this testthat issue, but installing the dev version (2.0.0.9000) did not fix it.

I have also tried backing out the changes to the underlying R file that was changed and am still seeing the same error.

I currently have roxygen2 version 6.1.0 and devtools version 1.13.6 installed.

@jimhester
Copy link
Member

Could you push the latest version of the baseballr package to github (maybe in a branch?). We will not be able to debug this without being able to reproduce it ourselves.

Also suppling the value of traceback() after the error occurs would be useful.

@BillPetti
Copy link
Author

Oops, yes that would help.

The latest version is here: BillPetti/baseballr

traceback()
11: .f(.x[[i]], ...)
10: .Call(map_impl, environment(), ".x", ".f", "list")
9: purrr::map(purrr::set_names(fields), ~dcf$get_field(.x))
8: read.description(desc_path)
7: read_pkg_description(path)
6: package_files(path)
5: parse_package(base_path, env = NULL, registry = registry, global_options = options)
4: roxygen2::roxygenise(pkg$path, roclets = roclets, load_code = ns_env)
3: force(code)
2: withr::with_envvar(r_env_vars(), roxygen2::roxygenise(pkg$path, 
       roclets = roclets, load_code = ns_env))
1: devtools::document()

Many thanks.

@jimhester
Copy link
Member

I cannot reproduce this with the CRAN versions of devtools and roxygen2. Can you give your full sessioninfo::session_info() as well and double check you have committed everything in your local repository?

@BillPetti
Copy link
Author

Sure. I've double checked my local repo matches the GitHub version.

Here's my session info:

devtools::session_info()
Session info ------------------------------------------------------------
 setting  value                       
 version  R version 3.4.1 (2017-06-30)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.0.153)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       <NA>                        
 date     2018-08-30                  

Packages ----------------------------------------------------------------
 package      * version    date       source                            
 acepack        1.4.1      2016-10-29 CRAN (R 3.4.0)                    
 assertthat     0.2.0      2017-04-11 CRAN (R 3.4.0)                    
 backports      1.1.0      2017-05-22 CRAN (R 3.4.0)                    
 base         * 3.4.1      2017-07-07 local                             
 base64enc      0.1-3      2015-07-28 CRAN (R 3.4.0)                    
 baseballr    * 0.3.4.9002 <NA>       local                             
 bindr          0.1.1      2018-03-13 cran (@0.1.1)                     
 bindrcpp       0.2.2      2018-03-29 cran (@0.2.2)                     
 bitops         1.0-6      2013-08-17 CRAN (R 3.4.0)                    
 broom          0.4.5      2018-07-03 cran (@0.4.5)                     
 checkmate      1.8.3      2017-07-03 CRAN (R 3.4.1)                    
 cluster        2.0.7-1    2018-04-09 CRAN (R 3.4.4)                    
 colorspace     1.3-2      2016-12-14 CRAN (R 3.4.0)                    
 commonmark     1.4        2017-09-01 CRAN (R 3.4.1)                    
 compiler       3.4.1      2017-07-07 local                             
 crayon         1.3.4      2018-08-30 Github (r-lib/crayon@3e751fb)     
 curl           3.2        2018-03-28 cran (@3.2)                       
 data.table     1.11.4     2018-05-27 cran (@1.11.4)                    
 datasets     * 3.4.1      2017-07-07 local                             
 desc           1.1.1      2017-08-03 CRAN (R 3.4.1)                    
 devtools     * 1.13.6     2018-06-27 CRAN (R 3.4.4)                    
 digest         0.6.16     2018-08-22 cran (@0.6.16)                    
 dplyr          0.7.6      2018-06-29 cran (@0.7.6)                     
 foreign        0.8-69     2017-06-22 CRAN (R 3.4.1)                    
 Formula        1.2-3      2018-05-03 cran (@1.2-3)                     
 ggplot2        3.0.0      2018-07-03 CRAN (R 3.4.4)                    
 glue           1.3.0      2018-07-17 cran (@1.3.0)                     
 graphics     * 3.4.1      2017-07-07 local                             
 grDevices    * 3.4.1      2017-07-07 local                             
 grid           3.4.1      2017-07-07 local                             
 gridExtra      2.3        2017-09-09 cran (@2.3)                       
 gtable         0.2.0      2016-02-26 CRAN (R 3.4.0)                    
 hexbin         1.27.2     2018-01-15 cran (@1.27.2)                    
 highcharter    0.5.0      2017-01-17 CRAN (R 3.4.0)                    
 Hmisc          4.1-1      2018-01-03 cran (@4.1-1)                     
 hms            0.4.2      2018-03-10 cran (@0.4.2)                     
 htmlTable      1.12       2018-05-26 CRAN (R 3.4.4)                    
 htmltools      0.3.6      2017-04-28 CRAN (R 3.4.0)                    
 htmlwidgets    0.9        2017-07-10 CRAN (R 3.4.1)                    
 httr           1.3.1      2017-08-20 CRAN (R 3.4.1)                    
 igraph         1.1.2      2017-07-21 CRAN (R 3.4.1)                    
 jsonlite       1.5        2017-06-01 CRAN (R 3.4.0)                    
 knitr          1.20       2018-02-20 CRAN (R 3.4.3)                    
 lattice        0.20-35    2017-03-25 CRAN (R 3.4.1)                    
 latticeExtra   0.6-28     2016-02-09 CRAN (R 3.4.0)                    
 lazyeval       0.2.1      2017-10-29 cran (@0.2.1)                     
 lubridate      1.7.4      2018-04-11 cran (@1.7.4)                     
 magrittr       1.5        2014-11-22 CRAN (R 3.4.0)                    
 MASS           7.3-47     2017-02-26 CRAN (R 3.4.1)                    
 Matrix         1.2-11     2017-08-16 CRAN (R 3.4.1)                    
 memoise        1.1.0      2017-04-21 CRAN (R 3.4.0)                    
 methods      * 3.4.1      2017-07-07 local                             
 mgcv           1.8-19     2017-08-29 CRAN (R 3.4.1)                    
 mnormt         1.5-5      2016-10-15 CRAN (R 3.4.0)                    
 munsell        0.5.0      2018-06-12 cran (@0.5.0)                     
 nlme           3.1-131    2017-02-06 CRAN (R 3.4.1)                    
 nnet           7.3-12     2016-02-02 CRAN (R 3.4.1)                    
 parallel       3.4.1      2017-07-07 local                             
 pbapply        1.3-4      2018-01-10 cran (@1.3-4)                     
 pillar         1.1.0.9000 2018-02-24 Github (hadley/pillar@25931cf)    
 pitchRx        1.8.4      2018-05-28 Github (cpsievert/pitchRx@fe6c45f)
 pkgconfig      2.0.1      2017-03-21 CRAN (R 3.4.0)                    
 plyr           1.8.4      2016-06-08 CRAN (R 3.4.0)                    
 psych          1.8.4      2018-05-06 cran (@1.8.4)                     
 purrr          0.2.5      2018-05-29 cran (@0.2.5)                     
 quantmod       0.4-10     2017-06-20 CRAN (R 3.4.1)                    
 R6             2.2.2      2017-06-17 CRAN (R 3.4.0)                    
 RColorBrewer   1.1-2      2014-12-07 CRAN (R 3.4.0)                    
 Rcpp           0.12.18    2018-07-23 cran (@0.12.18)                   
 RCurl          1.95-4.8   2016-03-01 CRAN (R 3.4.0)                    
 readr          1.1.1      2017-05-16 CRAN (R 3.4.0)                    
 reldist        1.6-6      2016-10-09 CRAN (R 3.4.0)                    
 reshape2       1.4.3      2017-12-11 cran (@1.4.3)                     
 rlang          0.2.2      2018-08-16 cran (@0.2.2)                     
 rlist          0.4.6.1    2016-04-04 CRAN (R 3.4.0)                    
 roxygen2       6.1.0      2018-07-27 CRAN (R 3.4.4)                    
 rpart          4.1-11     2017-03-13 CRAN (R 3.4.1)                    
 rprojroot      1.2        2017-01-16 CRAN (R 3.4.0)                    
 rstudioapi     0.7        2017-09-07 cran (@0.7)                       
 rvest          0.3.2      2016-06-17 CRAN (R 3.4.0)                    
 scales         1.0.0      2018-08-09 cran (@1.0.0)                     
 splines        3.4.1      2017-07-07 local                             
 stats        * 3.4.1      2017-07-07 local                             
 stringi        1.2.4      2018-07-20 cran (@1.2.4)                     
 stringr        1.3.1      2018-05-10 cran (@1.3.1)                     
 survival       2.41-3     2017-04-04 CRAN (R 3.4.1)                    
 testthat       2.0.0.9000 2018-08-30 Github (r-lib/testthat@8216ebe)   
 tibble         1.4.2      2018-01-22 cran (@1.4.2)                     
 tidyr          0.8.1      2018-05-18 cran (@0.8.1)                     
 tidyselect     0.2.4      2018-02-26 cran (@0.2.4)                     
 tools          3.4.1      2017-07-07 local                             
 TTR            0.23-2     2017-07-11 CRAN (R 3.4.1)                    
 utils        * 3.4.1      2017-07-07 local                             
 withr          2.1.2      2018-03-15 cran (@2.1.2)                     
 XML            3.98-1.15  2018-08-10 CRAN (R 3.4.4)                    
 xml2           1.2.0      2018-01-24 cran (@1.2.0)                     
 XML2R          0.0.6      2014-03-10 CRAN (R 3.4.0)                    
 xts            0.10-0     2017-07-07 CRAN (R 3.4.1)                    
 zoo            1.8-0      2017-04-12 CRAN (R 3.4.0)  

@Yue-Jiang
Copy link

I just had the same issue with my package too, but it appears to be fixed by updating from R 3.4.1 to the current R 3.5.1.

@BillPetti
Copy link
Author

BillPetti commented Sep 4, 2018

Well, this makes two of us. Updated to R 3.5.1 this morning and no longer receive the error. Documentation builds with no problem.

@Deleetdk
Copy link

Deleetdk commented Sep 27, 2018

Also worked for me (Mint 18, previous R 3.4.x).

@lock
Copy link

lock bot commented Mar 26, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants