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

Open
#5,436 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start with the minimal reproducible example using data.table indexing, then run devtools::check() in an R package to reproduce the NOTE for .(). Trace how the alias is handled during package checks; done means the check no longer reports a missing global function definition for . while .() remains usable in indexing.

Written by the indexing model from the issue text.

Description

programming

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       
Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.