International-Soil-Radiocarbon-Database / ISRaD

Repository for the development and release of ISRaD data and tools
https://international-soil-radiocarbon-database.github.io/ISRaD/
24 stars 15 forks source link

R-package "reports" function updates #127

Closed coreylawrence closed 5 years ago

coreylawrence commented 5 years ago

I've made some changes to the reports function included in the R-package. Specifically, I added 3 new report options including report="site_map", report="count_data", and report="frc_data".

Additionally, I broke the code for each report option into it's own specific function. I am using the "rep_" prefix to denote sub-functions that can be called with a call to the general "reports" function. This should allow people to easily add new report options as individual functions, which I assume is more useful if the report outputs are then used for other purposes.

I made report="count_data" the default option since it returns the most basic summary of the number of observations at each level of the database.

The next time you reinstall the database, please play around with these options and feel free to suggest changes here .

greymonroe commented 5 years ago

Thanks for putting these together. There are a few changes that need to be made for them to pass CRAN checks. If you run devtools::check() you will see the warnings. Basically the issues are because of calling column names using the tidyverse syntax. You have to add .data$ to each variable name you call. For example: entry<-mutate_all(database$metadata,as.character) %>% summarise(entries = n_distinct(entry_name))

needs to be entry<-mutate_all(database$metadata,as.character) %>% summarise(entries = n_distinct(.data$entry_name))

greymonroe commented 5 years ago

these should be working now.