klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
833 stars 47 forks source link

modules load as empty environment if saved as .R instead of .r #238

Closed eutwt closed 2 years ago

eutwt commented 2 years ago

Sorry if this has been mentioned before, couldn't find it anywhere. Would be helpful to at least document this in getting started. Took me the last 30 minutes to figure out what was going on.

If I load a file that's saved with extension .R it loads without error, but the environment contains no objects. This is the default extension when you save R files with RStudio. Tested by changing the filename of the example seq.r to seq.R.

─ Session info ──────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.1.0 (2021-05-18)
 os       macOS Big Sur 11.5.2        
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/Montreal            
 date     2021-08-26  
klmr commented 2 years ago

Could you please provide a reprex of this issue? I cannot reproduce this (and it would be a bug, not intended behaviour). Both .R and .r file extensions work, and there should be absolutely no difference between the two.

eutwt commented 2 years ago

I cannot reproduce it. Sorry for the apparently mistaken issue. Thanks for taking the time to attempt to reproduce and thanks for a great package!