#' @rdname utility
#' @export
n_profiles <- function(x) {
UseMethod("n_profiles")
}
#' @exportS3Method
n_profiles.cfp_dat <- function(x) {
nrow(x$profiles)
}
#' @exportS3Method
n_profiles.cfp_soilphys <- function(x) {
NextMethod()
}
#' @exportS3Method
n_profiles.cfp_gasdata <- function(x) {
NextMethod()
}
#' @exportS3Method
n_profiles.cfp_layers_map <- function(x) {
NextMethod()
}
#' @exportS3Method
n_profiles.cfp_profile <- function(x){
id_cols_to_n_profiles(x)
}
#### HELPERS #### ------------
id_cols_to_n_profiles <- function(x){
x[cfp_id_cols(x)] %>% dplyr::distinct() %>% nrow()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.