R/GET_all_obs.R

Defines functions get_all_obs

Documented in get_all_obs

#' Retourne les observations présentes dans la base de données
#'
#' @return
#' returns a dataframe with all the observations, and the type of campaign that yielded them
#' @examples
#' \dontrun{
#' get_all_obs()
#' }
#' @export
get_all_obs <- function(){
  obs_list <- rcoleo::get_gen(endpoints()$observations)
  obs_df <- do.call(rbind, obs_list$body)

  camps <- get_gen(endpoints()$campaigns)
  camps_df <- do.call(rbind, camps$body)

  merge(obs_df, camps_df, by.x = "campaign_id", by.y = "id")
}
TheoreticalEcosystemEcology/rcoleo documentation built on Oct. 20, 2020, 6:42 p.m.