#' This function will summarize the iNaturalist data queried
#' @name query_summarized
#' @description Takes user input and counts unique entries of certain columns
#' @param x the input data frame
#' @return summary_of_query the output data frame which counts unique entries of scientific name, place guess, and user ID
#' @export
#' @import dplyr
query_summarized <- function(x){
loadNamespace("dplyr")
distinct_names <- dplyr::n_distinct(x$scientific_name)
print(distinct_names)
distinct_places <- dplyr::n_distinct(x$place_guess)
print(distinct_places)
distinct_users <- dplyr::n_distinct(x$id)
print(distinct_users)
headings <- c("Scientific Name", "Place of Observation", "Unique Users")
counts <- c(distinct_names, distinct_places, distinct_users)
summary_of_query <<- data.frame(headings,counts)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.