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

R CMD check NOTE: no visible global function definition for ‘.’ #5436

Open
dvg-p4 opened this issue Aug 11, 2022 · 1 comment
Open

R CMD check NOTE: no visible global function definition for ‘.’ #5436

dvg-p4 opened this issue Aug 11, 2022 · 1 comment

Comments

@dvg-p4
Copy link
Contributor

dvg-p4 commented Aug 11, 2022

The .() alias for list() within data.table indexing brackets is not recognized as a function by R CMD check, when importing data.table in an R package.
Workaround: replace .() with list() wherever it occurs
Related issues: #850, #4741

Minimal reproducible example

Within an R package:

mydt <- data.table(foo = 1, bar = 2, baz = 3)
mydt[, .(bar, baz)]

Then run in console:

devtools::check()

Output of sessionInfo()

R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.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=en_US.UTF-8   
 [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  
[7] base     

other attached packages:
[1] RevealBiobankUICommon_0.0.0.9000
[2] data.table_1.14.0               
[3] plotly_4.9.3                    
[4] ggplot2_3.3.6                   
[5] shiny_1.7.1.55503               
[6] futile.logger_1.4.3             
[7] devtools_2.4.4                  
[8] usethis_2.1.6                   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9           tidyr_1.2.0          prettyunits_1.1.1   
 [4] ps_1.6.0             assertthat_0.2.1     rprojroot_2.0.3     
 [7] digest_0.6.29        utf8_1.1.4           mime_0.12           
[10] R6_2.5.1             futile.options_1.0.1 httr_1.4.2          
[13] pillar_1.7.0         rlang_1.0.4          curl_4.3            
[16] lazyeval_0.2.2       rstudioapi_0.13      miniUI_0.1.1.1      
[19] callr_3.6.0          urlchecker_1.0.1     desc_1.4.1          
[22] stringr_1.4.0        htmlwidgets_1.5.3    munsell_0.5.0       
[25] compiler_3.6.0       httpuv_1.6.5         xfun_0.31           
[28] pkgconfig_2.0.3      pkgbuild_1.3.1       htmltools_0.5.2     
[31] tidyselect_1.1.2     tibble_3.1.7         roxygen2_7.2.1      
[34] viridisLite_0.3.0    fansi_0.4.2          crayon_1.5.1        
[37] dplyr_1.0.8          withr_2.5.0          later_1.3.0         
[40] grid_3.6.0           jsonlite_1.8.0       xtable_1.8-4        
[43] gtable_0.3.0         lifecycle_1.0.1      DBI_1.1.1           
[46] magrittr_2.0.3       formatR_1.7          scales_1.1.0        
[49] cli_3.3.0            stringi_1.4.6        cachem_1.0.6        
[52] fs_1.5.2             promises_1.2.0.1     remotes_2.4.2       
[55] xml2_1.3.3           ellipsis_0.3.2       vctrs_0.3.8         
[58] generics_0.1.0       lambda.r_1.2.4       rcmdcheck_1.4.0     
[61] tools_3.6.0          glue_1.6.2           purrr_0.3.4         
[64] processx_3.5.1       pkgload_1.3.0        fastmap_1.1.0       
[67] colorspace_1.4-1     xopen_1.0.0          sessioninfo_1.2.2   
[70] memoise_2.0.1        knitr_1.28           profvis_0.3.7       
@tdhock
Copy link
Member

tdhock commented Aug 12, 2022

another work-around is to use . <- NULL which is documented in https://cloud.r-project.org/web/packages/data.table/vignettes/datatable-importing.html, section Dealing with “undefined global functions or variables” so I suggest closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants