Skip to content

Commit

Permalink
Updated the CITATION and improved documentation for get_stats()
Browse files Browse the repository at this point in the history
Changed the bib entry for the citation to `bibentry`.
  • Loading branch information
SimonGoring committed Aug 24, 2023
1 parent 9a1d488 commit 119cab4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
19 changes: 13 additions & 6 deletions R/get_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@
#' @author Simon Goring \email{goring@wisc.edu}
#' @import dplyr
#' @import tidyr
#' @description Returns the count of sites, datasets, publications and other
#' @description Returns a count of sites, datasets, publications and other
#' objects added to Neotoma during the requested time period.
#' @details This function returns summaries about the data holdings
#' within Neotoma using the existing Neotoma API's `summary` endpoint. This can
#' provide information about recent uploads (the number of new sites uploaded within the
#' last month, for example), or can be used to provide information about the overall number
#' of sites/datasets (using an arbitrarily high value for `end`).
#' @param start The starting month (from present == 0) for which to generate the summary.
#' @param end The ending month (from present == 0) for which to generate the summary.
#' @returns `data.frame` with summary statistics
#' @examples
#' last_month <- get_stats(start = 0, end = 1)
#' @export
get_stats <- function(start, end) {
base_url <- paste0("/data/summary/rawbymonth?start=",start,"&end=", end)

base_url <- paste0("/data/summary/rawbymonth?start=", start, "&end=", end)
result <- neotoma2::parseURL(base_url)

result <- result$data$data

df <- result %>% purrr::map_df(~ data.frame(
Expand All @@ -24,7 +31,7 @@ get_stats <- function(start, end) {
authors = .$authors,
countrygpid = .$countrygpid
))

return(df)

}
6 changes: 3 additions & 3 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
citHeader("To cite neotoma2 in publications use:")

citEntry(
entry = "Article",
bibentry(
bibtype = "Manual",
title = "Working with the Neotoma Paleoecology Database",
author = c(person(given = "Dominguez Vidana",
family = "Socorro",
Expand All @@ -16,8 +16,8 @@ citEntry(
doi = "10.5281/zenodo.8114874",
journal = "GitHub",
year = "2023",
url = "https://open.neotomadb.org/neotoma2/inst/doc/neotoma2-package.html",
textVersion = paste("Dominguez S, Goring S. 2023. Working with the Neotoma Paleoecology Database. GitHub. url: https://github.com/NeotomaDB/neotoma2"

)
)

12 changes: 11 additions & 1 deletion man/get_stats.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 119cab4

Please sign in to comment.