jmzobitz / neonSoilFlux

R Code to analyze and process soil respiration fluxes at NEON sites
GNU General Public License v3.0
6 stars 6 forks source link

Packages not loaded/functions not specifically namespaced #11

Closed naupaka closed 6 months ago

naupaka commented 8 months ago

Running acquire_neon_data(site_name ="SJER", start_date = "2020-06", end_date = "2020-06", data_file_name = "my-file-2020-06.Rda") errors out with:

Error in swc_corrections %>% filter(siteID == curr_site) %>% select(-siteID) : 
  could not find function "%>%"

I imagine this could be resolved by loading magrittr or dplyr in the function definition. Or switch to base R pipe and then use package specification approach for the functions e.g. dplyr::select()

After loading dplyr, a new error:

Error in pluck(site_co2, paste0("SCO2C_", time_frequency)) : 
  could not find function "pluck"

which could be fixed by changing to pluck() to purrr::pluck().

Then,

Error in `select()`:
! Problem while evaluating `matches(str_c("soilCO2concentration", column_selectors))`.
Caused by error in `str_c()`:
! could not find function "str_c"

which could be switched to stringr::str_c()

Error in nest(group_by(separate_wider_delim(mutate(mutate(mutate(input_positions,  : 
  could not find function "nest"

switch to tidyr::nest()

All these also suggest that the DESCRIPTION file should be updated to mention the dependencies.

Happy to fix and submit a PR if you think these changes would be ok.

jmzobitz commented 8 months ago

Yes, and I think before we get this submitted to CRAN we will need to explicitly declare those dependencies. For the moment I'll add this to the README.

naupaka commented 6 months ago

🎉 🎉