diff --git a/.gitignore b/.gitignore index d277f0384..8b37fe243 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ Makevars Makevars.* *.gcda *.gcno +^_snaps + diff --git a/DESCRIPTION b/DESCRIPTION index 6960f114f..47158ab27 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sits Type: Package -Version: 0.15.0-4 +Version: 0.15.1 Title: Satellite Image Time Series Analysis for Remote Sensing Data Cubes Authors@R: c(person('Rolf', 'Simoes', role = c('aut'), email = 'rolf.simoes@inpe.br'), person('Gilberto', 'Camara', role = c('aut', 'cre'), email = 'gilberto.camara@inpe.br'), @@ -43,7 +43,8 @@ Imports: parallel, purrr (>= 0.3.0), raster (>= 3.4), - rstac (>= 0.9.1-4), + Rcpp (>= 1.0.7), + rstac (>= 0.9.1-5), sf (>= 0.9), slider (>= 0.1.5), stats, @@ -67,7 +68,6 @@ Suggests: nnet, openxlsx, randomForest, - Rcpp, RcppArmadillo, Rwtss (>= 0.9.1), scales, @@ -90,7 +90,6 @@ Collate: 'sits_accuracy.R' 'sits_bands.R' 'sits_bbox.R' - 'sits_brewer.R' 'sits_classification.R' 'sits_classify_ts.R' 'sits_classify_cube.R' @@ -107,13 +106,10 @@ Collate: 'sits_filters.R' 'sits_gdalcubes.R' 'sits_get_data.R' - 'sits_indexes.R' 'sits_imputation.R' 'sits_keras.R' 'sits_labels.R' - 'sits_labels_set.R' 'sits_label_classification.R' - 'sits_labels_summary.R' 'sits_machine_learning.R' 'sits_merge.R' 'sits_mlp.R' @@ -144,6 +140,7 @@ Collate: 'sits_source_api_bdc.R' 'sits_source_api_deafrica.R' 'sits_source_api_local.R' + 'sits_source_api_mspc.R' 'sits_source_api_satveg.R' 'sits_source_api_stac.R' 'sits_source_api_usgs.R' diff --git a/NAMESPACE b/NAMESPACE index c11780d95..ae9573221 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,6 @@ # Generated by roxygen2: do not edit by hand -S3method("sits_labels<-",pattern) +S3method("sits_labels<-",probs_cube) S3method("sits_labels<-",sits) S3method(.raster_check_package,default) S3method(.raster_check_package,raster) @@ -58,6 +58,7 @@ S3method(.raster_yres,terra) S3method(.sits_roi_bbox,ll) S3method(.sits_roi_bbox,sf) S3method(.sits_roi_bbox,xy) +S3method(.source_collection_access_test,mspc_cube) S3method(.source_collection_access_test,satveg_cube) S3method(.source_collection_access_test,stac_cube) S3method(.source_collection_access_test,wtss_cube) @@ -75,19 +76,26 @@ S3method(.source_items_cube,stac_cube) S3method(.source_items_cube,wtss_cube) S3method(.source_items_fileinfo,stac_cube) S3method(.source_items_fileinfo,wtss_cube) +S3method(.source_items_new,"mspc_cube_landsat-8-c2-l2") +S3method(.source_items_new,"mspc_cube_sentinel-2-l2a") S3method(.source_items_new,aws_cube) S3method(.source_items_new,bdc_cube) S3method(.source_items_new,deafrica_cube) S3method(.source_items_new,usgs_cube) S3method(.source_items_new,wtss_cube) S3method(.source_items_tile_get_bbox,stac_cube) +S3method(.source_items_tile_get_crs,"mspc_cube_landsat-8-c2-l2") +S3method(.source_items_tile_get_crs,"mspc_cube_sentinel-2-l2a") S3method(.source_items_tile_get_crs,aws_cube) S3method(.source_items_tile_get_crs,bdc_cube) S3method(.source_items_tile_get_crs,deafrica_cube) S3method(.source_items_tile_get_crs,usgs_cube) +S3method(.source_items_tile_get_name,"mspc_cube_sentinel-2-l2a") S3method(.source_items_tile_get_name,bdc_cube) S3method(.source_items_tile_get_name,deafrica_cube) S3method(.source_items_tile_get_name,stac_cube) +S3method(.source_items_tiles_group,"mspc_cube_landsat-8-c2-l2") +S3method(.source_items_tiles_group,"mspc_cube_sentinel-2-l2a") S3method(.source_items_tiles_group,aws_cube) S3method(.source_items_tiles_group,bdc_cube) S3method(.source_items_tiles_group,deafrica_cube) @@ -145,6 +153,7 @@ S3method(sits_timeline,probs_cube) S3method(sits_timeline,raster_cube) S3method(sits_timeline,satveg_cube) S3method(sits_timeline,sits) +S3method(sits_timeline,sits_model) S3method(sits_timeline,wtss_cube) S3method(sits_values,bands_cases_dates) S3method(sits_values,bands_dates_cases) @@ -168,42 +177,32 @@ export(sits_cluster_dendro) export(sits_cluster_frequency) export(sits_config) export(sits_config_show) -export(sits_create_folds) export(sits_cube) -export(sits_data_to_csv) -export(sits_envelope) export(sits_filter) export(sits_formula_linear) export(sits_formula_logref) -export(sits_from_zoo) export(sits_get_data) export(sits_impute_linear) export(sits_interp) -export(sits_keras_diagnostics) export(sits_kfold_validate) export(sits_label_classification) export(sits_labels) export(sits_labels_summary) -export(sits_linear_interp) export(sits_list_collections) export(sits_merge) export(sits_metadata_to_csv) -export(sits_missing_values) export(sits_mlp) export(sits_mlr) export(sits_mutate_bands) -export(sits_ndwi) export(sits_patterns) export(sits_regularize) export(sits_rfor) export(sits_sample) -export(sits_savi) export(sits_select) export(sits_sgolay) export(sits_show_prediction) export(sits_smooth) export(sits_som_clean_samples) -export(sits_som_cluster) export(sits_som_evaluate_cluster) export(sits_som_map) export(sits_svm) @@ -217,6 +216,7 @@ export(sits_values) export(sits_view) export(sits_whittaker) export(sits_xgboost) +importFrom(Rcpp,sourceCpp) importFrom(data.table,":=") importFrom(lubridate,"%m+%") importFrom(lubridate,"%within%") diff --git a/NEWS.md b/NEWS.md index 197c9e049..b0bd96790 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,30 @@ We are preparing to release the package on CRAN and are making relevant changes in the development version. +# What's new in SITS version 0.15.1 + +### New features in SITS version 0.15.1 +* Update README.Rmd +* Support `sits_timeline()` to sits model objects +* Update drone image +* Simplify `config_colors.yml` by removing palette names +* Temporary python files are being generated in the check +* Organise color handling in SITS +* Organise configuration files +* Improve preconditions in `sits_regularize()` +* Compress external data with bzip2 +* Update gdalcubes format files +* Update rstac version +* Check provided parameters in sits_regularize function +* Use default palette for SOM colors +* Remove `start_date` and `end_date` from validation csv file +* Use a default brewer palette to plot classified cube +* Improve package help pages +* Remove unused data sets +* Remove rarely used functions +* `sits_regularize()` is producing *Float64* images as output +* Full support for Microsoft Planetary Computing + # What's new in SITS version 0.15.0 ### New features in SITS version 0.15.0-4 diff --git a/R/data.R b/R/data.R index ed06f7d38..7bb48e9a8 100644 --- a/R/data.R +++ b/R/data.R @@ -57,64 +57,3 @@ NULL #' cube (the name of the cube associated with the data), #' time_series (list containing a tibble with the values of the time series). NULL - -#' @title Samples of nine classes for the state of Mato Grosso -#' -#' @description A dataset containing a tibble with time series samples -#' for the Mato Grosso state in Brasil. -#' The time series come from MOD13Q1 collection 6 images. -#' The data set has the following classes: -#' Cerrado, Fallow_Cotton, Forest, Pasture, -#' Soy_Corn, Soy_Cotton, Soy_Fallow, -#' Soy_Millet, and Soy_Sunflower. -#' -#' @docType data -#' @keywords datasets -#' @name samples_mt_6bands -#' @usage data(samples_mt_6bands) -#' @format A tibble with 425 rows and 7 variables: -#' longitude: East-west coordinate of the time series sample (WGS 84), -#' latitude (North-south coordinate of the time series sample in WGS 84), -#' start_date (initial date of the time series), -#' end_date (final date of the time series), -#' label (the class label associated to the sample), -#' cube (the name of the cube associated with the data), -#' time_series (list containing a tibble with the values of the time series). -NULL - -#' @title A time series in the ZOO format -#' -#' @description A dataset containing a one ZOO time series samples -#' in the Mato Grosso state of Brazil. -#' The time series comes from MOD13Q1 collection 5 images. -#' -#' @docType data -#' @keywords datasets -#' @name ts_zoo -#' @usage data(ts_zoo) -#' @format A ZOO time series with bands NDVI and EVI for a one year period -NULL - -#' @title The timeline for the sequence of images for MOD13Q1 collection 6 -#' -#' @description The timeline for the time series used in the examples -#' that use data from MODIS collection 6. -#' There are 407 instances from 2000-02-18 until 2017-10-16. -#' @docType data -#' @keywords datasets -#' @name timeline_2000_2017 -#' @usage data(timeline_2000_2017) -#' @format A vector with 407 dates in YYYY-MM-DD format. -NULL - -#' @title The timeline for the sequence of images one year (2013 to 2014) -#' -#' @description The timeline for the time series used in the examples -#' that use data for one year classification. -#' There are 23 instances from 2013-09-14 until 2014-08-29. -#' @docType data -#' @keywords datasets -#' @name timeline_2013_2014 -#' @usage data(timeline_2013_2014) -#' @format A vector with 23 dates in YYYY-MM-DD format. -NULL diff --git a/R/sits-package.R b/R/sits-package.R index 34eabdb4f..e3e444548 100644 --- a/R/sits-package.R +++ b/R/sits-package.R @@ -2,7 +2,7 @@ #' @description Satellite Image Time Series Analysis #' for Earth Observation Data Cubes #' -#' @section SITS API: +#' @section Purpose: #' #' The SITS package provides a set of tools for analysis, #' visualization and classification of satellite image time series. diff --git a/R/sits_ResNet.R b/R/sits_ResNet.R index 57292516d..ab264a108 100644 --- a/R/sits_ResNet.R +++ b/R/sits_ResNet.R @@ -1,4 +1,4 @@ -#' @title Train a model using the ResNet model +#' @title Train ResNet classification models #' @name sits_ResNet #' #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} @@ -96,12 +96,10 @@ sits_ResNet <- function(samples = NULL, stop("Please install package keras", call. = FALSE) } - valid_activations <- c("relu", "elu", "selu", "sigmoid") - # pre-conditions .check_chr_within( x = activation, - within = valid_activations, - discriminator = "any_of", + within = .config_get("dl_activation_methods"), + discriminator = "one_of", msg = "invalid CNN activation method" ) diff --git a/R/sits_TempCNN.R b/R/sits_TempCNN.R index aaa7b9167..f979e8fab 100644 --- a/R/sits_TempCNN.R +++ b/R/sits_TempCNN.R @@ -1,5 +1,5 @@ -#' @title Train a model using the Temporal Convolutional Neural Network +#' @title Train temporal convolutional neural network models #' @name sits_TempCNN #' #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} @@ -95,9 +95,6 @@ sits_TempCNN <- function(samples = NULL, stop("Please install package keras", call. = FALSE) } - # pre-conditions - valid_activations <- c("relu", "elu", "selu", "sigmoid") - .check_length( x = cnn_layers, len_min = length(cnn_kernels), @@ -124,14 +121,14 @@ sits_TempCNN <- function(samples = NULL, .check_chr_within( x = cnn_activation, - within = valid_activations, + within = .config_get("dl_activation_methods"), discriminator = "one_of", msg = "invalid CNN activation method" ) .check_chr_within( x = dense_layer_activation, - within = valid_activations, + within = .config_get("dl_activation_methods"), discriminator = "one_of", msg = "invalid node activation method" ) diff --git a/R/sits_accuracy.R b/R/sits_accuracy.R index 8a93f1bcf..3233cd43f 100644 --- a/R/sits_accuracy.R +++ b/R/sits_accuracy.R @@ -1,4 +1,4 @@ -#' @title Area-weighted classification accuracy assessment +#' @title Assess classification accuracy (area-weighted method) #' @name sits_accuracy #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' @author Alber Sanchez, \email{alber.ipia@@inpe.br} @@ -167,7 +167,10 @@ sits_accuracy.classified_image <- function(data, ..., validation_csv) { stringsAsFactors = FALSE)) # Precondition - check if CSV file is correct - .sits_csv_check(csv_tb) + .check_chr_contains( + x = colnames(csv_tb), + contains = c("longitude", "latitude", "label"), + msg = "invalid csv file") # find the labels of the cube labels_cube <- sits_labels(data) @@ -204,8 +207,7 @@ sits_accuracy.classified_image <- function(data, ..., validation_csv) { points_row <- dplyr::filter( points, X >= row$xmin & X <= row$xmax & - Y >= row$ymin & Y <= row$ymax, - start_date == row$file_info[[1]]$start_date + Y >= row$ymin & Y <= row$ymax ) # if there are no points in the cube, return an empty list diff --git a/R/sits_bands.R b/R/sits_bands.R index 7c01f3830..e4eb5cd9c 100644 --- a/R/sits_bands.R +++ b/R/sits_bands.R @@ -1,11 +1,11 @@ -#' @title Informs the names of the bands +#' @title Get the names of the bands #' #' @name sits_bands #' #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' -#' @description Finds/replaces the names of the bands of +#' @description Finds the names of the bands of #' a set of time series or of a data cube #' #' @param x Valid sits tibble (time series or a cube) @@ -15,7 +15,7 @@ #' @examples { #' # Retrieve the set of samples for Mato Grosso (provided by EMBRAPA) #' # show the bands -#' sits_bands(samples_mt_6bands) +#' sits_bands(samples_modis_4bands) #' } #' #' @export diff --git a/R/sits_brewer.R b/R/sits_brewer.R deleted file mode 100644 index e7b104206..000000000 --- a/R/sits_brewer.R +++ /dev/null @@ -1,6022 +0,0 @@ -#' @title Brewer color schemes -#' @name .sits_brewer_color_name -#' @keywords internal -#' -#' @description Brewer color schemes names -#' -#' @param name name of the brewer color set. -#' @return A string with the common color set name. -.sits_brewer_color_name <- function(name = NULL) { - # approximate equivalent names in ISCC-NBS system - # see http://en.wikipedia.or"g/wiki/ISCC-NBS_system - names <- tibble::lst( - "BuGn" = "BuGn", - "BlueishGreens" = "BuGn", - "BlueGreens" = "BuGn", - "BlueGreen" = "BuGn", - "BuPu" = "BuPu", - "BlueishPurples" = "BuPu", - "BluePurples" = "BuPu", - "BluePurple" = "BuPu", - "GnBu" = "GnBu", - "GreenishBlues" = "GnBu", - "GreenBlues" = "GnBu", - "GreenBlue" = "GnBu", - "OrRd" = "OrRd", - "OrangishReds" = "OrRd", - "OrangeReds" = "OrRd", - "OrangeRed" = "OrRd", - "PuBu" = "PuBu", - "PurplishBlues" = "PuBu", - "PurpleBlues" = "PuBu", - "PurpleBlue" = "PuBu", - "PuBuGn" = "PuBuGn", - "PurplishBlueGreens" = "PuBuGn", - "PurpleBlueGreens" = "PuBuGn", - "PurpleBlueGreen" = "PuBuGn", - "PuRd" = "PuRd", - "PurplishReds" = "PuRd", - "PurpleReds" = "PuRd", - "PurpleRed" = "PuRd", - "RdPu" = "RdPu", - "ReddishPurples" = "RdPu", - "RedPurples" = "RdPu", - "RedPurple" = "RdPu", - "YlGn" = "YlGn", - "YellowishGreens" = "YlGn", - "YellowGreens" = "YlGn", - "YellowGreen" = "YlGn", - "YlGnBu" = "YlGnBu", - "YellowishGreenBlues" = "YlGnBu", - "YellowGreenBlues" = "YlGnBu", - "YellowGreenBlue" = "YlGnBu", - "YlOrBr" = "YlOrBr", - "YellowishOrangeBrowns" = "YlOrBr", - "YellowOrangeBrowns" = "YlOrBr", - "YellowOrangeBrown" = "YlOrBr", - "YlOrRd" = "YlOrRd", - "YellowishOrangereds" = "YlOrRd", - "YellowOrangeReds" = "YlOrRd", - "YellowOrangeRed" = "YlOrRd", - "Blues" = "Blues", - "Blue" = "Blues", - "Greens" = "Greens", - "Green" = "Greens", - "Greys" = "Greys", - "Grey" = "Greys", - "Grays" = "Greys", - "Gray" = "Greys", - "Oranges" = "Oranges", - "Orange" = "Oranges", - "Purples" = "Purples", - "Purple" = "Purples", - "Reds" = "Reds", - "Red" = "Reds", - "BrBG" = "BrBG", - "BrownsBlueGrens" = "BrBG", - "BrownsWhiteBlueGreens" = "BrBG", - "BrownsWhiteBlueGreen" = "BrBG", - "BrownsBlueGreens" = "BrBG", - "BrownBlueGreen" = "BrBG", - "PiYG" = "PiYG", - "PurplesWhiteYellowGreens" = "PiYG", - "PurplesYellowGreens" = "PiYG", - "PurplesYellowGreen" = "PiYG", - "PurplesYellowsGreens" = "PiYG", - "PRGn" = "PRGn", - "PurpleRedsWhiteGreens" = "PRGn", - "PurplesRedsWhiteGreens" = "PRGn", - "PurplesRedsGreens" = "PRGn", - "PurpleRedWhiteGreen" = "PRGn", - "PurpleRedGreen" = "PRGn", - "PuOr" = "PuOr", - "PurplesWhiteOranges" = "PuOr", - "PurplesOranges" = "PuOr", - "PurpleOrange" = "PuOr", - "RdBu" = "RdBu", - "RedsWhiteBlues" = "RdBu", - "RedWhiteBlue" = "RdBu", - "RedBlue" = "RdBu", - "RedsBlues" = "RdBu", - "RdGy" = "RdGy", - "RedsWhiteGreys" = "RdGy", - "RedsGreys" = "RdGy", - "RedGrey" = "RdGy", - "RdYlBu" = "RdYlBu", - "ReddishYellowWhiteBlues" = "RdYlBu", - "RedsYellowsBlues" = "RdYlBu", - "RedYellowWhiteBlue" = "RdYlBu", - "RedYellowBlue" = "RdYlBu", - "RdYlGn" = "RdYlGn", - "ReddishYellowWhiteGreens" = "RdYlGn", - "RedsYellowsWhitesGreens" = "RdYlGn", - "RedYellowWhiteGreen" = "RdYlGn", - "RedsYellowsGreens" = "RdYlGn", - "RedYellowGreen" = "RdYlGn", - "Spectral" = "Spectral", - "Paired" = "Paired", - "Pastel1" = "Pastel1", - "Pastel2" = "Pastel2", - "Set1" = "Set1", - "Set2" = "Set2", - "Set3" = "Set3", - "Accent" = "Accent", - "Dark" = "Dark2", - "Dark2" = "Dark2" - ) - if (purrr::is_null(name)) { - return(names) - } - return(names[[name]]) -} - -#' @title Brewer color schemes -#' @name .sits_brewer_max_colors -#' @keywords internal -#' -#' @description Number of colors available in brewer color schemes. -#' -#' @param brewer name of the brewer color set. -#' @return The number of available colors. -.sits_brewer_max_colors <- function(brewer = NULL) { - if (purrr::is_null(brewer)) { - return(.sits_brewer_rgb %>% purrr::map(function(sch) { - sum((sch %>% - purrr::map(function(n) length(n)) %>% - as.numeric()) > 1) - })) - } - return(sum((.sits_brewer_rgb[[.sits_brewer_color_name(brewer)]] %>% - purrr::map(function(n) length(n)) %>% - as.numeric()) > 1)) -} - -# Brewer color set constant -# based on http://colorbrewer2.org colors' schemes -.sits_brewer_rgb <- tibble::lst( - "Spectral" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(252 / 255, 141 / 255, 89 / 255)), - "2" = tibble::lst( - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(153 / 255, 213 / 255, 148 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(153 / 255, 213 / 255, 148 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(215 / 255, 25 / 255, 28 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(171 / 255, 221 / 255, 164 / 255), - grDevices::rgb(43 / 255, 131 / 255, 186 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(215 / 255, 25 / 255, 28 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(171 / 255, 221 / 255, 164 / 255), - grDevices::rgb(43 / 255, 131 / 255, 186 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(213 / 255, 62 / 255, 79 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(230 / 255, 245 / 255, 152 / 255), - grDevices::rgb(153 / 255, 213 / 255, 148 / 255), - grDevices::rgb(50 / 255, 136 / 255, 189 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(213 / 255, 62 / 255, 79 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(230 / 255, 245 / 255, 152 / 255), - grDevices::rgb(153 / 255, 213 / 255, 148 / 255), - grDevices::rgb(50 / 255, 136 / 255, 189 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(213 / 255, 62 / 255, 79 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(230 / 255, 245 / 255, 152 / 255), - grDevices::rgb(171 / 255, 221 / 255, 164 / 255), - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(50 / 255, 136 / 255, 189 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(213 / 255, 62 / 255, 79 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(230 / 255, 245 / 255, 152 / 255), - grDevices::rgb(171 / 255, 221 / 255, 164 / 255), - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(50 / 255, 136 / 255, 189 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(158 / 255, 1 / 255, 66 / 255), - grDevices::rgb(213 / 255, 62 / 255, 79 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(230 / 255, 245 / 255, 152 / 255), - grDevices::rgb(171 / 255, 221 / 255, 164 / 255), - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(50 / 255, 136 / 255, 189 / 255), - grDevices::rgb(94 / 255, 79 / 255, 162 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(158 / 255, 1 / 255, 66 / 255), - grDevices::rgb(213 / 255, 62 / 255, 79 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(230 / 255, 245 / 255, 152 / 255), - grDevices::rgb(171 / 255, 221 / 255, 164 / 255), - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(50 / 255, 136 / 255, 189 / 255), - grDevices::rgb(94 / 255, 79 / 255, 162 / 255) - ), - "type" = "divergent" - ), - "RdYlGn" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(255 / 255, 255 / 255, 191 / 255)), - "2" = tibble::lst( - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(145 / 255, 207 / 255, 96 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(145 / 255, 207 / 255, 96 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(215 / 255, 25 / 255, 28 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(166 / 255, 217 / 255, 106 / 255), - grDevices::rgb(26 / 255, 150 / 255, 65 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(215 / 255, 25 / 255, 28 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(166 / 255, 217 / 255, 106 / 255), - grDevices::rgb(26 / 255, 150 / 255, 65 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(217 / 255, 239 / 255, 139 / 255), - grDevices::rgb(145 / 255, 207 / 255, 96 / 255), - grDevices::rgb(26 / 255, 152 / 255, 80 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(217 / 255, 239 / 255, 139 / 255), - grDevices::rgb(145 / 255, 207 / 255, 96 / 255), - grDevices::rgb(26 / 255, 152 / 255, 80 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(217 / 255, 239 / 255, 139 / 255), - grDevices::rgb(166 / 255, 217 / 255, 106 / 255), - grDevices::rgb(102 / 255, 189 / 255, 99 / 255), - grDevices::rgb(26 / 255, 152 / 255, 80 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(217 / 255, 239 / 255, 139 / 255), - grDevices::rgb(166 / 255, 217 / 255, 106 / 255), - grDevices::rgb(102 / 255, 189 / 255, 99 / 255), - grDevices::rgb(26 / 255, 152 / 255, 80 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(165 / 255, 0 / 255, 38 / 255), - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(217 / 255, 239 / 255, 139 / 255), - grDevices::rgb(166 / 255, 217 / 255, 106 / 255), - grDevices::rgb(102 / 255, 189 / 255, 99 / 255), - grDevices::rgb(26 / 255, 152 / 255, 80 / 255), - grDevices::rgb(0 / 255, 104 / 255, 55 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(165 / 255, 0 / 255, 38 / 255), - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 139 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(217 / 255, 239 / 255, 139 / 255), - grDevices::rgb(166 / 255, 217 / 255, 106 / 255), - grDevices::rgb(102 / 255, 189 / 255, 99 / 255), - grDevices::rgb(26 / 255, 152 / 255, 80 / 255), - grDevices::rgb(0 / 255, 104 / 255, 55 / 255) - ), - "type" = "divergent" - ), - "RdBu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(103 / 255, 169 / 255, 207 / 255)), - "2" = tibble::lst( - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(202 / 255, 0 / 255, 32 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(146 / 255, 197 / 255, 222 / 255), - grDevices::rgb(5 / 255, 113 / 255, 176 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(202 / 255, 0 / 255, 32 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(146 / 255, 197 / 255, 222 / 255), - grDevices::rgb(5 / 255, 113 / 255, 176 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(209 / 255, 229 / 255, 240 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(33 / 255, 102 / 255, 172 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(209 / 255, 229 / 255, 240 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(33 / 255, 102 / 255, 172 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(209 / 255, 229 / 255, 240 / 255), - grDevices::rgb(146 / 255, 197 / 255, 222 / 255), - grDevices::rgb(67 / 255, 147 / 255, 195 / 255), - grDevices::rgb(33 / 255, 102 / 255, 172 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(209 / 255, 229 / 255, 240 / 255), - grDevices::rgb(146 / 255, 197 / 255, 222 / 255), - grDevices::rgb(67 / 255, 147 / 255, 195 / 255), - grDevices::rgb(33 / 255, 102 / 255, 172 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(103 / 255, 0 / 255, 31 / 255), - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(209 / 255, 229 / 255, 240 / 255), - grDevices::rgb(146 / 255, 197 / 255, 222 / 255), - grDevices::rgb(67 / 255, 147 / 255, 195 / 255), - grDevices::rgb(33 / 255, 102 / 255, 172 / 255), - grDevices::rgb(5 / 255, 48 / 255, 97 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(103 / 255, 0 / 255, 31 / 255), - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(209 / 255, 229 / 255, 240 / 255), - grDevices::rgb(146 / 255, 197 / 255, 222 / 255), - grDevices::rgb(67 / 255, 147 / 255, 195 / 255), - grDevices::rgb(33 / 255, 102 / 255, 172 / 255), - grDevices::rgb(5 / 255, 48 / 255, 97 / 255) - ), - "type" = "divergent" - ), - "PiYG" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(161 / 255, 215 / 255, 106 / 255)), - "2" = tibble::lst( - grDevices::rgb(233 / 255, 163 / 255, 201 / 255), - grDevices::rgb(161 / 255, 215 / 255, 106 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(233 / 255, 163 / 255, 201 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(161 / 255, 215 / 255, 106 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(208 / 255, 28 / 255, 139 / 255), - grDevices::rgb(241 / 255, 182 / 255, 218 / 255), - grDevices::rgb(184 / 255, 225 / 255, 134 / 255), - grDevices::rgb(77 / 255, 172 / 255, 38 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(208 / 255, 28 / 255, 139 / 255), - grDevices::rgb(241 / 255, 182 / 255, 218 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(184 / 255, 225 / 255, 134 / 255), - grDevices::rgb(77 / 255, 172 / 255, 38 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(197 / 255, 27 / 255, 125 / 255), - grDevices::rgb(233 / 255, 163 / 255, 201 / 255), - grDevices::rgb(253 / 255, 224 / 255, 239 / 255), - grDevices::rgb(230 / 255, 245 / 255, 208 / 255), - grDevices::rgb(161 / 255, 215 / 255, 106 / 255), - grDevices::rgb(77 / 255, 146 / 255, 33 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(197 / 255, 27 / 255, 125 / 255), - grDevices::rgb(233 / 255, 163 / 255, 201 / 255), - grDevices::rgb(253 / 255, 224 / 255, 239 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(230 / 255, 245 / 255, 208 / 255), - grDevices::rgb(161 / 255, 215 / 255, 106 / 255), - grDevices::rgb(77 / 255, 146 / 255, 33 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(197 / 255, 27 / 255, 125 / 255), - grDevices::rgb(222 / 255, 119 / 255, 174 / 255), - grDevices::rgb(241 / 255, 182 / 255, 218 / 255), - grDevices::rgb(253 / 255, 224 / 255, 239 / 255), - grDevices::rgb(230 / 255, 245 / 255, 208 / 255), - grDevices::rgb(184 / 255, 225 / 255, 134 / 255), - grDevices::rgb(127 / 255, 188 / 255, 65 / 255), - grDevices::rgb(77 / 255, 146 / 255, 33 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(197 / 255, 27 / 255, 125 / 255), - grDevices::rgb(222 / 255, 119 / 255, 174 / 255), - grDevices::rgb(241 / 255, 182 / 255, 218 / 255), - grDevices::rgb(253 / 255, 224 / 255, 239 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(230 / 255, 245 / 255, 208 / 255), - grDevices::rgb(184 / 255, 225 / 255, 134 / 255), - grDevices::rgb(127 / 255, 188 / 255, 65 / 255), - grDevices::rgb(77 / 255, 146 / 255, 33 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(142 / 255, 1 / 255, 82 / 255), - grDevices::rgb(197 / 255, 27 / 255, 125 / 255), - grDevices::rgb(222 / 255, 119 / 255, 174 / 255), - grDevices::rgb(241 / 255, 182 / 255, 218 / 255), - grDevices::rgb(253 / 255, 224 / 255, 239 / 255), - grDevices::rgb(230 / 255, 245 / 255, 208 / 255), - grDevices::rgb(184 / 255, 225 / 255, 134 / 255), - grDevices::rgb(127 / 255, 188 / 255, 65 / 255), - grDevices::rgb(77 / 255, 146 / 255, 33 / 255), - grDevices::rgb(39 / 255, 100 / 255, 25 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(142 / 255, 1 / 255, 82 / 255), - grDevices::rgb(197 / 255, 27 / 255, 125 / 255), - grDevices::rgb(222 / 255, 119 / 255, 174 / 255), - grDevices::rgb(241 / 255, 182 / 255, 218 / 255), - grDevices::rgb(253 / 255, 224 / 255, 239 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(230 / 255, 245 / 255, 208 / 255), - grDevices::rgb(184 / 255, 225 / 255, 134 / 255), - grDevices::rgb(127 / 255, 188 / 255, 65 / 255), - grDevices::rgb(77 / 255, 146 / 255, 33 / 255), - grDevices::rgb(39 / 255, 100 / 255, 25 / 255) - ), - "type" = "divergent" - ), - "PRGn" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(247 / 255, 247 / 255, 247 / 255)), - "2" = tibble::lst( - grDevices::rgb(175 / 255, 141 / 255, 195 / 255), - grDevices::rgb(127 / 255, 191 / 255, 123 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(175 / 255, 141 / 255, 195 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(127 / 255, 191 / 255, 123 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(123 / 255, 50 / 255, 148 / 255), - grDevices::rgb(194 / 255, 165 / 255, 207 / 255), - grDevices::rgb(166 / 255, 219 / 255, 160 / 255), - grDevices::rgb(0 / 255, 136 / 255, 55 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(123 / 255, 50 / 255, 148 / 255), - grDevices::rgb(194 / 255, 165 / 255, 207 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(166 / 255, 219 / 255, 160 / 255), - grDevices::rgb(0 / 255, 136 / 255, 55 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(118 / 255, 42 / 255, 131 / 255), - grDevices::rgb(175 / 255, 141 / 255, 195 / 255), - grDevices::rgb(231 / 255, 212 / 255, 232 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(127 / 255, 191 / 255, 123 / 255), - grDevices::rgb(27 / 255, 120 / 255, 55 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(118 / 255, 42 / 255, 131 / 255), - grDevices::rgb(175 / 255, 141 / 255, 195 / 255), - grDevices::rgb(231 / 255, 212 / 255, 232 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(127 / 255, 191 / 255, 123 / 255), - grDevices::rgb(27 / 255, 120 / 255, 55 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(118 / 255, 42 / 255, 131 / 255), - grDevices::rgb(153 / 255, 112 / 255, 171 / 255), - grDevices::rgb(194 / 255, 165 / 255, 207 / 255), - grDevices::rgb(231 / 255, 212 / 255, 232 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(166 / 255, 219 / 255, 160 / 255), - grDevices::rgb(90 / 255, 174 / 255, 97 / 255), - grDevices::rgb(27 / 255, 120 / 255, 55 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(118 / 255, 42 / 255, 131 / 255), - grDevices::rgb(153 / 255, 112 / 255, 171 / 255), - grDevices::rgb(194 / 255, 165 / 255, 207 / 255), - grDevices::rgb(231 / 255, 212 / 255, 232 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(166 / 255, 219 / 255, 160 / 255), - grDevices::rgb(90 / 255, 174 / 255, 97 / 255), - grDevices::rgb(27 / 255, 120 / 255, 55 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(64 / 255, 0 / 255, 75 / 255), - grDevices::rgb(118 / 255, 42 / 255, 131 / 255), - grDevices::rgb(153 / 255, 112 / 255, 171 / 255), - grDevices::rgb(194 / 255, 165 / 255, 207 / 255), - grDevices::rgb(231 / 255, 212 / 255, 232 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(166 / 255, 219 / 255, 160 / 255), - grDevices::rgb(90 / 255, 174 / 255, 97 / 255), - grDevices::rgb(27 / 255, 120 / 255, 55 / 255), - grDevices::rgb(0 / 255, 68 / 255, 27 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(64 / 255, 0 / 255, 75 / 255), - grDevices::rgb(118 / 255, 42 / 255, 131 / 255), - grDevices::rgb(153 / 255, 112 / 255, 171 / 255), - grDevices::rgb(194 / 255, 165 / 255, 207 / 255), - grDevices::rgb(231 / 255, 212 / 255, 232 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(166 / 255, 219 / 255, 160 / 255), - grDevices::rgb(90 / 255, 174 / 255, 97 / 255), - grDevices::rgb(27 / 255, 120 / 255, 55 / 255), - grDevices::rgb(0 / 255, 68 / 255, 27 / 255) - ), - "type" = "divergent" - ), - "RdYlBu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(255 / 255, 255 / 255, 191 / 255)), - "2" = tibble::lst( - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(145 / 255, 191 / 255, 219 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(145 / 255, 191 / 255, 219 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(215 / 255, 25 / 255, 28 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(171 / 255, 217 / 255, 233 / 255), - grDevices::rgb(44 / 255, 123 / 255, 182 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(215 / 255, 25 / 255, 28 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(171 / 255, 217 / 255, 233 / 255), - grDevices::rgb(44 / 255, 123 / 255, 182 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(254 / 255, 224 / 255, 144 / 255), - grDevices::rgb(224 / 255, 243 / 255, 248 / 255), - grDevices::rgb(145 / 255, 191 / 255, 219 / 255), - grDevices::rgb(69 / 255, 117 / 255, 180 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(254 / 255, 224 / 255, 144 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(224 / 255, 243 / 255, 248 / 255), - grDevices::rgb(145 / 255, 191 / 255, 219 / 255), - grDevices::rgb(69 / 255, 117 / 255, 180 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 144 / 255), - grDevices::rgb(224 / 255, 243 / 255, 248 / 255), - grDevices::rgb(171 / 255, 217 / 255, 233 / 255), - grDevices::rgb(116 / 255, 173 / 255, 209 / 255), - grDevices::rgb(69 / 255, 117 / 255, 180 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 144 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(224 / 255, 243 / 255, 248 / 255), - grDevices::rgb(171 / 255, 217 / 255, 233 / 255), - grDevices::rgb(116 / 255, 173 / 255, 209 / 255), - grDevices::rgb(69 / 255, 117 / 255, 180 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(165 / 255, 0 / 255, 38 / 255), - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 144 / 255), - grDevices::rgb(224 / 255, 243 / 255, 248 / 255), - grDevices::rgb(171 / 255, 217 / 255, 233 / 255), - grDevices::rgb(116 / 255, 173 / 255, 209 / 255), - grDevices::rgb(69 / 255, 117 / 255, 180 / 255), - grDevices::rgb(49 / 255, 54 / 255, 149 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(165 / 255, 0 / 255, 38 / 255), - grDevices::rgb(215 / 255, 48 / 255, 39 / 255), - grDevices::rgb(244 / 255, 109 / 255, 67 / 255), - grDevices::rgb(253 / 255, 174 / 255, 97 / 255), - grDevices::rgb(254 / 255, 224 / 255, 144 / 255), - grDevices::rgb(255 / 255, 255 / 255, 191 / 255), - grDevices::rgb(224 / 255, 243 / 255, 248 / 255), - grDevices::rgb(171 / 255, 217 / 255, 233 / 255), - grDevices::rgb(116 / 255, 173 / 255, 209 / 255), - grDevices::rgb(69 / 255, 117 / 255, 180 / 255), - grDevices::rgb(49 / 255, 54 / 255, 149 / 255) - ), - "type" = "divergent" - ), - "BrBG" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(245 / 255, 245 / 255, 245 / 255)), - "2" = tibble::lst( - grDevices::rgb(216 / 255, 179 / 255, 101 / 255), - grDevices::rgb(90 / 255, 180 / 255, 172 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(216 / 255, 179 / 255, 101 / 255), - grDevices::rgb(245 / 255, 245 / 255, 245 / 255), - grDevices::rgb(90 / 255, 180 / 255, 172 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(166 / 255, 97 / 255, 26 / 255), - grDevices::rgb(223 / 255, 194 / 255, 125 / 255), - grDevices::rgb(128 / 255, 205 / 255, 193 / 255), - grDevices::rgb(1 / 255, 133 / 255, 113 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(166 / 255, 97 / 255, 26 / 255), - grDevices::rgb(223 / 255, 194 / 255, 125 / 255), - grDevices::rgb(245 / 255, 245 / 255, 245 / 255), - grDevices::rgb(128 / 255, 205 / 255, 193 / 255), - grDevices::rgb(1 / 255, 133 / 255, 113 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(140 / 255, 81 / 255, 10 / 255), - grDevices::rgb(216 / 255, 179 / 255, 101 / 255), - grDevices::rgb(246 / 255, 232 / 255, 195 / 255), - grDevices::rgb(199 / 255, 234 / 255, 229 / 255), - grDevices::rgb(90 / 255, 180 / 255, 172 / 255), - grDevices::rgb(1 / 255, 102 / 255, 94 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(140 / 255, 81 / 255, 10 / 255), - grDevices::rgb(216 / 255, 179 / 255, 101 / 255), - grDevices::rgb(246 / 255, 232 / 255, 195 / 255), - grDevices::rgb(245 / 255, 245 / 255, 245 / 255), - grDevices::rgb(199 / 255, 234 / 255, 229 / 255), - grDevices::rgb(90 / 255, 180 / 255, 172 / 255), - grDevices::rgb(1 / 255, 102 / 255, 94 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(140 / 255, 81 / 255, 10 / 255), - grDevices::rgb(191 / 255, 129 / 255, 45 / 255), - grDevices::rgb(223 / 255, 194 / 255, 125 / 255), - grDevices::rgb(246 / 255, 232 / 255, 195 / 255), - grDevices::rgb(199 / 255, 234 / 255, 229 / 255), - grDevices::rgb(128 / 255, 205 / 255, 193 / 255), - grDevices::rgb(53 / 255, 151 / 255, 143 / 255), - grDevices::rgb(1 / 255, 102 / 255, 94 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(140 / 255, 81 / 255, 10 / 255), - grDevices::rgb(191 / 255, 129 / 255, 45 / 255), - grDevices::rgb(223 / 255, 194 / 255, 125 / 255), - grDevices::rgb(246 / 255, 232 / 255, 195 / 255), - grDevices::rgb(245 / 255, 245 / 255, 245 / 255), - grDevices::rgb(199 / 255, 234 / 255, 229 / 255), - grDevices::rgb(128 / 255, 205 / 255, 193 / 255), - grDevices::rgb(53 / 255, 151 / 255, 143 / 255), - grDevices::rgb(1 / 255, 102 / 255, 94 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(84 / 255, 48 / 255, 5 / 255), - grDevices::rgb(140 / 255, 81 / 255, 10 / 255), - grDevices::rgb(191 / 255, 129 / 255, 45 / 255), - grDevices::rgb(223 / 255, 194 / 255, 125 / 255), - grDevices::rgb(246 / 255, 232 / 255, 195 / 255), - grDevices::rgb(199 / 255, 234 / 255, 229 / 255), - grDevices::rgb(128 / 255, 205 / 255, 193 / 255), - grDevices::rgb(53 / 255, 151 / 255, 143 / 255), - grDevices::rgb(1 / 255, 102 / 255, 94 / 255), - grDevices::rgb(0 / 255, 60 / 255, 48 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(84 / 255, 48 / 255, 5 / 255), - grDevices::rgb(140 / 255, 81 / 255, 10 / 255), - grDevices::rgb(191 / 255, 129 / 255, 45 / 255), - grDevices::rgb(223 / 255, 194 / 255, 125 / 255), - grDevices::rgb(246 / 255, 232 / 255, 195 / 255), - grDevices::rgb(245 / 255, 245 / 255, 245 / 255), - grDevices::rgb(199 / 255, 234 / 255, 229 / 255), - grDevices::rgb(128 / 255, 205 / 255, 193 / 255), - grDevices::rgb(53 / 255, 151 / 255, 143 / 255), - grDevices::rgb(1 / 255, 102 / 255, 94 / 255), - grDevices::rgb(0 / 255, 60 / 255, 48 / 255) - ), - "type" = "divergent" - ), - "RdGy" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(255 / 255, 255 / 255, 255 / 255)), - "2" = tibble::lst( - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(153 / 255, 153 / 255, 153 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(153 / 255, 153 / 255, 153 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(202 / 255, 0 / 255, 32 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(64 / 255, 64 / 255, 64 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(202 / 255, 0 / 255, 32 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(64 / 255, 64 / 255, 64 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(224 / 255, 224 / 255, 224 / 255), - grDevices::rgb(153 / 255, 153 / 255, 153 / 255), - grDevices::rgb(77 / 255, 77 / 255, 77 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(239 / 255, 138 / 255, 98 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(224 / 255, 224 / 255, 224 / 255), - grDevices::rgb(153 / 255, 153 / 255, 153 / 255), - grDevices::rgb(77 / 255, 77 / 255, 77 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(224 / 255, 224 / 255, 224 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(135 / 255, 135 / 255, 135 / 255), - grDevices::rgb(77 / 255, 77 / 255, 77 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(224 / 255, 224 / 255, 224 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(135 / 255, 135 / 255, 135 / 255), - grDevices::rgb(77 / 255, 77 / 255, 77 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(103 / 255, 0 / 255, 31 / 255), - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(224 / 255, 224 / 255, 224 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(135 / 255, 135 / 255, 135 / 255), - grDevices::rgb(77 / 255, 77 / 255, 77 / 255), - grDevices::rgb(26 / 255, 26 / 255, 26 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(103 / 255, 0 / 255, 31 / 255), - grDevices::rgb(178 / 255, 24 / 255, 43 / 255), - grDevices::rgb(214 / 255, 96 / 255, 77 / 255), - grDevices::rgb(244 / 255, 165 / 255, 130 / 255), - grDevices::rgb(253 / 255, 219 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(224 / 255, 224 / 255, 224 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(135 / 255, 135 / 255, 135 / 255), - grDevices::rgb(77 / 255, 77 / 255, 77 / 255), - grDevices::rgb(26 / 255, 26 / 255, 26 / 255) - ), - "type" = "divergent" - ), - "PuOr" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(247 / 255, 247 / 255, 247 / 255)), - "2" = tibble::lst( - grDevices::rgb(241 / 255, 163 / 255, 64 / 255), - grDevices::rgb(153 / 255, 142 / 255, 195 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(241 / 255, 163 / 255, 64 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(153 / 255, 142 / 255, 195 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(230 / 255, 97 / 255, 1 / 255), - grDevices::rgb(253 / 255, 184 / 255, 99 / 255), - grDevices::rgb(178 / 255, 171 / 255, 210 / 255), - grDevices::rgb(94 / 255, 60 / 255, 153 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(230 / 255, 97 / 255, 1 / 255), - grDevices::rgb(253 / 255, 184 / 255, 99 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(178 / 255, 171 / 255, 210 / 255), - grDevices::rgb(94 / 255, 60 / 255, 153 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(179 / 255, 88 / 255, 6 / 255), - grDevices::rgb(241 / 255, 163 / 255, 64 / 255), - grDevices::rgb(254 / 255, 224 / 255, 182 / 255), - grDevices::rgb(216 / 255, 218 / 255, 235 / 255), - grDevices::rgb(153 / 255, 142 / 255, 195 / 255), - grDevices::rgb(84 / 255, 39 / 255, 136 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(179 / 255, 88 / 255, 6 / 255), - grDevices::rgb(241 / 255, 163 / 255, 64 / 255), - grDevices::rgb(254 / 255, 224 / 255, 182 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(216 / 255, 218 / 255, 235 / 255), - grDevices::rgb(153 / 255, 142 / 255, 195 / 255), - grDevices::rgb(84 / 255, 39 / 255, 136 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(179 / 255, 88 / 255, 6 / 255), - grDevices::rgb(224 / 255, 130 / 255, 20 / 255), - grDevices::rgb(253 / 255, 184 / 255, 99 / 255), - grDevices::rgb(254 / 255, 224 / 255, 182 / 255), - grDevices::rgb(216 / 255, 218 / 255, 235 / 255), - grDevices::rgb(178 / 255, 171 / 255, 210 / 255), - grDevices::rgb(128 / 255, 115 / 255, 172 / 255), - grDevices::rgb(84 / 255, 39 / 255, 136 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(179 / 255, 88 / 255, 6 / 255), - grDevices::rgb(224 / 255, 130 / 255, 20 / 255), - grDevices::rgb(253 / 255, 184 / 255, 99 / 255), - grDevices::rgb(254 / 255, 224 / 255, 182 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(216 / 255, 218 / 255, 235 / 255), - grDevices::rgb(178 / 255, 171 / 255, 210 / 255), - grDevices::rgb(128 / 255, 115 / 255, 172 / 255), - grDevices::rgb(84 / 255, 39 / 255, 136 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(127 / 255, 59 / 255, 8 / 255), - grDevices::rgb(179 / 255, 88 / 255, 6 / 255), - grDevices::rgb(224 / 255, 130 / 255, 20 / 255), - grDevices::rgb(253 / 255, 184 / 255, 99 / 255), - grDevices::rgb(254 / 255, 224 / 255, 182 / 255), - grDevices::rgb(216 / 255, 218 / 255, 235 / 255), - grDevices::rgb(178 / 255, 171 / 255, 210 / 255), - grDevices::rgb(128 / 255, 115 / 255, 172 / 255), - grDevices::rgb(84 / 255, 39 / 255, 136 / 255), - grDevices::rgb(45 / 255, 0 / 255, 75 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(127 / 255, 59 / 255, 8 / 255), - grDevices::rgb(179 / 255, 88 / 255, 6 / 255), - grDevices::rgb(224 / 255, 130 / 255, 20 / 255), - grDevices::rgb(253 / 255, 184 / 255, 99 / 255), - grDevices::rgb(254 / 255, 224 / 255, 182 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(216 / 255, 218 / 255, 235 / 255), - grDevices::rgb(178 / 255, 171 / 255, 210 / 255), - grDevices::rgb(128 / 255, 115 / 255, 172 / 255), - grDevices::rgb(84 / 255, 39 / 255, 136 / 255), - grDevices::rgb(45 / 255, 0 / 255, 75 / 255) - ), - "type" = "divergent" - ), - "Set2" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(252 / 255, 141 / 255, 98 / 255)), - "2" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(252 / 255, 141 / 255, 98 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(252 / 255, 141 / 255, 98 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255), - grDevices::rgb(231 / 255, 138 / 255, 195 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(252 / 255, 141 / 255, 98 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255), - grDevices::rgb(231 / 255, 138 / 255, 195 / 255), - grDevices::rgb(166 / 255, 216 / 255, 84 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(252 / 255, 141 / 255, 98 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255), - grDevices::rgb(231 / 255, 138 / 255, 195 / 255), - grDevices::rgb(166 / 255, 216 / 255, 84 / 255), - grDevices::rgb(255 / 255, 217 / 255, 47 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(252 / 255, 141 / 255, 98 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255), - grDevices::rgb(231 / 255, 138 / 255, 195 / 255), - grDevices::rgb(166 / 255, 216 / 255, 84 / 255), - grDevices::rgb(255 / 255, 217 / 255, 47 / 255), - grDevices::rgb(229 / 255, 196 / 255, 148 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(102 / 255, 194 / 255, 165 / 255), - grDevices::rgb(252 / 255, 141 / 255, 98 / 255), - grDevices::rgb(141 / 255, 160 / 255, 203 / 255), - grDevices::rgb(231 / 255, 138 / 255, 195 / 255), - grDevices::rgb(166 / 255, 216 / 255, 84 / 255), - grDevices::rgb(255 / 255, 217 / 255, 47 / 255), - grDevices::rgb(229 / 255, 196 / 255, 148 / 255), - grDevices::rgb(179 / 255, 179 / 255, 179 / 255) - ), - "type" = "qualitative" - ), - "Accent" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(190 / 255, 174 / 255, 212 / 255)), - "2" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(190 / 255, 174 / 255, 212 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(190 / 255, 174 / 255, 212 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(190 / 255, 174 / 255, 212 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255), - grDevices::rgb(56 / 255, 108 / 255, 176 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(190 / 255, 174 / 255, 212 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255), - grDevices::rgb(56 / 255, 108 / 255, 176 / 255), - grDevices::rgb(240 / 255, 2 / 255, 127 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(190 / 255, 174 / 255, 212 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255), - grDevices::rgb(56 / 255, 108 / 255, 176 / 255), - grDevices::rgb(240 / 255, 2 / 255, 127 / 255), - grDevices::rgb(191 / 255, 91 / 255, 23 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(127 / 255, 201 / 255, 127 / 255), - grDevices::rgb(190 / 255, 174 / 255, 212 / 255), - grDevices::rgb(253 / 255, 192 / 255, 134 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255), - grDevices::rgb(56 / 255, 108 / 255, 176 / 255), - grDevices::rgb(240 / 255, 2 / 255, 127 / 255), - grDevices::rgb(191 / 255, 91 / 255, 23 / 255), - grDevices::rgb(102 / 255, 102 / 255, 102 / 255) - ), - "type" = "qualitative" - ), - "Set1" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(55 / 255, 126 / 255, 184 / 255)), - "2" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255), - grDevices::rgb(152 / 255, 78 / 255, 163 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255), - grDevices::rgb(152 / 255, 78 / 255, 163 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255), - grDevices::rgb(152 / 255, 78 / 255, 163 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(255 / 255, 255 / 255, 51 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255), - grDevices::rgb(152 / 255, 78 / 255, 163 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(255 / 255, 255 / 255, 51 / 255), - grDevices::rgb(166 / 255, 86 / 255, 40 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255), - grDevices::rgb(152 / 255, 78 / 255, 163 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(255 / 255, 255 / 255, 51 / 255), - grDevices::rgb(166 / 255, 86 / 255, 40 / 255), - grDevices::rgb(247 / 255, 129 / 255, 191 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(228 / 255, 26 / 255, 28 / 255), - grDevices::rgb(55 / 255, 126 / 255, 184 / 255), - grDevices::rgb(77 / 255, 175 / 255, 74 / 255), - grDevices::rgb(152 / 255, 78 / 255, 163 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(255 / 255, 255 / 255, 51 / 255), - grDevices::rgb(166 / 255, 86 / 255, 40 / 255), - grDevices::rgb(247 / 255, 129 / 255, 191 / 255), - grDevices::rgb(153 / 255, 153 / 255, 153 / 255) - ), - "type" = "qualitative" - ), - "Set3" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(255 / 255, 255 / 255, 179 / 255)), - "2" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255), - grDevices::rgb(179 / 255, 222 / 255, 105 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255), - grDevices::rgb(179 / 255, 222 / 255, 105 / 255), - grDevices::rgb(252 / 255, 205 / 255, 229 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255), - grDevices::rgb(179 / 255, 222 / 255, 105 / 255), - grDevices::rgb(252 / 255, 205 / 255, 229 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255), - grDevices::rgb(179 / 255, 222 / 255, 105 / 255), - grDevices::rgb(252 / 255, 205 / 255, 229 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(188 / 255, 128 / 255, 189 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255), - grDevices::rgb(179 / 255, 222 / 255, 105 / 255), - grDevices::rgb(252 / 255, 205 / 255, 229 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(188 / 255, 128 / 255, 189 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(141 / 255, 211 / 255, 199 / 255), - grDevices::rgb(255 / 255, 255 / 255, 179 / 255), - grDevices::rgb(190 / 255, 186 / 255, 218 / 255), - grDevices::rgb(251 / 255, 128 / 255, 114 / 255), - grDevices::rgb(128 / 255, 177 / 255, 211 / 255), - grDevices::rgb(253 / 255, 180 / 255, 98 / 255), - grDevices::rgb(179 / 255, 222 / 255, 105 / 255), - grDevices::rgb(252 / 255, 205 / 255, 229 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(188 / 255, 128 / 255, 189 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(255 / 255, 237 / 255, 111 / 255) - ), - "type" = "qualitative" - ), - "Dark2" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(217 / 255, 95 / 255, 2 / 255)), - "2" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(217 / 255, 95 / 255, 2 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(217 / 255, 95 / 255, 2 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(217 / 255, 95 / 255, 2 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(102 / 255, 166 / 255, 30 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(217 / 255, 95 / 255, 2 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(102 / 255, 166 / 255, 30 / 255), - grDevices::rgb(230 / 255, 171 / 255, 2 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(217 / 255, 95 / 255, 2 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(102 / 255, 166 / 255, 30 / 255), - grDevices::rgb(230 / 255, 171 / 255, 2 / 255), - grDevices::rgb(166 / 255, 118 / 255, 29 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(27 / 255, 158 / 255, 119 / 255), - grDevices::rgb(217 / 255, 95 / 255, 2 / 255), - grDevices::rgb(117 / 255, 112 / 255, 179 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(102 / 255, 166 / 255, 30 / 255), - grDevices::rgb(230 / 255, 171 / 255, 2 / 255), - grDevices::rgb(166 / 255, 118 / 255, 29 / 255), - grDevices::rgb(102 / 255, 102 / 255, 102 / 255) - ), - "type" = "qualitative" - ), - "Paired" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(31 / 255, 120 / 255, 180 / 255)), - "2" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(253 / 255, 191 / 255, 111 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(253 / 255, 191 / 255, 111 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(253 / 255, 191 / 255, 111 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(202 / 255, 178 / 255, 214 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(253 / 255, 191 / 255, 111 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(202 / 255, 178 / 255, 214 / 255), - grDevices::rgb(106 / 255, 61 / 255, 154 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(253 / 255, 191 / 255, 111 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(202 / 255, 178 / 255, 214 / 255), - grDevices::rgb(106 / 255, 61 / 255, 154 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(166 / 255, 206 / 255, 227 / 255), - grDevices::rgb(31 / 255, 120 / 255, 180 / 255), - grDevices::rgb(178 / 255, 223 / 255, 138 / 255), - grDevices::rgb(51 / 255, 160 / 255, 44 / 255), - grDevices::rgb(251 / 255, 154 / 255, 153 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(253 / 255, 191 / 255, 111 / 255), - grDevices::rgb(255 / 255, 127 / 255, 0 / 255), - grDevices::rgb(202 / 255, 178 / 255, 214 / 255), - grDevices::rgb(106 / 255, 61 / 255, 154 / 255), - grDevices::rgb(255 / 255, 255 / 255, 153 / 255), - grDevices::rgb(177 / 255, 89 / 255, 40 / 255) - ), - "type" = "qualitative" - ), - "Pastel2" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(203 / 255, 213 / 255, 232 / 255)), - "2" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(253 / 255, 205 / 255, 172 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(253 / 255, 205 / 255, 172 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255), - grDevices::rgb(244 / 255, 202 / 255, 228 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(253 / 255, 205 / 255, 172 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255), - grDevices::rgb(244 / 255, 202 / 255, 228 / 255), - grDevices::rgb(230 / 255, 245 / 255, 201 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(253 / 255, 205 / 255, 172 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255), - grDevices::rgb(244 / 255, 202 / 255, 228 / 255), - grDevices::rgb(230 / 255, 245 / 255, 201 / 255), - grDevices::rgb(255 / 255, 242 / 255, 174 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(253 / 255, 205 / 255, 172 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255), - grDevices::rgb(244 / 255, 202 / 255, 228 / 255), - grDevices::rgb(230 / 255, 245 / 255, 201 / 255), - grDevices::rgb(255 / 255, 242 / 255, 174 / 255), - grDevices::rgb(241 / 255, 226 / 255, 204 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(179 / 255, 226 / 255, 205 / 255), - grDevices::rgb(253 / 255, 205 / 255, 172 / 255), - grDevices::rgb(203 / 255, 213 / 255, 232 / 255), - grDevices::rgb(244 / 255, 202 / 255, 228 / 255), - grDevices::rgb(230 / 255, 245 / 255, 201 / 255), - grDevices::rgb(255 / 255, 242 / 255, 174 / 255), - grDevices::rgb(241 / 255, 226 / 255, 204 / 255), - grDevices::rgb(204 / 255, 204 / 255, 204 / 255) - ), - "type" = "qualitative" - ), - "Pastel1" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(204 / 255, 235 / 255, 197 / 255)), - "2" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(222 / 255, 203 / 255, 228 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(222 / 255, 203 / 255, 228 / 255), - grDevices::rgb(254 / 255, 217 / 255, 166 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(222 / 255, 203 / 255, 228 / 255), - grDevices::rgb(254 / 255, 217 / 255, 166 / 255), - grDevices::rgb(255 / 255, 255 / 255, 204 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(222 / 255, 203 / 255, 228 / 255), - grDevices::rgb(254 / 255, 217 / 255, 166 / 255), - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(229 / 255, 216 / 255, 189 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(222 / 255, 203 / 255, 228 / 255), - grDevices::rgb(254 / 255, 217 / 255, 166 / 255), - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(229 / 255, 216 / 255, 189 / 255), - grDevices::rgb(253 / 255, 218 / 255, 236 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(251 / 255, 180 / 255, 174 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(222 / 255, 203 / 255, 228 / 255), - grDevices::rgb(254 / 255, 217 / 255, 166 / 255), - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(229 / 255, 216 / 255, 189 / 255), - grDevices::rgb(253 / 255, 218 / 255, 236 / 255), - grDevices::rgb(242 / 255, 242 / 255, 242 / 255) - ), - "type" = "qualitative" - ), - "OrRd" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(253 / 255, 187 / 255, 132 / 255)), - "2" = tibble::lst( - grDevices::rgb(254 / 255, 232 / 255, 200 / 255), - grDevices::rgb(227 / 255, 74 / 255, 51 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(254 / 255, 232 / 255, 200 / 255), - grDevices::rgb(253 / 255, 187 / 255, 132 / 255), - grDevices::rgb(227 / 255, 74 / 255, 51 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(254 / 255, 240 / 255, 217 / 255), - grDevices::rgb(253 / 255, 204 / 255, 138 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(215 / 255, 48 / 255, 31 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(254 / 255, 240 / 255, 217 / 255), - grDevices::rgb(253 / 255, 204 / 255, 138 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(227 / 255, 74 / 255, 51 / 255), - grDevices::rgb(179 / 255, 0 / 255, 0 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(254 / 255, 240 / 255, 217 / 255), - grDevices::rgb(253 / 255, 212 / 255, 158 / 255), - grDevices::rgb(253 / 255, 187 / 255, 132 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(227 / 255, 74 / 255, 51 / 255), - grDevices::rgb(179 / 255, 0 / 255, 0 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(254 / 255, 240 / 255, 217 / 255), - grDevices::rgb(253 / 255, 212 / 255, 158 / 255), - grDevices::rgb(253 / 255, 187 / 255, 132 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(239 / 255, 101 / 255, 72 / 255), - grDevices::rgb(215 / 255, 48 / 255, 31 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 236 / 255), - grDevices::rgb(254 / 255, 232 / 255, 200 / 255), - grDevices::rgb(253 / 255, 212 / 255, 158 / 255), - grDevices::rgb(253 / 255, 187 / 255, 132 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(239 / 255, 101 / 255, 72 / 255), - grDevices::rgb(215 / 255, 48 / 255, 31 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 236 / 255), - grDevices::rgb(254 / 255, 232 / 255, 200 / 255), - grDevices::rgb(253 / 255, 212 / 255, 158 / 255), - grDevices::rgb(253 / 255, 187 / 255, 132 / 255), - grDevices::rgb(252 / 255, 141 / 255, 89 / 255), - grDevices::rgb(239 / 255, 101 / 255, 72 / 255), - grDevices::rgb(215 / 255, 48 / 255, 31 / 255), - grDevices::rgb(179 / 255, 0 / 255, 0 / 255), - grDevices::rgb(127 / 255, 0 / 255, 0 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 235 / 255, 207 / 255), - grDevices::rgb(253 / 255, 220 / 255, 176 / 255), - grDevices::rgb(253 / 255, 203 / 255, 149 / 255), - grDevices::rgb(253 / 255, 182 / 255, 127 / 255), - grDevices::rgb(252 / 255, 146 / 255, 93 / 255), - grDevices::rgb(243 / 255, 114 / 255, 77 / 255), - grDevices::rgb(228 / 255, 79 / 255, 53 / 255), - grDevices::rgb(200 / 255, 39 / 255, 24 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 236 / 255, 210 / 255), - grDevices::rgb(253 / 255, 223 / 255, 183 / 255), - grDevices::rgb(253 / 255, 209 / 255, 155 / 255), - grDevices::rgb(253 / 255, 192 / 255, 137 / 255), - grDevices::rgb(253 / 255, 164 / 255, 110 / 255), - grDevices::rgb(249 / 255, 133 / 255, 85 / 255), - grDevices::rgb(240 / 255, 105 / 255, 73 / 255), - grDevices::rgb(224 / 255, 71 / 255, 47 / 255), - grDevices::rgb(196 / 255, 36 / 255, 21 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 237 / 255, 213 / 255), - grDevices::rgb(254 / 255, 226 / 255, 188 / 255), - grDevices::rgb(253 / 255, 213 / 255, 161 / 255), - grDevices::rgb(253 / 255, 198 / 255, 143 / 255), - grDevices::rgb(253 / 255, 178 / 255, 124 / 255), - grDevices::rgb(252 / 255, 149 / 255, 96 / 255), - grDevices::rgb(246 / 255, 123 / 255, 81 / 255), - grDevices::rgb(236 / 255, 96 / 255, 68 / 255), - grDevices::rgb(221 / 255, 64 / 255, 42 / 255), - grDevices::rgb(192 / 255, 33 / 255, 19 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 238 / 255, 214 / 255), - grDevices::rgb(254 / 255, 228 / 255, 192 / 255), - grDevices::rgb(253 / 255, 216 / 255, 168 / 255), - grDevices::rgb(253 / 255, 203 / 255, 149 / 255), - grDevices::rgb(253 / 255, 189 / 255, 134 / 255), - grDevices::rgb(253 / 255, 164 / 255, 110 / 255), - grDevices::rgb(250 / 255, 137 / 255, 87 / 255), - grDevices::rgb(243 / 255, 114 / 255, 77 / 255), - grDevices::rgb(233 / 255, 89 / 255, 61 / 255), - grDevices::rgb(219 / 255, 58 / 255, 37 / 255), - grDevices::rgb(188 / 255, 31 / 255, 18 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 238 / 255, 216 / 255), - grDevices::rgb(254 / 255, 230 / 255, 196 / 255), - grDevices::rgb(253 / 255, 219 / 255, 174 / 255), - grDevices::rgb(253 / 255, 208 / 255, 153 / 255), - grDevices::rgb(253 / 255, 194 / 255, 139 / 255), - grDevices::rgb(253 / 255, 176 / 255, 121 / 255), - grDevices::rgb(252 / 255, 151 / 255, 98 / 255), - grDevices::rgb(248 / 255, 129 / 255, 83 / 255), - grDevices::rgb(241 / 255, 107 / 255, 74 / 255), - grDevices::rgb(230 / 255, 82 / 255, 56 / 255), - grDevices::rgb(216 / 255, 52 / 255, 34 / 255), - grDevices::rgb(185 / 255, 29 / 255, 16 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 239 / 255, 217 / 255), - grDevices::rgb(254 / 255, 231 / 255, 199 / 255), - grDevices::rgb(253 / 255, 221 / 255, 178 / 255), - grDevices::rgb(253 / 255, 211 / 255, 158 / 255), - grDevices::rgb(253 / 255, 199 / 255, 144 / 255), - grDevices::rgb(253 / 255, 186 / 255, 132 / 255), - grDevices::rgb(253 / 255, 164 / 255, 110 / 255), - grDevices::rgb(252 / 255, 140 / 255, 89 / 255), - grDevices::rgb(245 / 255, 121 / 255, 80 / 255), - grDevices::rgb(238 / 255, 101 / 255, 71 / 255), - grDevices::rgb(227 / 255, 76 / 255, 51 / 255), - grDevices::rgb(215 / 255, 48 / 255, 31 / 255), - grDevices::rgb(183 / 255, 27 / 255, 15 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 239 / 255, 219 / 255), - grDevices::rgb(254 / 255, 232 / 255, 202 / 255), - grDevices::rgb(253 / 255, 223 / 255, 183 / 255), - grDevices::rgb(253 / 255, 214 / 255, 163 / 255), - grDevices::rgb(253 / 255, 203 / 255, 149 / 255), - grDevices::rgb(253 / 255, 192 / 255, 137 / 255), - grDevices::rgb(253 / 255, 174 / 255, 120 / 255), - grDevices::rgb(252 / 255, 153 / 255, 100 / 255), - grDevices::rgb(249 / 255, 133 / 255, 85 / 255), - grDevices::rgb(243 / 255, 114 / 255, 77 / 255), - grDevices::rgb(235 / 255, 94 / 255, 66 / 255), - grDevices::rgb(224 / 255, 71 / 255, 47 / 255), - grDevices::rgb(210 / 255, 45 / 255, 28 / 255), - grDevices::rgb(181 / 255, 26 / 255, 14 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 240 / 255, 220 / 255), - grDevices::rgb(254 / 255, 233 / 255, 204 / 255), - grDevices::rgb(254 / 255, 225 / 255, 186 / 255), - grDevices::rgb(253 / 255, 216 / 255, 168 / 255), - grDevices::rgb(253 / 255, 207 / 255, 153 / 255), - grDevices::rgb(253 / 255, 196 / 255, 141 / 255), - grDevices::rgb(253 / 255, 184 / 255, 129 / 255), - grDevices::rgb(253 / 255, 164 / 255, 110 / 255), - grDevices::rgb(252 / 255, 143 / 255, 91 / 255), - grDevices::rgb(247 / 255, 126 / 255, 82 / 255), - grDevices::rgb(241 / 255, 108 / 255, 75 / 255), - grDevices::rgb(233 / 255, 89 / 255, 61 / 255), - grDevices::rgb(222 / 255, 66 / 255, 43 / 255), - grDevices::rgb(207 / 255, 43 / 255, 27 / 255), - grDevices::rgb(179 / 255, 24 / 255, 13 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 240 / 255, 221 / 255), - grDevices::rgb(254 / 255, 234 / 255, 206 / 255), - grDevices::rgb(254 / 255, 227 / 255, 190 / 255), - grDevices::rgb(253 / 255, 219 / 255, 172 / 255), - grDevices::rgb(253 / 255, 210 / 255, 156 / 255), - grDevices::rgb(253 / 255, 200 / 255, 145 / 255), - grDevices::rgb(253 / 255, 189 / 255, 135 / 255), - grDevices::rgb(253 / 255, 173 / 255, 119 / 255), - grDevices::rgb(252 / 255, 154 / 255, 101 / 255), - grDevices::rgb(250 / 255, 136 / 255, 86 / 255), - grDevices::rgb(245 / 255, 120 / 255, 79 / 255), - grDevices::rgb(239 / 255, 103 / 255, 72 / 255), - grDevices::rgb(230 / 255, 84 / 255, 57 / 255), - grDevices::rgb(220 / 255, 62 / 255, 40 / 255), - grDevices::rgb(203 / 255, 41 / 255, 25 / 255), - grDevices::rgb(178 / 255, 23 / 255, 12 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 241 / 255, 221 / 255), - grDevices::rgb(254 / 255, 235 / 255, 207 / 255), - grDevices::rgb(254 / 255, 228 / 255, 192 / 255), - grDevices::rgb(253 / 255, 220 / 255, 176 / 255), - grDevices::rgb(253 / 255, 213 / 255, 160 / 255), - grDevices::rgb(253 / 255, 203 / 255, 149 / 255), - grDevices::rgb(253 / 255, 193 / 255, 139 / 255), - grDevices::rgb(253 / 255, 182 / 255, 127 / 255), - grDevices::rgb(253 / 255, 164 / 255, 110 / 255), - grDevices::rgb(252 / 255, 146 / 255, 93 / 255), - grDevices::rgb(248 / 255, 130 / 255, 84 / 255), - grDevices::rgb(243 / 255, 114 / 255, 77 / 255), - grDevices::rgb(237 / 255, 98 / 255, 69 / 255), - grDevices::rgb(228 / 255, 79 / 255, 53 / 255), - grDevices::rgb(219 / 255, 58 / 255, 37 / 255), - grDevices::rgb(200 / 255, 39 / 255, 24 / 255), - grDevices::rgb(176 / 255, 22 / 255, 11 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 235 / 255), - grDevices::rgb(254 / 255, 241 / 255, 222 / 255), - grDevices::rgb(254 / 255, 235 / 255, 209 / 255), - grDevices::rgb(254 / 255, 229 / 255, 195 / 255), - grDevices::rgb(253 / 255, 222 / 255, 180 / 255), - grDevices::rgb(253 / 255, 215 / 255, 164 / 255), - grDevices::rgb(253 / 255, 206 / 255, 152 / 255), - grDevices::rgb(253 / 255, 197 / 255, 142 / 255), - grDevices::rgb(253 / 255, 188 / 255, 133 / 255), - grDevices::rgb(253 / 255, 172 / 255, 118 / 255), - grDevices::rgb(252 / 255, 155 / 255, 102 / 255), - grDevices::rgb(251 / 255, 138 / 255, 88 / 255), - grDevices::rgb(246 / 255, 124 / 255, 81 / 255), - grDevices::rgb(241 / 255, 109 / 255, 75 / 255), - grDevices::rgb(235 / 255, 93 / 255, 65 / 255), - grDevices::rgb(226 / 255, 75 / 255, 50 / 255), - grDevices::rgb(217 / 255, 54 / 255, 35 / 255), - grDevices::rgb(198 / 255, 37 / 255, 22 / 255), - grDevices::rgb(175 / 255, 21 / 255, 11 / 255), - grDevices::rgb(153 / 255, 0 / 255, 0 / 255) - ), - "type" = "sequential" - ), - "PuBu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(166 / 255, 189 / 255, 219 / 255)), - "2" = tibble::lst( - grDevices::rgb(236 / 255, 231 / 255, 242 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(236 / 255, 231 / 255, 242 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(189 / 255, 201 / 255, 225 / 255), - grDevices::rgb(116 / 255, 169 / 255, 207 / 255), - grDevices::rgb(5 / 255, 112 / 255, 176 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(189 / 255, 201 / 255, 225 / 255), - grDevices::rgb(116 / 255, 169 / 255, 207 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255), - grDevices::rgb(4 / 255, 90 / 255, 141 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(116 / 255, 169 / 255, 207 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255), - grDevices::rgb(4 / 255, 90 / 255, 141 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(116 / 255, 169 / 255, 207 / 255), - grDevices::rgb(54 / 255, 144 / 255, 192 / 255), - grDevices::rgb(5 / 255, 112 / 255, 176 / 255), - grDevices::rgb(3 / 255, 78 / 255, 123 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 251 / 255), - grDevices::rgb(236 / 255, 231 / 255, 242 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(116 / 255, 169 / 255, 207 / 255), - grDevices::rgb(54 / 255, 144 / 255, 192 / 255), - grDevices::rgb(5 / 255, 112 / 255, 176 / 255), - grDevices::rgb(3 / 255, 78 / 255, 123 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 251 / 255), - grDevices::rgb(236 / 255, 231 / 255, 242 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(116 / 255, 169 / 255, 207 / 255), - grDevices::rgb(54 / 255, 144 / 255, 192 / 255), - grDevices::rgb(5 / 255, 112 / 255, 176 / 255), - grDevices::rgb(4 / 255, 90 / 255, 141 / 255), - grDevices::rgb(2 / 255, 56 / 255, 88 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(240 / 255, 234 / 255, 243 / 255), - grDevices::rgb(220 / 255, 218 / 255, 235 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(160 / 255, 186 / 255, 217 / 255), - grDevices::rgb(121 / 255, 171 / 255, 208 / 255), - grDevices::rgb(78 / 255, 152 / 255, 197 / 255), - grDevices::rgb(38 / 255, 129 / 255, 184 / 255), - grDevices::rgb(4 / 255, 104 / 255, 163 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(241 / 255, 235 / 255, 244 / 255), - grDevices::rgb(224 / 255, 222 / 255, 237 / 255), - grDevices::rgb(203 / 255, 206 / 255, 228 / 255), - grDevices::rgb(174 / 255, 192 / 255, 221 / 255), - grDevices::rgb(141 / 255, 178 / 255, 213 / 255), - grDevices::rgb(105 / 255, 163 / 255, 204 / 255), - grDevices::rgb(62 / 255, 146 / 255, 193 / 255), - grDevices::rgb(32 / 255, 124 / 255, 182 / 255), - grDevices::rgb(4 / 255, 101 / 255, 159 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(242 / 255, 236 / 255, 245 / 255), - grDevices::rgb(228 / 255, 224 / 255, 238 / 255), - grDevices::rgb(210 / 255, 210 / 255, 231 / 255), - grDevices::rgb(185 / 255, 198 / 255, 224 / 255), - grDevices::rgb(157 / 255, 185 / 255, 216 / 255), - grDevices::rgb(125 / 255, 172 / 255, 209 / 255), - grDevices::rgb(91 / 255, 157 / 255, 200 / 255), - grDevices::rgb(51 / 255, 141 / 255, 190 / 255), - grDevices::rgb(25 / 255, 120 / 255, 180 / 255), - grDevices::rgb(4 / 255, 99 / 255, 156 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(243 / 255, 237 / 255, 245 / 255), - grDevices::rgb(231 / 255, 227 / 255, 239 / 255), - grDevices::rgb(214 / 255, 214 / 255, 232 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(169 / 255, 190 / 255, 219 / 255), - grDevices::rgb(141 / 255, 178 / 255, 213 / 255), - grDevices::rgb(111 / 255, 166 / 255, 205 / 255), - grDevices::rgb(78 / 255, 152 / 255, 197 / 255), - grDevices::rgb(45 / 255, 135 / 255, 188 / 255), - grDevices::rgb(19 / 255, 117 / 255, 178 / 255), - grDevices::rgb(4 / 255, 97 / 255, 153 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(244 / 255, 238 / 255, 246 / 255), - grDevices::rgb(233 / 255, 229 / 255, 241 / 255), - grDevices::rgb(218 / 255, 217 / 255, 234 / 255), - grDevices::rgb(201 / 255, 205 / 255, 228 / 255), - grDevices::rgb(179 / 255, 195 / 255, 222 / 255), - grDevices::rgb(155 / 255, 184 / 255, 216 / 255), - grDevices::rgb(128 / 255, 173 / 255, 209 / 255), - grDevices::rgb(99 / 255, 161 / 255, 202 / 255), - grDevices::rgb(66 / 255, 147 / 255, 194 / 255), - grDevices::rgb(40 / 255, 131 / 255, 185 / 255), - grDevices::rgb(12 / 255, 114 / 255, 177 / 255), - grDevices::rgb(4 / 255, 96 / 255, 151 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(245 / 255, 238 / 255, 246 / 255), - grDevices::rgb(235 / 255, 230 / 255, 242 / 255), - grDevices::rgb(221 / 255, 219 / 255, 235 / 255), - grDevices::rgb(208 / 255, 209 / 255, 229 / 255), - grDevices::rgb(187 / 255, 198 / 255, 224 / 255), - grDevices::rgb(165 / 255, 189 / 255, 218 / 255), - grDevices::rgb(141 / 255, 178 / 255, 213 / 255), - grDevices::rgb(115 / 255, 169 / 255, 206 / 255), - grDevices::rgb(88 / 255, 156 / 255, 199 / 255), - grDevices::rgb(53 / 255, 144 / 255, 191 / 255), - grDevices::rgb(36 / 255, 127 / 255, 184 / 255), - grDevices::rgb(5 / 255, 112 / 255, 176 / 255), - grDevices::rgb(3 / 255, 94 / 255, 149 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(246 / 255, 239 / 255, 246 / 255), - grDevices::rgb(237 / 255, 232 / 255, 242 / 255), - grDevices::rgb(224 / 255, 222 / 255, 237 / 255), - grDevices::rgb(211 / 255, 211 / 255, 231 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(174 / 255, 192 / 255, 221 / 255), - grDevices::rgb(153 / 255, 183 / 255, 215 / 255), - grDevices::rgb(130 / 255, 174 / 255, 210 / 255), - grDevices::rgb(105 / 255, 163 / 255, 204 / 255), - grDevices::rgb(78 / 255, 152 / 255, 197 / 255), - grDevices::rgb(49 / 255, 139 / 255, 189 / 255), - grDevices::rgb(32 / 255, 124 / 255, 182 / 255), - grDevices::rgb(4 / 255, 109 / 255, 172 / 255), - grDevices::rgb(3 / 255, 93 / 255, 147 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(246 / 255, 239 / 255, 247 / 255), - grDevices::rgb(238 / 255, 232 / 255, 243 / 255), - grDevices::rgb(227 / 255, 224 / 255, 238 / 255), - grDevices::rgb(214 / 255, 214 / 255, 232 / 255), - grDevices::rgb(200 / 255, 205 / 255, 227 / 255), - grDevices::rgb(181 / 255, 196 / 255, 223 / 255), - grDevices::rgb(163 / 255, 187 / 255, 218 / 255), - grDevices::rgb(141 / 255, 178 / 255, 213 / 255), - grDevices::rgb(119 / 255, 170 / 255, 207 / 255), - grDevices::rgb(95 / 255, 159 / 255, 201 / 255), - grDevices::rgb(68 / 255, 148 / 255, 194 / 255), - grDevices::rgb(45 / 255, 135 / 255, 188 / 255), - grDevices::rgb(27 / 255, 121 / 255, 181 / 255), - grDevices::rgb(4 / 255, 107 / 255, 169 / 255), - grDevices::rgb(3 / 255, 92 / 255, 145 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(247 / 255, 240 / 255, 247 / 255), - grDevices::rgb(239 / 255, 233 / 255, 243 / 255), - grDevices::rgb(229 / 255, 225 / 255, 239 / 255), - grDevices::rgb(217 / 255, 216 / 255, 234 / 255), - grDevices::rgb(205 / 255, 207 / 255, 229 / 255), - grDevices::rgb(188 / 255, 199 / 255, 224 / 255), - grDevices::rgb(171 / 255, 191 / 255, 220 / 255), - grDevices::rgb(151 / 255, 183 / 255, 215 / 255), - grDevices::rgb(131 / 255, 174 / 255, 210 / 255), - grDevices::rgb(109 / 255, 166 / 255, 205 / 255), - grDevices::rgb(86 / 255, 155 / 255, 199 / 255), - grDevices::rgb(58 / 255, 145 / 255, 192 / 255), - grDevices::rgb(42 / 255, 132 / 255, 186 / 255), - grDevices::rgb(23 / 255, 119 / 255, 179 / 255), - grDevices::rgb(4 / 255, 105 / 255, 166 / 255), - grDevices::rgb(3 / 255, 91 / 255, 144 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(247 / 255, 240 / 255, 247 / 255), - grDevices::rgb(240 / 255, 234 / 255, 243 / 255), - grDevices::rgb(231 / 255, 227 / 255, 239 / 255), - grDevices::rgb(220 / 255, 218 / 255, 235 / 255), - grDevices::rgb(209 / 255, 210 / 255, 230 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(177 / 255, 194 / 255, 222 / 255), - grDevices::rgb(160 / 255, 186 / 255, 217 / 255), - grDevices::rgb(141 / 255, 178 / 255, 213 / 255), - grDevices::rgb(121 / 255, 171 / 255, 208 / 255), - grDevices::rgb(101 / 255, 161 / 255, 202 / 255), - grDevices::rgb(78 / 255, 152 / 255, 197 / 255), - grDevices::rgb(52 / 255, 142 / 255, 191 / 255), - grDevices::rgb(38 / 255, 129 / 255, 184 / 255), - grDevices::rgb(19 / 255, 117 / 255, 178 / 255), - grDevices::rgb(4 / 255, 104 / 255, 163 / 255), - grDevices::rgb(3 / 255, 90 / 255, 143 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(247 / 255, 241 / 255, 247 / 255), - grDevices::rgb(240 / 255, 235 / 255, 244 / 255), - grDevices::rgb(233 / 255, 228 / 255, 240 / 255), - grDevices::rgb(222 / 255, 220 / 255, 236 / 255), - grDevices::rgb(212 / 255, 212 / 255, 231 / 255), - grDevices::rgb(199 / 255, 204 / 255, 227 / 255), - grDevices::rgb(183 / 255, 197 / 255, 223 / 255), - grDevices::rgb(168 / 255, 190 / 255, 219 / 255), - grDevices::rgb(150 / 255, 182 / 255, 215 / 255), - grDevices::rgb(132 / 255, 175 / 255, 210 / 255), - grDevices::rgb(113 / 255, 167 / 255, 206 / 255), - grDevices::rgb(93 / 255, 158 / 255, 200 / 255), - grDevices::rgb(70 / 255, 149 / 255, 195 / 255), - grDevices::rgb(48 / 255, 138 / 255, 189 / 255), - grDevices::rgb(35 / 255, 126 / 255, 183 / 255), - grDevices::rgb(15 / 255, 115 / 255, 177 / 255), - grDevices::rgb(4 / 255, 102 / 255, 161 / 255), - grDevices::rgb(3 / 255, 90 / 255, 142 / 255), - grDevices::rgb(2 / 255, 77 / 255, 122 / 255) - ), - "type" = "sequential" - ), - "BuPu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(158 / 255, 188 / 255, 218 / 255)), - "2" = tibble::lst( - grDevices::rgb(224 / 255, 236 / 255, 244 / 255), - grDevices::rgb(136 / 255, 86 / 255, 167 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(224 / 255, 236 / 255, 244 / 255), - grDevices::rgb(158 / 255, 188 / 255, 218 / 255), - grDevices::rgb(136 / 255, 86 / 255, 167 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(140 / 255, 150 / 255, 198 / 255), - grDevices::rgb(136 / 255, 65 / 255, 157 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(179 / 255, 205 / 255, 227 / 255), - grDevices::rgb(140 / 255, 150 / 255, 198 / 255), - grDevices::rgb(136 / 255, 86 / 255, 167 / 255), - grDevices::rgb(129 / 255, 15 / 255, 124 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(191 / 255, 211 / 255, 230 / 255), - grDevices::rgb(158 / 255, 188 / 255, 218 / 255), - grDevices::rgb(140 / 255, 150 / 255, 198 / 255), - grDevices::rgb(136 / 255, 86 / 255, 167 / 255), - grDevices::rgb(129 / 255, 15 / 255, 124 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(191 / 255, 211 / 255, 230 / 255), - grDevices::rgb(158 / 255, 188 / 255, 218 / 255), - grDevices::rgb(140 / 255, 150 / 255, 198 / 255), - grDevices::rgb(140 / 255, 107 / 255, 177 / 255), - grDevices::rgb(136 / 255, 65 / 255, 157 / 255), - grDevices::rgb(110 / 255, 1 / 255, 107 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(224 / 255, 236 / 255, 244 / 255), - grDevices::rgb(191 / 255, 211 / 255, 230 / 255), - grDevices::rgb(158 / 255, 188 / 255, 218 / 255), - grDevices::rgb(140 / 255, 150 / 255, 198 / 255), - grDevices::rgb(140 / 255, 107 / 255, 177 / 255), - grDevices::rgb(136 / 255, 65 / 255, 157 / 255), - grDevices::rgb(110 / 255, 1 / 255, 107 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(224 / 255, 236 / 255, 244 / 255), - grDevices::rgb(191 / 255, 211 / 255, 230 / 255), - grDevices::rgb(158 / 255, 188 / 255, 218 / 255), - grDevices::rgb(140 / 255, 150 / 255, 198 / 255), - grDevices::rgb(140 / 255, 107 / 255, 177 / 255), - grDevices::rgb(136 / 255, 65 / 255, 157 / 255), - grDevices::rgb(129 / 255, 15 / 255, 124 / 255), - grDevices::rgb(77 / 255, 0 / 255, 75 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(229 / 255, 239 / 255, 245 / 255), - grDevices::rgb(205 / 255, 222 / 255, 236 / 255), - grDevices::rgb(180 / 255, 203 / 255, 226 / 255), - grDevices::rgb(156 / 255, 183 / 255, 215 / 255), - grDevices::rgb(142 / 255, 154 / 255, 200 / 255), - grDevices::rgb(140 / 255, 121 / 255, 183 / 255), - grDevices::rgb(138 / 255, 89 / 255, 168 / 255), - grDevices::rgb(130 / 255, 54 / 255, 145 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(230 / 255, 240 / 255, 246 / 255), - grDevices::rgb(210 / 255, 225 / 255, 238 / 255), - grDevices::rgb(187 / 255, 208 / 255, 228 / 255), - grDevices::rgb(164 / 255, 192 / 255, 220 / 255), - grDevices::rgb(149 / 255, 168 / 255, 207 / 255), - grDevices::rgb(140 / 255, 141 / 255, 193 / 255), - grDevices::rgb(140 / 255, 111 / 255, 179 / 255), - grDevices::rgb(138 / 255, 82 / 255, 164 / 255), - grDevices::rgb(128 / 255, 50 / 255, 141 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(232 / 255, 241 / 255, 247 / 255), - grDevices::rgb(215 / 255, 229 / 255, 240 / 255), - grDevices::rgb(194 / 255, 213 / 255, 231 / 255), - grDevices::rgb(173 / 255, 198 / 255, 223 / 255), - grDevices::rgb(154 / 255, 181 / 255, 214 / 255), - grDevices::rgb(143 / 255, 156 / 255, 201 / 255), - grDevices::rgb(140 / 255, 130 / 255, 188 / 255), - grDevices::rgb(139 / 255, 103 / 255, 175 / 255), - grDevices::rgb(137 / 255, 77 / 255, 162 / 255), - grDevices::rgb(126 / 255, 46 / 255, 138 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(233 / 255, 242 / 255, 247 / 255), - grDevices::rgb(218 / 255, 231 / 255, 241 / 255), - grDevices::rgb(199 / 255, 217 / 255, 233 / 255), - grDevices::rgb(180 / 255, 203 / 255, 226 / 255), - grDevices::rgb(160 / 255, 189 / 255, 219 / 255), - grDevices::rgb(149 / 255, 168 / 255, 207 / 255), - grDevices::rgb(140 / 255, 146 / 255, 196 / 255), - grDevices::rgb(140 / 255, 121 / 255, 183 / 255), - grDevices::rgb(139 / 255, 97 / 255, 171 / 255), - grDevices::rgb(136 / 255, 72 / 255, 160 / 255), - grDevices::rgb(125 / 255, 43 / 255, 135 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(234 / 255, 243 / 255, 248 / 255), - grDevices::rgb(221 / 255, 234 / 255, 242 / 255), - grDevices::rgb(203 / 255, 220 / 255, 235 / 255), - grDevices::rgb(185 / 255, 207 / 255, 228 / 255), - grDevices::rgb(168 / 255, 195 / 255, 221 / 255), - grDevices::rgb(153 / 255, 179 / 255, 213 / 255), - grDevices::rgb(144 / 255, 158 / 255, 202 / 255), - grDevices::rgb(140 / 255, 136 / 255, 191 / 255), - grDevices::rgb(140 / 255, 113 / 255, 180 / 255), - grDevices::rgb(138 / 255, 91 / 255, 169 / 255), - grDevices::rgb(136 / 255, 68 / 255, 158 / 255), - grDevices::rgb(124 / 255, 41 / 255, 133 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(235 / 255, 243 / 255, 248 / 255), - grDevices::rgb(223 / 255, 235 / 255, 243 / 255), - grDevices::rgb(207 / 255, 223 / 255, 236 / 255), - grDevices::rgb(191 / 255, 210 / 255, 229 / 255), - grDevices::rgb(174 / 255, 199 / 255, 224 / 255), - grDevices::rgb(158 / 255, 187 / 255, 217 / 255), - grDevices::rgb(149 / 255, 168 / 255, 207 / 255), - grDevices::rgb(140 / 255, 150 / 255, 197 / 255), - grDevices::rgb(140 / 255, 128 / 255, 187 / 255), - grDevices::rgb(140 / 255, 107 / 255, 177 / 255), - grDevices::rgb(138 / 255, 86 / 255, 166 / 255), - grDevices::rgb(135 / 255, 64 / 255, 157 / 255), - grDevices::rgb(123 / 255, 39 / 255, 131 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(236 / 255, 244 / 255, 248 / 255), - grDevices::rgb(225 / 255, 237 / 255, 244 / 255), - grDevices::rgb(210 / 255, 225 / 255, 238 / 255), - grDevices::rgb(195 / 255, 214 / 255, 231 / 255), - grDevices::rgb(180 / 255, 203 / 255, 226 / 255), - grDevices::rgb(164 / 255, 192 / 255, 220 / 255), - grDevices::rgb(153 / 255, 177 / 255, 212 / 255), - grDevices::rgb(144 / 255, 160 / 255, 203 / 255), - grDevices::rgb(140 / 255, 141 / 255, 193 / 255), - grDevices::rgb(140 / 255, 121 / 255, 183 / 255), - grDevices::rgb(139 / 255, 101 / 255, 174 / 255), - grDevices::rgb(138 / 255, 82 / 255, 164 / 255), - grDevices::rgb(134 / 255, 61 / 255, 153 / 255), - grDevices::rgb(122 / 255, 37 / 255, 129 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(236 / 255, 244 / 255, 249 / 255), - grDevices::rgb(226 / 255, 237 / 255, 245 / 255), - grDevices::rgb(213 / 255, 228 / 255, 239 / 255), - grDevices::rgb(199 / 255, 217 / 255, 233 / 255), - grDevices::rgb(184 / 255, 206 / 255, 227 / 255), - grDevices::rgb(170 / 255, 196 / 255, 222 / 255), - grDevices::rgb(156 / 255, 185 / 255, 216 / 255), - grDevices::rgb(149 / 255, 168 / 255, 207 / 255), - grDevices::rgb(141 / 255, 152 / 255, 199 / 255), - grDevices::rgb(140 / 255, 134 / 255, 190 / 255), - grDevices::rgb(140 / 255, 115 / 255, 180 / 255), - grDevices::rgb(139 / 255, 97 / 255, 171 / 255), - grDevices::rgb(137 / 255, 78 / 255, 163 / 255), - grDevices::rgb(132 / 255, 58 / 255, 150 / 255), - grDevices::rgb(121 / 255, 35 / 255, 128 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(237 / 255, 245 / 255, 249 / 255), - grDevices::rgb(228 / 255, 238 / 255, 245 / 255), - grDevices::rgb(216 / 255, 230 / 255, 240 / 255), - grDevices::rgb(202 / 255, 219 / 255, 234 / 255), - grDevices::rgb(189 / 255, 209 / 255, 229 / 255), - grDevices::rgb(175 / 255, 200 / 255, 224 / 255), - grDevices::rgb(161 / 255, 190 / 255, 219 / 255), - grDevices::rgb(152 / 255, 176 / 255, 212 / 255), - grDevices::rgb(145 / 255, 161 / 255, 203 / 255), - grDevices::rgb(140 / 255, 145 / 255, 195 / 255), - grDevices::rgb(140 / 255, 127 / 255, 186 / 255), - grDevices::rgb(140 / 255, 109 / 255, 178 / 255), - grDevices::rgb(139 / 255, 92 / 255, 169 / 255), - grDevices::rgb(137 / 255, 75 / 255, 161 / 255), - grDevices::rgb(131 / 255, 56 / 255, 147 / 255), - grDevices::rgb(121 / 255, 34 / 255, 127 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(238 / 255, 245 / 255, 249 / 255), - grDevices::rgb(229 / 255, 239 / 255, 245 / 255), - grDevices::rgb(218 / 255, 231 / 255, 241 / 255), - grDevices::rgb(205 / 255, 222 / 255, 236 / 255), - grDevices::rgb(192 / 255, 212 / 255, 230 / 255), - grDevices::rgb(180 / 255, 203 / 255, 226 / 255), - grDevices::rgb(167 / 255, 194 / 255, 221 / 255), - grDevices::rgb(156 / 255, 183 / 255, 215 / 255), - grDevices::rgb(149 / 255, 168 / 255, 207 / 255), - grDevices::rgb(142 / 255, 154 / 255, 200 / 255), - grDevices::rgb(140 / 255, 138 / 255, 192 / 255), - grDevices::rgb(140 / 255, 121 / 255, 183 / 255), - grDevices::rgb(139 / 255, 104 / 255, 175 / 255), - grDevices::rgb(138 / 255, 89 / 255, 168 / 255), - grDevices::rgb(136 / 255, 72 / 255, 160 / 255), - grDevices::rgb(130 / 255, 54 / 255, 145 / 255), - grDevices::rgb(120 / 255, 32 / 255, 126 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(238 / 255, 246 / 255, 249 / 255), - grDevices::rgb(230 / 255, 240 / 255, 246 / 255), - grDevices::rgb(220 / 255, 233 / 255, 242 / 255), - grDevices::rgb(208 / 255, 224 / 255, 237 / 255), - grDevices::rgb(196 / 255, 214 / 255, 232 / 255), - grDevices::rgb(184 / 255, 206 / 255, 227 / 255), - grDevices::rgb(172 / 255, 197 / 255, 223 / 255), - grDevices::rgb(159 / 255, 189 / 255, 218 / 255), - grDevices::rgb(152 / 255, 175 / 255, 211 / 255), - grDevices::rgb(145 / 255, 161 / 255, 204 / 255), - grDevices::rgb(140 / 255, 147 / 255, 196 / 255), - grDevices::rgb(140 / 255, 132 / 255, 189 / 255), - grDevices::rgb(140 / 255, 116 / 255, 181 / 255), - grDevices::rgb(139 / 255, 100 / 255, 173 / 255), - grDevices::rgb(138 / 255, 85 / 255, 166 / 255), - grDevices::rgb(136 / 255, 69 / 255, 159 / 255), - grDevices::rgb(129 / 255, 51 / 255, 143 / 255), - grDevices::rgb(119 / 255, 31 / 255, 125 / 255), - grDevices::rgb(109 / 255, 0 / 255, 107 / 255) - ), - "type" = "sequential" - ), - "Oranges" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(230 / 255, 85 / 255, 13 / 255)), - "2" = tibble::lst( - grDevices::rgb(254 / 255, 230 / 255, 206 / 255), - grDevices::rgb(230 / 255, 85 / 255, 13 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(254 / 255, 230 / 255, 206 / 255), - grDevices::rgb(253 / 255, 174 / 255, 107 / 255), - grDevices::rgb(230 / 255, 85 / 255, 13 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(254 / 255, 237 / 255, 222 / 255), - grDevices::rgb(253 / 255, 190 / 255, 133 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(217 / 255, 71 / 255, 1 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(254 / 255, 237 / 255, 222 / 255), - grDevices::rgb(253 / 255, 190 / 255, 133 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(230 / 255, 85 / 255, 13 / 255), - grDevices::rgb(166 / 255, 54 / 255, 3 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(254 / 255, 237 / 255, 222 / 255), - grDevices::rgb(253 / 255, 208 / 255, 162 / 255), - grDevices::rgb(253 / 255, 174 / 255, 107 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(230 / 255, 85 / 255, 13 / 255), - grDevices::rgb(166 / 255, 54 / 255, 3 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(254 / 255, 237 / 255, 222 / 255), - grDevices::rgb(253 / 255, 208 / 255, 162 / 255), - grDevices::rgb(253 / 255, 174 / 255, 107 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(241 / 255, 105 / 255, 19 / 255), - grDevices::rgb(217 / 255, 72 / 255, 1 / 255), - grDevices::rgb(140 / 255, 45 / 255, 4 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 245 / 255, 235 / 255), - grDevices::rgb(254 / 255, 230 / 255, 206 / 255), - grDevices::rgb(253 / 255, 208 / 255, 162 / 255), - grDevices::rgb(253 / 255, 174 / 255, 107 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(241 / 255, 105 / 255, 19 / 255), - grDevices::rgb(217 / 255, 72 / 255, 1 / 255), - grDevices::rgb(140 / 255, 45 / 255, 4 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 245 / 255, 235 / 255), - grDevices::rgb(254 / 255, 230 / 255, 206 / 255), - grDevices::rgb(253 / 255, 208 / 255, 162 / 255), - grDevices::rgb(253 / 255, 174 / 255, 107 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(241 / 255, 105 / 255, 19 / 255), - grDevices::rgb(217 / 255, 72 / 255, 1 / 255), - grDevices::rgb(166 / 255, 54 / 255, 3 / 255), - grDevices::rgb(127 / 255, 39 / 255, 4 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 233 / 255, 212 / 255), - grDevices::rgb(253 / 255, 217 / 255, 181 / 255), - grDevices::rgb(253 / 255, 196 / 255, 143 / 255), - grDevices::rgb(253 / 255, 170 / 255, 101 / 255), - grDevices::rgb(253 / 255, 144 / 255, 65 / 255), - grDevices::rgb(245 / 255, 117 / 255, 34 / 255), - grDevices::rgb(230 / 255, 90 / 255, 10 / 255), - grDevices::rgb(199 / 255, 65 / 255, 2 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 234 / 255, 214 / 255), - grDevices::rgb(254 / 255, 221 / 255, 188 / 255), - grDevices::rgb(253 / 255, 204 / 255, 156 / 255), - grDevices::rgb(253 / 255, 180 / 255, 117 / 255), - grDevices::rgb(253 / 255, 157 / 255, 83 / 255), - grDevices::rgb(250 / 255, 134 / 255, 52 / 255), - grDevices::rgb(242 / 255, 108 / 255, 24 / 255), - grDevices::rgb(226 / 255, 85 / 255, 7 / 255), - grDevices::rgb(193 / 255, 63 / 255, 2 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 235 / 255, 216 / 255), - grDevices::rgb(254 / 255, 223 / 255, 193 / 255), - grDevices::rgb(253 / 255, 209 / 255, 165 / 255), - grDevices::rgb(253 / 255, 189 / 255, 131 / 255), - grDevices::rgb(253 / 255, 168 / 255, 98 / 255), - grDevices::rgb(253 / 255, 147 / 255, 68 / 255), - grDevices::rgb(247 / 255, 124 / 255, 43 / 255), - grDevices::rgb(238 / 255, 102 / 255, 17 / 255), - grDevices::rgb(223 / 255, 81 / 255, 5 / 255), - grDevices::rgb(188 / 255, 61 / 255, 2 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 236 / 255, 218 / 255), - grDevices::rgb(254 / 255, 226 / 255, 198 / 255), - grDevices::rgb(253 / 255, 213 / 255, 172 / 255), - grDevices::rgb(253 / 255, 196 / 255, 143 / 255), - grDevices::rgb(253 / 255, 176 / 255, 111 / 255), - grDevices::rgb(253 / 255, 157 / 255, 83 / 255), - grDevices::rgb(252 / 255, 138 / 255, 56 / 255), - grDevices::rgb(245 / 255, 117 / 255, 34 / 255), - grDevices::rgb(235 / 255, 97 / 255, 14 / 255), - grDevices::rgb(221 / 255, 77 / 255, 3 / 255), - grDevices::rgb(184 / 255, 60 / 255, 2 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 236 / 255, 219 / 255), - grDevices::rgb(254 / 255, 228 / 255, 202 / 255), - grDevices::rgb(253 / 255, 216 / 255, 178 / 255), - grDevices::rgb(253 / 255, 202 / 255, 153 / 255), - grDevices::rgb(253 / 255, 184 / 255, 123 / 255), - grDevices::rgb(253 / 255, 166 / 255, 96 / 255), - grDevices::rgb(253 / 255, 148 / 255, 71 / 255), - grDevices::rgb(249 / 255, 130 / 255, 48 / 255), - grDevices::rgb(242 / 255, 110 / 255, 26 / 255), - grDevices::rgb(231 / 255, 92 / 255, 11 / 255), - grDevices::rgb(218 / 255, 74 / 255, 2 / 255), - grDevices::rgb(180 / 255, 59 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 237 / 255, 220 / 255), - grDevices::rgb(254 / 255, 229 / 255, 205 / 255), - grDevices::rgb(253 / 255, 218 / 255, 183 / 255), - grDevices::rgb(253 / 255, 208 / 255, 161 / 255), - grDevices::rgb(253 / 255, 191 / 255, 134 / 255), - grDevices::rgb(253 / 255, 173 / 255, 107 / 255), - grDevices::rgb(253 / 255, 157 / 255, 83 / 255), - grDevices::rgb(253 / 255, 140 / 255, 59 / 255), - grDevices::rgb(247 / 255, 123 / 255, 41 / 255), - grDevices::rgb(241 / 255, 104 / 255, 19 / 255), - grDevices::rgb(229 / 255, 88 / 255, 9 / 255), - grDevices::rgb(216 / 255, 71 / 255, 0 / 255), - grDevices::rgb(177 / 255, 58 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 237 / 255, 221 / 255), - grDevices::rgb(254 / 255, 230 / 255, 207 / 255), - grDevices::rgb(254 / 255, 221 / 255, 188 / 255), - grDevices::rgb(253 / 255, 210 / 255, 167 / 255), - grDevices::rgb(253 / 255, 196 / 255, 143 / 255), - grDevices::rgb(253 / 255, 180 / 255, 117 / 255), - grDevices::rgb(253 / 255, 165 / 255, 94 / 255), - grDevices::rgb(253 / 255, 149 / 255, 72 / 255), - grDevices::rgb(250 / 255, 134 / 255, 52 / 255), - grDevices::rgb(245 / 255, 117 / 255, 34 / 255), - grDevices::rgb(237 / 255, 100 / 255, 16 / 255), - grDevices::rgb(226 / 255, 85 / 255, 7 / 255), - grDevices::rgb(211 / 255, 70 / 255, 1 / 255), - grDevices::rgb(175 / 255, 57 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 238 / 255, 222 / 255), - grDevices::rgb(254 / 255, 231 / 255, 209 / 255), - grDevices::rgb(254 / 255, 223 / 255, 192 / 255), - grDevices::rgb(253 / 255, 213 / 255, 172 / 255), - grDevices::rgb(253 / 255, 201 / 255, 151 / 255), - grDevices::rgb(253 / 255, 186 / 255, 127 / 255), - grDevices::rgb(253 / 255, 171 / 255, 104 / 255), - grDevices::rgb(253 / 255, 157 / 255, 83 / 255), - grDevices::rgb(253 / 255, 143 / 255, 63 / 255), - grDevices::rgb(248 / 255, 127 / 255, 46 / 255), - grDevices::rgb(243 / 255, 111 / 255, 28 / 255), - grDevices::rgb(235 / 255, 97 / 255, 14 / 255), - grDevices::rgb(224 / 255, 82 / 255, 5 / 255), - grDevices::rgb(207 / 255, 68 / 255, 1 / 255), - grDevices::rgb(172 / 255, 56 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 238 / 255, 223 / 255), - grDevices::rgb(254 / 255, 232 / 255, 211 / 255), - grDevices::rgb(254 / 255, 224 / 255, 195 / 255), - grDevices::rgb(253 / 255, 215 / 255, 177 / 255), - grDevices::rgb(253 / 255, 206 / 255, 158 / 255), - grDevices::rgb(253 / 255, 192 / 255, 136 / 255), - grDevices::rgb(253 / 255, 178 / 255, 113 / 255), - grDevices::rgb(253 / 255, 164 / 255, 93 / 255), - grDevices::rgb(253 / 255, 150 / 255, 74 / 255), - grDevices::rgb(251 / 255, 136 / 255, 55 / 255), - grDevices::rgb(246 / 255, 122 / 255, 40 / 255), - grDevices::rgb(241 / 255, 107 / 255, 22 / 255), - grDevices::rgb(232 / 255, 93 / 255, 12 / 255), - grDevices::rgb(222 / 255, 80 / 255, 4 / 255), - grDevices::rgb(202 / 255, 67 / 255, 1 / 255), - grDevices::rgb(170 / 255, 55 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 239 / 255, 223 / 255), - grDevices::rgb(254 / 255, 233 / 255, 212 / 255), - grDevices::rgb(254 / 255, 226 / 255, 198 / 255), - grDevices::rgb(253 / 255, 217 / 255, 181 / 255), - grDevices::rgb(253 / 255, 209 / 255, 164 / 255), - grDevices::rgb(253 / 255, 196 / 255, 143 / 255), - grDevices::rgb(253 / 255, 183 / 255, 122 / 255), - grDevices::rgb(253 / 255, 170 / 255, 101 / 255), - grDevices::rgb(253 / 255, 157 / 255, 83 / 255), - grDevices::rgb(253 / 255, 144 / 255, 65 / 255), - grDevices::rgb(249 / 255, 131 / 255, 49 / 255), - grDevices::rgb(245 / 255, 117 / 255, 34 / 255), - grDevices::rgb(239 / 255, 103 / 255, 18 / 255), - grDevices::rgb(230 / 255, 90 / 255, 10 / 255), - grDevices::rgb(221 / 255, 77 / 255, 3 / 255), - grDevices::rgb(199 / 255, 65 / 255, 2 / 255), - grDevices::rgb(169 / 255, 55 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 235 / 255), - grDevices::rgb(254 / 255, 239 / 255, 224 / 255), - grDevices::rgb(254 / 255, 233 / 255, 213 / 255), - grDevices::rgb(254 / 255, 227 / 255, 201 / 255), - grDevices::rgb(253 / 255, 219 / 255, 185 / 255), - grDevices::rgb(253 / 255, 211 / 255, 168 / 255), - grDevices::rgb(253 / 255, 200 / 255, 150 / 255), - grDevices::rgb(253 / 255, 188 / 255, 130 / 255), - grDevices::rgb(253 / 255, 175 / 255, 109 / 255), - grDevices::rgb(253 / 255, 163 / 255, 92 / 255), - grDevices::rgb(253 / 255, 151 / 255, 75 / 255), - grDevices::rgb(252 / 255, 139 / 255, 58 / 255), - grDevices::rgb(248 / 255, 126 / 255, 44 / 255), - grDevices::rgb(243 / 255, 112 / 255, 29 / 255), - grDevices::rgb(237 / 255, 99 / 255, 16 / 255), - grDevices::rgb(228 / 255, 88 / 255, 8 / 255), - grDevices::rgb(219 / 255, 75 / 255, 2 / 255), - grDevices::rgb(196 / 255, 64 / 255, 2 / 255), - grDevices::rgb(167 / 255, 54 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "type" = "sequential" - ), - "BuGn" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(153 / 255, 216 / 255, 201 / 255)), - "2" = tibble::lst( - grDevices::rgb(229 / 255, 245 / 255, 249 / 255), - grDevices::rgb(44 / 255, 162 / 255, 95 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(229 / 255, 245 / 255, 249 / 255), - grDevices::rgb(153 / 255, 216 / 255, 201 / 255), - grDevices::rgb(44 / 255, 162 / 255, 95 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(178 / 255, 226 / 255, 226 / 255), - grDevices::rgb(102 / 255, 194 / 255, 164 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(178 / 255, 226 / 255, 226 / 255), - grDevices::rgb(102 / 255, 194 / 255, 164 / 255), - grDevices::rgb(44 / 255, 162 / 255, 95 / 255), - grDevices::rgb(0 / 255, 109 / 255, 44 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(204 / 255, 236 / 255, 230 / 255), - grDevices::rgb(153 / 255, 216 / 255, 201 / 255), - grDevices::rgb(102 / 255, 194 / 255, 164 / 255), - grDevices::rgb(44 / 255, 162 / 255, 95 / 255), - grDevices::rgb(0 / 255, 109 / 255, 44 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 251 / 255), - grDevices::rgb(204 / 255, 236 / 255, 230 / 255), - grDevices::rgb(153 / 255, 216 / 255, 201 / 255), - grDevices::rgb(102 / 255, 194 / 255, 164 / 255), - grDevices::rgb(65 / 255, 174 / 255, 118 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(229 / 255, 245 / 255, 249 / 255), - grDevices::rgb(204 / 255, 236 / 255, 230 / 255), - grDevices::rgb(153 / 255, 216 / 255, 201 / 255), - grDevices::rgb(102 / 255, 194 / 255, 164 / 255), - grDevices::rgb(65 / 255, 174 / 255, 118 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(229 / 255, 245 / 255, 249 / 255), - grDevices::rgb(204 / 255, 236 / 255, 230 / 255), - grDevices::rgb(153 / 255, 216 / 255, 201 / 255), - grDevices::rgb(102 / 255, 194 / 255, 164 / 255), - grDevices::rgb(65 / 255, 174 / 255, 118 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255), - grDevices::rgb(0 / 255, 109 / 255, 44 / 255), - grDevices::rgb(0 / 255, 68 / 255, 27 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(233 / 255, 246 / 255, 249 / 255), - grDevices::rgb(215 / 255, 240 / 255, 238 / 255), - grDevices::rgb(187 / 255, 229 / 255, 220 / 255), - grDevices::rgb(147 / 255, 213 / 255, 196 / 255), - grDevices::rgb(108 / 255, 196 / 255, 168 / 255), - grDevices::rgb(78 / 255, 180 / 255, 133 / 255), - grDevices::rgb(52 / 255, 158 / 255, 96 / 255), - grDevices::rgb(27 / 255, 127 / 255, 61 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(234 / 255, 247 / 255, 250 / 255), - grDevices::rgb(219 / 255, 241 / 255, 241 / 255), - grDevices::rgb(199 / 255, 234 / 255, 227 / 255), - grDevices::rgb(163 / 255, 220 / 255, 206 / 255), - grDevices::rgb(128 / 255, 205 / 255, 182 / 255), - grDevices::rgb(95 / 255, 190 / 255, 154 / 255), - grDevices::rgb(69 / 255, 176 / 255, 122 / 255), - grDevices::rgb(47 / 255, 152 / 255, 88 / 255), - grDevices::rgb(25 / 255, 123 / 255, 58 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(235 / 255, 247 / 255, 250 / 255), - grDevices::rgb(222 / 255, 242 / 255, 243 / 255), - grDevices::rgb(206 / 255, 236 / 255, 231 / 255), - grDevices::rgb(176 / 255, 225 / 255, 214 / 255), - grDevices::rgb(144 / 255, 212 / 255, 194 / 255), - grDevices::rgb(111 / 255, 198 / 255, 170 / 255), - grDevices::rgb(86 / 255, 184 / 255, 142 / 255), - grDevices::rgb(62 / 255, 170 / 255, 113 / 255), - grDevices::rgb(44 / 255, 148 / 255, 82 / 255), - grDevices::rgb(23 / 255, 119 / 255, 56 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(236 / 255, 247 / 255, 250 / 255), - grDevices::rgb(224 / 255, 243 / 255, 245 / 255), - grDevices::rgb(210 / 255, 238 / 255, 234 / 255), - grDevices::rgb(187 / 255, 229 / 255, 220 / 255), - grDevices::rgb(157 / 255, 217 / 255, 203 / 255), - grDevices::rgb(128 / 255, 205 / 255, 182 / 255), - grDevices::rgb(99 / 255, 192 / 255, 160 / 255), - grDevices::rgb(78 / 255, 180 / 255, 133 / 255), - grDevices::rgb(58 / 255, 165 / 255, 105 / 255), - grDevices::rgb(40 / 255, 144 / 255, 77 / 255), - grDevices::rgb(21 / 255, 117 / 255, 54 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(237 / 255, 248 / 255, 250 / 255), - grDevices::rgb(227 / 255, 244 / 255, 247 / 255), - grDevices::rgb(213 / 255, 239 / 255, 237 / 255), - grDevices::rgb(196 / 255, 232 / 255, 225 / 255), - grDevices::rgb(168 / 255, 222 / 255, 209 / 255), - grDevices::rgb(141 / 255, 210 / 255, 192 / 255), - grDevices::rgb(114 / 255, 199 / 255, 172 / 255), - grDevices::rgb(91 / 255, 187 / 255, 149 / 255), - grDevices::rgb(71 / 255, 177 / 255, 125 / 255), - grDevices::rgb(54 / 255, 160 / 255, 98 / 255), - grDevices::rgb(37 / 255, 141 / 255, 72 / 255), - grDevices::rgb(19 / 255, 114 / 255, 53 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(238 / 255, 248 / 255, 250 / 255), - grDevices::rgb(229 / 255, 244 / 255, 248 / 255), - grDevices::rgb(216 / 255, 240 / 255, 239 / 255), - grDevices::rgb(204 / 255, 235 / 255, 229 / 255), - grDevices::rgb(178 / 255, 226 / 255, 215 / 255), - grDevices::rgb(153 / 255, 216 / 255, 201 / 255), - grDevices::rgb(128 / 255, 205 / 255, 182 / 255), - grDevices::rgb(102 / 255, 193 / 255, 164 / 255), - grDevices::rgb(84 / 255, 184 / 255, 140 / 255), - grDevices::rgb(64 / 255, 173 / 255, 118 / 255), - grDevices::rgb(50 / 255, 156 / 255, 93 / 255), - grDevices::rgb(34 / 255, 139 / 255, 69 / 255), - grDevices::rgb(18 / 255, 112 / 255, 52 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(238 / 255, 248 / 255, 251 / 255), - grDevices::rgb(230 / 255, 245 / 255, 249 / 255), - grDevices::rgb(219 / 255, 241 / 255, 241 / 255), - grDevices::rgb(207 / 255, 237 / 255, 232 / 255), - grDevices::rgb(187 / 255, 229 / 255, 220 / 255), - grDevices::rgb(163 / 255, 220 / 255, 206 / 255), - grDevices::rgb(139 / 255, 210 / 255, 191 / 255), - grDevices::rgb(116 / 255, 199 / 255, 173 / 255), - grDevices::rgb(95 / 255, 190 / 255, 154 / 255), - grDevices::rgb(78 / 255, 180 / 255, 133 / 255), - grDevices::rgb(61 / 255, 169 / 255, 111 / 255), - grDevices::rgb(47 / 255, 152 / 255, 88 / 255), - grDevices::rgb(32 / 255, 135 / 255, 66 / 255), - grDevices::rgb(17 / 255, 111 / 255, 51 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(239 / 255, 248 / 255, 251 / 255), - grDevices::rgb(231 / 255, 245 / 255, 249 / 255), - grDevices::rgb(221 / 255, 242 / 255, 243 / 255), - grDevices::rgb(210 / 255, 238 / 255, 234 / 255), - grDevices::rgb(194 / 255, 232 / 255, 224 / 255), - grDevices::rgb(172 / 255, 223 / 255, 211 / 255), - grDevices::rgb(149 / 255, 214 / 255, 198 / 255), - grDevices::rgb(128 / 255, 205 / 255, 182 / 255), - grDevices::rgb(105 / 255, 195 / 255, 166 / 255), - grDevices::rgb(89 / 255, 186 / 255, 146 / 255), - grDevices::rgb(72 / 255, 177 / 255, 126 / 255), - grDevices::rgb(58 / 255, 165 / 255, 105 / 255), - grDevices::rgb(45 / 255, 149 / 255, 84 / 255), - grDevices::rgb(30 / 255, 132 / 255, 64 / 255), - grDevices::rgb(15 / 255, 109 / 255, 50 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(239 / 255, 249 / 255, 251 / 255), - grDevices::rgb(232 / 255, 246 / 255, 249 / 255), - grDevices::rgb(223 / 255, 242 / 255, 244 / 255), - grDevices::rgb(212 / 255, 239 / 255, 236 / 255), - grDevices::rgb(201 / 255, 234 / 255, 228 / 255), - grDevices::rgb(180 / 255, 226 / 255, 216 / 255), - grDevices::rgb(159 / 255, 218 / 255, 204 / 255), - grDevices::rgb(138 / 255, 209 / 255, 189 / 255), - grDevices::rgb(117 / 255, 200 / 255, 174 / 255), - grDevices::rgb(98 / 255, 191 / 255, 158 / 255), - grDevices::rgb(83 / 255, 183 / 255, 139 / 255), - grDevices::rgb(67 / 255, 175 / 255, 120 / 255), - grDevices::rgb(55 / 255, 161 / 255, 100 / 255), - grDevices::rgb(42 / 255, 147 / 255, 80 / 255), - grDevices::rgb(29 / 255, 129 / 255, 62 / 255), - grDevices::rgb(14 / 255, 108 / 255, 49 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(240 / 255, 249 / 255, 251 / 255), - grDevices::rgb(233 / 255, 246 / 255, 249 / 255), - grDevices::rgb(224 / 255, 243 / 255, 245 / 255), - grDevices::rgb(215 / 255, 240 / 255, 238 / 255), - grDevices::rgb(205 / 255, 236 / 255, 231 / 255), - grDevices::rgb(187 / 255, 229 / 255, 220 / 255), - grDevices::rgb(167 / 255, 221 / 255, 208 / 255), - grDevices::rgb(147 / 255, 213 / 255, 196 / 255), - grDevices::rgb(128 / 255, 205 / 255, 182 / 255), - grDevices::rgb(108 / 255, 196 / 255, 168 / 255), - grDevices::rgb(92 / 255, 188 / 255, 151 / 255), - grDevices::rgb(78 / 255, 180 / 255, 133 / 255), - grDevices::rgb(63 / 255, 172 / 255, 115 / 255), - grDevices::rgb(52 / 255, 158 / 255, 96 / 255), - grDevices::rgb(40 / 255, 144 / 255, 77 / 255), - grDevices::rgb(27 / 255, 127 / 255, 61 / 255), - grDevices::rgb(14 / 255, 107 / 255, 48 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 253 / 255), - grDevices::rgb(240 / 255, 249 / 255, 251 / 255), - grDevices::rgb(233 / 255, 246 / 255, 250 / 255), - grDevices::rgb(226 / 255, 244 / 255, 246 / 255), - grDevices::rgb(217 / 255, 240 / 255, 239 / 255), - grDevices::rgb(207 / 255, 237 / 255, 232 / 255), - grDevices::rgb(193 / 255, 231 / 255, 223 / 255), - grDevices::rgb(174 / 255, 224 / 255, 213 / 255), - grDevices::rgb(155 / 255, 217 / 255, 202 / 255), - grDevices::rgb(137 / 255, 209 / 255, 189 / 255), - grDevices::rgb(118 / 255, 200 / 255, 175 / 255), - grDevices::rgb(100 / 255, 192 / 255, 161 / 255), - grDevices::rgb(87 / 255, 185 / 255, 144 / 255), - grDevices::rgb(73 / 255, 178 / 255, 127 / 255), - grDevices::rgb(60 / 255, 168 / 255, 110 / 255), - grDevices::rgb(50 / 255, 155 / 255, 92 / 255), - grDevices::rgb(38 / 255, 142 / 255, 74 / 255), - grDevices::rgb(26 / 255, 125 / 255, 60 / 255), - grDevices::rgb(13 / 255, 106 / 255, 47 / 255), - grDevices::rgb(0 / 255, 88 / 255, 36 / 255) - ), - "type" = "sequential" - ), - "YlOrBr" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(217 / 255, 95 / 255, 14 / 255)), - "2" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 188 / 255), - grDevices::rgb(217 / 255, 95 / 255, 14 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 188 / 255), - grDevices::rgb(254 / 255, 196 / 255, 79 / 255), - grDevices::rgb(217 / 255, 95 / 255, 14 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 212 / 255), - grDevices::rgb(254 / 255, 217 / 255, 142 / 255), - grDevices::rgb(254 / 255, 153 / 255, 41 / 255), - grDevices::rgb(204 / 255, 76 / 255, 2 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 212 / 255), - grDevices::rgb(254 / 255, 217 / 255, 142 / 255), - grDevices::rgb(254 / 255, 153 / 255, 41 / 255), - grDevices::rgb(217 / 255, 95 / 255, 14 / 255), - grDevices::rgb(153 / 255, 52 / 255, 4 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 212 / 255), - grDevices::rgb(254 / 255, 227 / 255, 145 / 255), - grDevices::rgb(254 / 255, 196 / 255, 79 / 255), - grDevices::rgb(254 / 255, 153 / 255, 41 / 255), - grDevices::rgb(217 / 255, 95 / 255, 14 / 255), - grDevices::rgb(153 / 255, 52 / 255, 4 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 212 / 255), - grDevices::rgb(254 / 255, 227 / 255, 145 / 255), - grDevices::rgb(254 / 255, 196 / 255, 79 / 255), - grDevices::rgb(254 / 255, 153 / 255, 41 / 255), - grDevices::rgb(236 / 255, 112 / 255, 20 / 255), - grDevices::rgb(204 / 255, 76 / 255, 2 / 255), - grDevices::rgb(140 / 255, 45 / 255, 4 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 247 / 255, 188 / 255), - grDevices::rgb(254 / 255, 227 / 255, 145 / 255), - grDevices::rgb(254 / 255, 196 / 255, 79 / 255), - grDevices::rgb(254 / 255, 153 / 255, 41 / 255), - grDevices::rgb(236 / 255, 112 / 255, 20 / 255), - grDevices::rgb(204 / 255, 76 / 255, 2 / 255), - grDevices::rgb(140 / 255, 45 / 255, 4 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 247 / 255, 188 / 255), - grDevices::rgb(254 / 255, 227 / 255, 145 / 255), - grDevices::rgb(254 / 255, 196 / 255, 79 / 255), - grDevices::rgb(254 / 255, 153 / 255, 41 / 255), - grDevices::rgb(236 / 255, 112 / 255, 20 / 255), - grDevices::rgb(204 / 255, 76 / 255, 2 / 255), - grDevices::rgb(153 / 255, 52 / 255, 4 / 255), - grDevices::rgb(102 / 255, 37 / 255, 6 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 248 / 255, 197 / 255), - grDevices::rgb(254 / 255, 235 / 255, 164 / 255), - grDevices::rgb(254 / 255, 216 / 255, 123 / 255), - grDevices::rgb(254 / 255, 191 / 255, 74 / 255), - grDevices::rgb(254 / 255, 157 / 255, 45 / 255), - grDevices::rgb(242 / 255, 125 / 255, 27 / 255), - grDevices::rgb(221 / 255, 96 / 255, 11 / 255), - grDevices::rgb(189 / 255, 68 / 255, 2 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 249 / 255, 200 / 255), - grDevices::rgb(254 / 255, 238 / 255, 170 / 255), - grDevices::rgb(254 / 255, 223 / 255, 138 / 255), - grDevices::rgb(254 / 255, 202 / 255, 92 / 255), - grDevices::rgb(254 / 255, 174 / 255, 60 / 255), - grDevices::rgb(250 / 255, 144 / 255, 36 / 255), - grDevices::rgb(237 / 255, 116 / 255, 22 / 255), - grDevices::rgb(216 / 255, 90 / 255, 8 / 255), - grDevices::rgb(184 / 255, 66 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 249 / 255, 202 / 255), - grDevices::rgb(255 / 255, 241 / 255, 176 / 255), - grDevices::rgb(254 / 255, 228 / 255, 148 / 255), - grDevices::rgb(254 / 255, 210 / 255, 109 / 255), - grDevices::rgb(254 / 255, 188 / 255, 72 / 255), - grDevices::rgb(254 / 255, 161 / 255, 48 / 255), - grDevices::rgb(246 / 255, 134 / 255, 31 / 255), - grDevices::rgb(233 / 255, 108 / 255, 18 / 255), - grDevices::rgb(212 / 255, 85 / 255, 6 / 255), - grDevices::rgb(180 / 255, 64 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 250 / 255, 205 / 255), - grDevices::rgb(255 / 255, 243 / 255, 180 / 255), - grDevices::rgb(254 / 255, 231 / 255, 155 / 255), - grDevices::rgb(254 / 255, 216 / 255, 123 / 255), - grDevices::rgb(254 / 255, 198 / 255, 84 / 255), - grDevices::rgb(254 / 255, 174 / 255, 60 / 255), - grDevices::rgb(252 / 255, 149 / 255, 39 / 255), - grDevices::rgb(242 / 255, 125 / 255, 27 / 255), - grDevices::rgb(227 / 255, 103 / 255, 15 / 255), - grDevices::rgb(209 / 255, 82 / 255, 4 / 255), - grDevices::rgb(176 / 255, 62 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 250 / 255, 206 / 255), - grDevices::rgb(255 / 255, 245 / 255, 184 / 255), - grDevices::rgb(254 / 255, 234 / 255, 161 / 255), - grDevices::rgb(254 / 255, 222 / 255, 135 / 255), - grDevices::rgb(254 / 255, 205 / 255, 100 / 255), - grDevices::rgb(254 / 255, 186 / 255, 70 / 255), - grDevices::rgb(254 / 255, 163 / 255, 50 / 255), - grDevices::rgb(248 / 255, 140 / 255, 34 / 255), - grDevices::rgb(238 / 255, 118 / 255, 23 / 255), - grDevices::rgb(223 / 255, 98 / 255, 12 / 255), - grDevices::rgb(206 / 255, 78 / 255, 3 / 255), - grDevices::rgb(173 / 255, 61 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 250 / 255, 208 / 255), - grDevices::rgb(255 / 255, 247 / 255, 187 / 255), - grDevices::rgb(254 / 255, 236 / 255, 166 / 255), - grDevices::rgb(254 / 255, 227 / 255, 145 / 255), - grDevices::rgb(254 / 255, 211 / 255, 112 / 255), - grDevices::rgb(254 / 255, 196 / 255, 78 / 255), - grDevices::rgb(254 / 255, 174 / 255, 60 / 255), - grDevices::rgb(254 / 255, 153 / 255, 40 / 255), - grDevices::rgb(245 / 255, 132 / 255, 30 / 255), - grDevices::rgb(235 / 255, 112 / 255, 19 / 255), - grDevices::rgb(219 / 255, 94 / 255, 10 / 255), - grDevices::rgb(204 / 255, 76 / 255, 1 / 255), - grDevices::rgb(171 / 255, 60 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 251 / 255, 209 / 255), - grDevices::rgb(255 / 255, 247 / 255, 190 / 255), - grDevices::rgb(254 / 255, 238 / 255, 170 / 255), - grDevices::rgb(254 / 255, 229 / 255, 150 / 255), - grDevices::rgb(254 / 255, 216 / 255, 123 / 255), - grDevices::rgb(254 / 255, 202 / 255, 92 / 255), - grDevices::rgb(254 / 255, 184 / 255, 69 / 255), - grDevices::rgb(254 / 255, 164 / 255, 51 / 255), - grDevices::rgb(250 / 255, 144 / 255, 36 / 255), - grDevices::rgb(242 / 255, 125 / 255, 27 / 255), - grDevices::rgb(231 / 255, 107 / 255, 17 / 255), - grDevices::rgb(216 / 255, 90 / 255, 8 / 255), - grDevices::rgb(199 / 255, 73 / 255, 2 / 255), - grDevices::rgb(169 / 255, 59 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 251 / 255, 211 / 255), - grDevices::rgb(255 / 255, 247 / 255, 193 / 255), - grDevices::rgb(255 / 255, 240 / 255, 174 / 255), - grDevices::rgb(254 / 255, 231 / 255, 155 / 255), - grDevices::rgb(254 / 255, 221 / 255, 133 / 255), - grDevices::rgb(254 / 255, 207 / 255, 104 / 255), - grDevices::rgb(254 / 255, 193 / 255, 76 / 255), - grDevices::rgb(254 / 255, 174 / 255, 60 / 255), - grDevices::rgb(254 / 255, 155 / 255, 43 / 255), - grDevices::rgb(247 / 255, 137 / 255, 33 / 255), - grDevices::rgb(239 / 255, 119 / 255, 24 / 255), - grDevices::rgb(227 / 255, 103 / 255, 15 / 255), - grDevices::rgb(213 / 255, 87 / 255, 6 / 255), - grDevices::rgb(195 / 255, 72 / 255, 2 / 255), - grDevices::rgb(167 / 255, 58 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 251 / 255, 212 / 255), - grDevices::rgb(255 / 255, 248 / 255, 195 / 255), - grDevices::rgb(255 / 255, 242 / 255, 177 / 255), - grDevices::rgb(254 / 255, 234 / 255, 160 / 255), - grDevices::rgb(254 / 255, 225 / 255, 141 / 255), - grDevices::rgb(254 / 255, 212 / 255, 114 / 255), - grDevices::rgb(254 / 255, 199 / 255, 87 / 255), - grDevices::rgb(254 / 255, 183 / 255, 68 / 255), - grDevices::rgb(254 / 255, 165 / 255, 52 / 255), - grDevices::rgb(251 / 255, 148 / 255, 38 / 255), - grDevices::rgb(244 / 255, 131 / 255, 30 / 255), - grDevices::rgb(237 / 255, 114 / 255, 21 / 255), - grDevices::rgb(224 / 255, 99 / 255, 13 / 255), - grDevices::rgb(211 / 255, 84 / 255, 5 / 255), - grDevices::rgb(192 / 255, 70 / 255, 2 / 255), - grDevices::rgb(165 / 255, 57 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 251 / 255, 213 / 255), - grDevices::rgb(255 / 255, 248 / 255, 197 / 255), - grDevices::rgb(255 / 255, 243 / 255, 180 / 255), - grDevices::rgb(254 / 255, 235 / 255, 164 / 255), - grDevices::rgb(254 / 255, 228 / 255, 147 / 255), - grDevices::rgb(254 / 255, 216 / 255, 123 / 255), - grDevices::rgb(254 / 255, 204 / 255, 98 / 255), - grDevices::rgb(254 / 255, 191 / 255, 74 / 255), - grDevices::rgb(254 / 255, 174 / 255, 60 / 255), - grDevices::rgb(254 / 255, 157 / 255, 45 / 255), - grDevices::rgb(249 / 255, 141 / 255, 35 / 255), - grDevices::rgb(242 / 255, 125 / 255, 27 / 255), - grDevices::rgb(234 / 255, 110 / 255, 19 / 255), - grDevices::rgb(221 / 255, 96 / 255, 11 / 255), - grDevices::rgb(209 / 255, 82 / 255, 4 / 255), - grDevices::rgb(189 / 255, 68 / 255, 2 / 255), - grDevices::rgb(164 / 255, 56 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(255 / 255, 252 / 255, 213 / 255), - grDevices::rgb(255 / 255, 249 / 255, 198 / 255), - grDevices::rgb(255 / 255, 244 / 255, 183 / 255), - grDevices::rgb(254 / 255, 237 / 255, 167 / 255), - grDevices::rgb(254 / 255, 230 / 255, 151 / 255), - grDevices::rgb(254 / 255, 220 / 255, 131 / 255), - grDevices::rgb(254 / 255, 209 / 255, 107 / 255), - grDevices::rgb(254 / 255, 197 / 255, 82 / 255), - grDevices::rgb(254 / 255, 182 / 255, 67 / 255), - grDevices::rgb(254 / 255, 166 / 255, 53 / 255), - grDevices::rgb(253 / 255, 150 / 255, 39 / 255), - grDevices::rgb(246 / 255, 136 / 255, 32 / 255), - grDevices::rgb(239 / 255, 120 / 255, 24 / 255), - grDevices::rgb(230 / 255, 106 / 255, 17 / 255), - grDevices::rgb(219 / 255, 93 / 255, 10 / 255), - grDevices::rgb(207 / 255, 79 / 255, 3 / 255), - grDevices::rgb(186 / 255, 67 / 255, 2 / 255), - grDevices::rgb(163 / 255, 56 / 255, 3 / 255), - grDevices::rgb(140 / 255, 44 / 255, 4 / 255) - ), - "type" = "sequential" - ), - "YlGn" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(49 / 255, 163 / 255, 84 / 255)), - "2" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 185 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 185 / 255), - grDevices::rgb(173 / 255, 221 / 255, 142 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(194 / 255, 230 / 255, 153 / 255), - grDevices::rgb(120 / 255, 198 / 255, 121 / 255), - grDevices::rgb(35 / 255, 132 / 255, 67 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(194 / 255, 230 / 255, 153 / 255), - grDevices::rgb(120 / 255, 198 / 255, 121 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255), - grDevices::rgb(0 / 255, 104 / 255, 55 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(217 / 255, 240 / 255, 163 / 255), - grDevices::rgb(173 / 255, 221 / 255, 142 / 255), - grDevices::rgb(120 / 255, 198 / 255, 121 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255), - grDevices::rgb(0 / 255, 104 / 255, 55 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(217 / 255, 240 / 255, 163 / 255), - grDevices::rgb(173 / 255, 221 / 255, 142 / 255), - grDevices::rgb(120 / 255, 198 / 255, 121 / 255), - grDevices::rgb(65 / 255, 171 / 255, 93 / 255), - grDevices::rgb(35 / 255, 132 / 255, 67 / 255), - grDevices::rgb(0 / 255, 90 / 255, 50 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(247 / 255, 252 / 255, 185 / 255), - grDevices::rgb(217 / 255, 240 / 255, 163 / 255), - grDevices::rgb(173 / 255, 221 / 255, 142 / 255), - grDevices::rgb(120 / 255, 198 / 255, 121 / 255), - grDevices::rgb(65 / 255, 171 / 255, 93 / 255), - grDevices::rgb(35 / 255, 132 / 255, 67 / 255), - grDevices::rgb(0 / 255, 90 / 255, 50 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(247 / 255, 252 / 255, 185 / 255), - grDevices::rgb(217 / 255, 240 / 255, 163 / 255), - grDevices::rgb(173 / 255, 221 / 255, 142 / 255), - grDevices::rgb(120 / 255, 198 / 255, 121 / 255), - grDevices::rgb(65 / 255, 171 / 255, 93 / 255), - grDevices::rgb(35 / 255, 132 / 255, 67 / 255), - grDevices::rgb(0 / 255, 104 / 255, 55 / 255), - grDevices::rgb(0 / 255, 69 / 255, 41 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(248 / 255, 252 / 255, 194 / 255), - grDevices::rgb(230 / 255, 245 / 255, 172 / 255), - grDevices::rgb(202 / 255, 233 / 255, 155 / 255), - grDevices::rgb(167 / 255, 218 / 255, 139 / 255), - grDevices::rgb(126 / 255, 200 / 255, 123 / 255), - grDevices::rgb(84 / 255, 179 / 255, 102 / 255), - grDevices::rgb(51 / 255, 153 / 255, 81 / 255), - grDevices::rgb(28 / 255, 122 / 255, 63 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(249 / 255, 252 / 255, 198 / 255), - grDevices::rgb(235 / 255, 247 / 255, 176 / 255), - grDevices::rgb(212 / 255, 238 / 255, 160 / 255), - grDevices::rgb(181 / 255, 224 / 255, 146 / 255), - grDevices::rgb(147 / 255, 209 / 255, 131 / 255), - grDevices::rgb(109 / 255, 192 / 255, 115 / 255), - grDevices::rgb(71 / 255, 173 / 255, 95 / 255), - grDevices::rgb(47 / 255, 147 / 255, 77 / 255), - grDevices::rgb(25 / 255, 119 / 255, 61 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(250 / 255, 253 / 255, 201 / 255), - grDevices::rgb(238 / 255, 248 / 255, 178 / 255), - grDevices::rgb(219 / 255, 241 / 255, 164 / 255), - grDevices::rgb(193 / 255, 229 / 255, 151 / 255), - grDevices::rgb(163 / 255, 216 / 255, 138 / 255), - grDevices::rgb(130 / 255, 202 / 255, 124 / 255), - grDevices::rgb(96 / 255, 185 / 255, 108 / 255), - grDevices::rgb(62 / 255, 167 / 255, 90 / 255), - grDevices::rgb(43 / 255, 142 / 255, 73 / 255), - grDevices::rgb(23 / 255, 116 / 255, 60 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(250 / 255, 253 / 255, 203 / 255), - grDevices::rgb(242 / 255, 250 / 255, 181 / 255), - grDevices::rgb(224 / 255, 243 / 255, 168 / 255), - grDevices::rgb(202 / 255, 233 / 255, 155 / 255), - grDevices::rgb(176 / 255, 222 / 255, 143 / 255), - grDevices::rgb(147 / 255, 209 / 255, 131 / 255), - grDevices::rgb(115 / 255, 195 / 255, 118 / 255), - grDevices::rgb(84 / 255, 179 / 255, 102 / 255), - grDevices::rgb(57 / 255, 161 / 255, 86 / 255), - grDevices::rgb(40 / 255, 138 / 255, 71 / 255), - grDevices::rgb(21 / 255, 114 / 255, 59 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(251 / 255, 253 / 255, 205 / 255), - grDevices::rgb(244 / 255, 251 / 255, 183 / 255), - grDevices::rgb(228 / 255, 244 / 255, 171 / 255), - grDevices::rgb(210 / 255, 237 / 255, 159 / 255), - grDevices::rgb(186 / 255, 226 / 255, 148 / 255), - grDevices::rgb(161 / 255, 215 / 255, 137 / 255), - grDevices::rgb(132 / 255, 203 / 255, 125 / 255), - grDevices::rgb(104 / 255, 189 / 255, 112 / 255), - grDevices::rgb(74 / 255, 175 / 255, 97 / 255), - grDevices::rgb(53 / 255, 155 / 255, 82 / 255), - grDevices::rgb(37 / 255, 134 / 255, 68 / 255), - grDevices::rgb(20 / 255, 112 / 255, 59 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(251 / 255, 253 / 255, 207 / 255), - grDevices::rgb(247 / 255, 252 / 255, 184 / 255), - grDevices::rgb(232 / 255, 246 / 255, 173 / 255), - grDevices::rgb(216 / 255, 240 / 255, 163 / 255), - grDevices::rgb(195 / 255, 230 / 255, 152 / 255), - grDevices::rgb(172 / 255, 221 / 255, 141 / 255), - grDevices::rgb(147 / 255, 209 / 255, 131 / 255), - grDevices::rgb(120 / 255, 197 / 255, 121 / 255), - grDevices::rgb(94 / 255, 184 / 255, 106 / 255), - grDevices::rgb(64 / 255, 171 / 255, 93 / 255), - grDevices::rgb(50 / 255, 151 / 255, 79 / 255), - grDevices::rgb(34 / 255, 132 / 255, 67 / 255), - grDevices::rgb(19 / 255, 110 / 255, 58 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(251 / 255, 253 / 255, 208 / 255), - grDevices::rgb(247 / 255, 252 / 255, 187 / 255), - grDevices::rgb(235 / 255, 247 / 255, 176 / 255), - grDevices::rgb(221 / 255, 241 / 255, 165 / 255), - grDevices::rgb(202 / 255, 233 / 255, 155 / 255), - grDevices::rgb(181 / 255, 224 / 255, 146 / 255), - grDevices::rgb(159 / 255, 214 / 255, 136 / 255), - grDevices::rgb(134 / 255, 204 / 255, 126 / 255), - grDevices::rgb(109 / 255, 192 / 255, 115 / 255), - grDevices::rgb(84 / 255, 179 / 255, 102 / 255), - grDevices::rgb(61 / 255, 165 / 255, 89 / 255), - grDevices::rgb(47 / 255, 147 / 255, 77 / 255), - grDevices::rgb(32 / 255, 129 / 255, 65 / 255), - grDevices::rgb(17 / 255, 109 / 255, 57 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(251 / 255, 253 / 255, 209 / 255), - grDevices::rgb(248 / 255, 252 / 255, 190 / 255), - grDevices::rgb(237 / 255, 248 / 255, 178 / 255), - grDevices::rgb(224 / 255, 243 / 255, 168 / 255), - grDevices::rgb(208 / 255, 236 / 255, 159 / 255), - grDevices::rgb(189 / 255, 228 / 255, 149 / 255), - grDevices::rgb(169 / 255, 219 / 255, 140 / 255), - grDevices::rgb(147 / 255, 209 / 255, 131 / 255), - grDevices::rgb(123 / 255, 199 / 255, 122 / 255), - grDevices::rgb(100 / 255, 187 / 255, 110 / 255), - grDevices::rgb(76 / 255, 176 / 255, 98 / 255), - grDevices::rgb(57 / 255, 161 / 255, 86 / 255), - grDevices::rgb(44 / 255, 143 / 255, 74 / 255), - grDevices::rgb(31 / 255, 126 / 255, 64 / 255), - grDevices::rgb(16 / 255, 108 / 255, 57 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(252 / 255, 253 / 255, 210 / 255), - grDevices::rgb(248 / 255, 252 / 255, 192 / 255), - grDevices::rgb(239 / 255, 249 / 255, 179 / 255), - grDevices::rgb(227 / 255, 244 / 255, 170 / 255), - grDevices::rgb(214 / 255, 238 / 255, 161 / 255), - grDevices::rgb(196 / 255, 231 / 255, 153 / 255), - grDevices::rgb(178 / 255, 223 / 255, 144 / 255), - grDevices::rgb(157 / 255, 214 / 255, 135 / 255), - grDevices::rgb(136 / 255, 204 / 255, 127 / 255), - grDevices::rgb(114 / 255, 194 / 255, 117 / 255), - grDevices::rgb(92 / 255, 183 / 255, 106 / 255), - grDevices::rgb(68 / 255, 172 / 255, 94 / 255), - grDevices::rgb(54 / 255, 157 / 255, 83 / 255), - grDevices::rgb(42 / 255, 141 / 255, 72 / 255), - grDevices::rgb(29 / 255, 124 / 255, 63 / 255), - grDevices::rgb(15 / 255, 106 / 255, 56 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(252 / 255, 253 / 255, 211 / 255), - grDevices::rgb(248 / 255, 252 / 255, 194 / 255), - grDevices::rgb(242 / 255, 250 / 255, 181 / 255), - grDevices::rgb(230 / 255, 245 / 255, 172 / 255), - grDevices::rgb(218 / 255, 240 / 255, 164 / 255), - grDevices::rgb(202 / 255, 233 / 255, 155 / 255), - grDevices::rgb(185 / 255, 226 / 255, 147 / 255), - grDevices::rgb(167 / 255, 218 / 255, 139 / 255), - grDevices::rgb(147 / 255, 209 / 255, 131 / 255), - grDevices::rgb(126 / 255, 200 / 255, 123 / 255), - grDevices::rgb(105 / 255, 190 / 255, 113 / 255), - grDevices::rgb(84 / 255, 179 / 255, 102 / 255), - grDevices::rgb(63 / 255, 168 / 255, 91 / 255), - grDevices::rgb(51 / 255, 153 / 255, 81 / 255), - grDevices::rgb(40 / 255, 138 / 255, 71 / 255), - grDevices::rgb(28 / 255, 122 / 255, 63 / 255), - grDevices::rgb(15 / 255, 105 / 255, 56 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 229 / 255), - grDevices::rgb(252 / 255, 253 / 255, 212 / 255), - grDevices::rgb(249 / 255, 252 / 255, 196 / 255), - grDevices::rgb(243 / 255, 250 / 255, 182 / 255), - grDevices::rgb(232 / 255, 246 / 255, 174 / 255), - grDevices::rgb(221 / 255, 241 / 255, 166 / 255), - grDevices::rgb(207 / 255, 236 / 255, 158 / 255), - grDevices::rgb(191 / 255, 229 / 255, 150 / 255), - grDevices::rgb(175 / 255, 222 / 255, 143 / 255), - grDevices::rgb(156 / 255, 213 / 255, 135 / 255), - grDevices::rgb(137 / 255, 205 / 255, 127 / 255), - grDevices::rgb(117 / 255, 196 / 255, 119 / 255), - grDevices::rgb(98 / 255, 186 / 255, 109 / 255), - grDevices::rgb(77 / 255, 176 / 255, 98 / 255), - grDevices::rgb(60 / 255, 164 / 255, 88 / 255), - grDevices::rgb(49 / 255, 150 / 255, 79 / 255), - grDevices::rgb(38 / 255, 136 / 255, 69 / 255), - grDevices::rgb(26 / 255, 120 / 255, 62 / 255), - grDevices::rgb(14 / 255, 105 / 255, 56 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "type" = "sequential" - ), - "Reds" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(222 / 255, 45 / 255, 38 / 255)), - "2" = tibble::lst( - grDevices::rgb(254 / 255, 224 / 255, 210 / 255), - grDevices::rgb(222 / 255, 45 / 255, 38 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(254 / 255, 224 / 255, 210 / 255), - grDevices::rgb(252 / 255, 146 / 255, 114 / 255), - grDevices::rgb(222 / 255, 45 / 255, 38 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(254 / 255, 229 / 255, 217 / 255), - grDevices::rgb(252 / 255, 174 / 255, 145 / 255), - grDevices::rgb(251 / 255, 106 / 255, 74 / 255), - grDevices::rgb(203 / 255, 24 / 255, 29 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(254 / 255, 229 / 255, 217 / 255), - grDevices::rgb(252 / 255, 174 / 255, 145 / 255), - grDevices::rgb(251 / 255, 106 / 255, 74 / 255), - grDevices::rgb(222 / 255, 45 / 255, 38 / 255), - grDevices::rgb(165 / 255, 15 / 255, 21 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(254 / 255, 229 / 255, 217 / 255), - grDevices::rgb(252 / 255, 187 / 255, 161 / 255), - grDevices::rgb(252 / 255, 146 / 255, 114 / 255), - grDevices::rgb(251 / 255, 106 / 255, 74 / 255), - grDevices::rgb(222 / 255, 45 / 255, 38 / 255), - grDevices::rgb(165 / 255, 15 / 255, 21 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(254 / 255, 229 / 255, 217 / 255), - grDevices::rgb(252 / 255, 187 / 255, 161 / 255), - grDevices::rgb(252 / 255, 146 / 255, 114 / 255), - grDevices::rgb(251 / 255, 106 / 255, 74 / 255), - grDevices::rgb(239 / 255, 59 / 255, 44 / 255), - grDevices::rgb(203 / 255, 24 / 255, 29 / 255), - grDevices::rgb(153 / 255, 0 / 255, 13 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 245 / 255, 240 / 255), - grDevices::rgb(254 / 255, 224 / 255, 210 / 255), - grDevices::rgb(252 / 255, 187 / 255, 161 / 255), - grDevices::rgb(252 / 255, 146 / 255, 114 / 255), - grDevices::rgb(251 / 255, 106 / 255, 74 / 255), - grDevices::rgb(239 / 255, 59 / 255, 44 / 255), - grDevices::rgb(203 / 255, 24 / 255, 29 / 255), - grDevices::rgb(153 / 255, 0 / 255, 13 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 245 / 255, 240 / 255), - grDevices::rgb(254 / 255, 224 / 255, 210 / 255), - grDevices::rgb(252 / 255, 187 / 255, 161 / 255), - grDevices::rgb(252 / 255, 146 / 255, 114 / 255), - grDevices::rgb(251 / 255, 106 / 255, 74 / 255), - grDevices::rgb(239 / 255, 59 / 255, 44 / 255), - grDevices::rgb(203 / 255, 24 / 255, 29 / 255), - grDevices::rgb(165 / 255, 15 / 255, 21 / 255), - grDevices::rgb(103 / 255, 0 / 255, 13 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 228 / 255, 216 / 255), - grDevices::rgb(253 / 255, 203 / 255, 182 / 255), - grDevices::rgb(252 / 255, 173 / 255, 145 / 255), - grDevices::rgb(252 / 255, 141 / 255, 109 / 255), - grDevices::rgb(251 / 255, 110 / 255, 78 / 255), - grDevices::rgb(243 / 255, 76 / 255, 53 / 255), - grDevices::rgb(222 / 255, 45 / 255, 37 / 255), - grDevices::rgb(191 / 255, 18 / 255, 25 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 230 / 255, 218 / 255), - grDevices::rgb(253 / 255, 209 / 255, 190 / 255), - grDevices::rgb(252 / 255, 182 / 255, 156 / 255), - grDevices::rgb(252 / 255, 154 / 255, 123 / 255), - grDevices::rgb(252 / 255, 126 / 255, 93 / 255), - grDevices::rgb(248 / 255, 97 / 255, 67 / 255), - grDevices::rgb(240 / 255, 64 / 255, 46 / 255), - grDevices::rgb(217 / 255, 39 / 255, 34 / 255), - grDevices::rgb(187 / 255, 17 / 255, 24 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 231 / 255, 220 / 255), - grDevices::rgb(254 / 255, 213 / 255, 196 / 255), - grDevices::rgb(252 / 255, 190 / 255, 165 / 255), - grDevices::rgb(252 / 255, 164 / 255, 135 / 255), - grDevices::rgb(252 / 255, 139 / 255, 106 / 255), - grDevices::rgb(251 / 255, 113 / 255, 81 / 255), - grDevices::rgb(245 / 255, 86 / 255, 60 / 255), - grDevices::rgb(235 / 255, 56 / 255, 42 / 255), - grDevices::rgb(212 / 255, 35 / 255, 33 / 255), - grDevices::rgb(184 / 255, 15 / 255, 23 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 232 / 255, 222 / 255), - grDevices::rgb(254 / 255, 217 / 255, 201 / 255), - grDevices::rgb(253 / 255, 196 / 255, 173 / 255), - grDevices::rgb(252 / 255, 173 / 255, 145 / 255), - grDevices::rgb(252 / 255, 149 / 255, 117 / 255), - grDevices::rgb(252 / 255, 126 / 255, 93 / 255), - grDevices::rgb(250 / 255, 102 / 255, 71 / 255), - grDevices::rgb(243 / 255, 76 / 255, 53 / 255), - grDevices::rgb(229 / 255, 51 / 255, 40 / 255), - grDevices::rgb(208 / 255, 31 / 255, 31 / 255), - grDevices::rgb(181 / 255, 14 / 255, 22 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 233 / 255, 223 / 255), - grDevices::rgb(254 / 255, 221 / 255, 206 / 255), - grDevices::rgb(253 / 255, 201 / 255, 179 / 255), - grDevices::rgb(252 / 255, 180 / 255, 153 / 255), - grDevices::rgb(252 / 255, 158 / 255, 128 / 255), - grDevices::rgb(252 / 255, 137 / 255, 104 / 255), - grDevices::rgb(251 / 255, 115 / 255, 83 / 255), - grDevices::rgb(247 / 255, 93 / 255, 64 / 255), - grDevices::rgb(240 / 255, 67 / 255, 48 / 255), - grDevices::rgb(225 / 255, 46 / 255, 38 / 255), - grDevices::rgb(205 / 255, 27 / 255, 30 / 255), - grDevices::rgb(179 / 255, 13 / 255, 21 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 234 / 255, 224 / 255), - grDevices::rgb(254 / 255, 223 / 255, 210 / 255), - grDevices::rgb(253 / 255, 205 / 255, 185 / 255), - grDevices::rgb(252 / 255, 186 / 255, 160 / 255), - grDevices::rgb(252 / 255, 166 / 255, 137 / 255), - grDevices::rgb(252 / 255, 146 / 255, 114 / 255), - grDevices::rgb(252 / 255, 126 / 255, 93 / 255), - grDevices::rgb(250 / 255, 106 / 255, 74 / 255), - grDevices::rgb(245 / 255, 84 / 255, 58 / 255), - grDevices::rgb(238 / 255, 58 / 255, 44 / 255), - grDevices::rgb(220 / 255, 43 / 255, 36 / 255), - grDevices::rgb(203 / 255, 24 / 255, 29 / 255), - grDevices::rgb(177 / 255, 12 / 255, 20 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 235 / 255, 225 / 255), - grDevices::rgb(254 / 255, 225 / 255, 211 / 255), - grDevices::rgb(253 / 255, 209 / 255, 190 / 255), - grDevices::rgb(252 / 255, 191 / 255, 167 / 255), - grDevices::rgb(252 / 255, 173 / 255, 145 / 255), - grDevices::rgb(252 / 255, 154 / 255, 123 / 255), - grDevices::rgb(252 / 255, 135 / 255, 103 / 255), - grDevices::rgb(251 / 255, 117 / 255, 84 / 255), - grDevices::rgb(248 / 255, 97 / 255, 67 / 255), - grDevices::rgb(243 / 255, 76 / 255, 53 / 255), - grDevices::rgb(234 / 255, 54 / 255, 41 / 255), - grDevices::rgb(217 / 255, 39 / 255, 34 / 255), - grDevices::rgb(199 / 255, 22 / 255, 27 / 255), - grDevices::rgb(176 / 255, 11 / 255, 20 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 235 / 255, 226 / 255), - grDevices::rgb(254 / 255, 226 / 255, 213 / 255), - grDevices::rgb(253 / 255, 212 / 255, 194 / 255), - grDevices::rgb(253 / 255, 196 / 255, 173 / 255), - grDevices::rgb(252 / 255, 179 / 255, 152 / 255), - grDevices::rgb(252 / 255, 161 / 255, 131 / 255), - grDevices::rgb(252 / 255, 143 / 255, 111 / 255), - grDevices::rgb(252 / 255, 126 / 255, 93 / 255), - grDevices::rgb(251 / 255, 108 / 255, 76 / 255), - grDevices::rgb(246 / 255, 90 / 255, 62 / 255), - grDevices::rgb(241 / 255, 69 / 255, 49 / 255), - grDevices::rgb(229 / 255, 51 / 255, 40 / 255), - grDevices::rgb(214 / 255, 36 / 255, 33 / 255), - grDevices::rgb(196 / 255, 21 / 255, 26 / 255), - grDevices::rgb(174 / 255, 10 / 255, 19 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 236 / 255, 227 / 255), - grDevices::rgb(254 / 255, 227 / 255, 215 / 255), - grDevices::rgb(254 / 255, 215 / 255, 198 / 255), - grDevices::rgb(253 / 255, 200 / 255, 178 / 255), - grDevices::rgb(252 / 255, 184 / 255, 158 / 255), - grDevices::rgb(252 / 255, 167 / 255, 138 / 255), - grDevices::rgb(252 / 255, 150 / 255, 119 / 255), - grDevices::rgb(252 / 255, 134 / 255, 102 / 255), - grDevices::rgb(251 / 255, 118 / 255, 85 / 255), - grDevices::rgb(249 / 255, 101 / 255, 70 / 255), - grDevices::rgb(244 / 255, 83 / 255, 58 / 255), - grDevices::rgb(239 / 255, 62 / 255, 45 / 255), - grDevices::rgb(226 / 255, 47 / 255, 38 / 255), - grDevices::rgb(211 / 255, 33 / 255, 32 / 255), - grDevices::rgb(193 / 255, 20 / 255, 26 / 255), - grDevices::rgb(173 / 255, 9 / 255, 19 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 236 / 255, 228 / 255), - grDevices::rgb(254 / 255, 228 / 255, 216 / 255), - grDevices::rgb(254 / 255, 217 / 255, 201 / 255), - grDevices::rgb(253 / 255, 203 / 255, 182 / 255), - grDevices::rgb(252 / 255, 189 / 255, 163 / 255), - grDevices::rgb(252 / 255, 173 / 255, 145 / 255), - grDevices::rgb(252 / 255, 157 / 255, 126 / 255), - grDevices::rgb(252 / 255, 141 / 255, 109 / 255), - grDevices::rgb(252 / 255, 126 / 255, 93 / 255), - grDevices::rgb(251 / 255, 110 / 255, 78 / 255), - grDevices::rgb(247 / 255, 94 / 255, 65 / 255), - grDevices::rgb(243 / 255, 76 / 255, 53 / 255), - grDevices::rgb(236 / 255, 57 / 255, 43 / 255), - grDevices::rgb(222 / 255, 45 / 255, 37 / 255), - grDevices::rgb(208 / 255, 31 / 255, 31 / 255), - grDevices::rgb(191 / 255, 18 / 255, 25 / 255), - grDevices::rgb(172 / 255, 9 / 255, 19 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 244 / 255, 240 / 255), - grDevices::rgb(254 / 255, 237 / 255, 228 / 255), - grDevices::rgb(254 / 255, 229 / 255, 217 / 255), - grDevices::rgb(254 / 255, 220 / 255, 204 / 255), - grDevices::rgb(253 / 255, 206 / 255, 186 / 255), - grDevices::rgb(252 / 255, 192 / 255, 168 / 255), - grDevices::rgb(252 / 255, 178 / 255, 150 / 255), - grDevices::rgb(252 / 255, 163 / 255, 133 / 255), - grDevices::rgb(252 / 255, 148 / 255, 116 / 255), - grDevices::rgb(252 / 255, 133 / 255, 101 / 255), - grDevices::rgb(251 / 255, 119 / 255, 86 / 255), - grDevices::rgb(250 / 255, 103 / 255, 72 / 255), - grDevices::rgb(246 / 255, 88 / 255, 61 / 255), - grDevices::rgb(241 / 255, 70 / 255, 50 / 255), - grDevices::rgb(233 / 255, 54 / 255, 41 / 255), - grDevices::rgb(219 / 255, 42 / 255, 35 / 255), - grDevices::rgb(206 / 255, 28 / 255, 30 / 255), - grDevices::rgb(189 / 255, 17 / 255, 24 / 255), - grDevices::rgb(171 / 255, 8 / 255, 18 / 255), - grDevices::rgb(153 / 255, 0 / 255, 12 / 255) - ), - "type" = "sequential" - ), - "RdPu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(250 / 255, 159 / 255, 181 / 255)), - "2" = tibble::lst( - grDevices::rgb(253 / 255, 224 / 255, 221 / 255), - grDevices::rgb(197 / 255, 27 / 255, 138 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(253 / 255, 224 / 255, 221 / 255), - grDevices::rgb(250 / 255, 159 / 255, 181 / 255), - grDevices::rgb(197 / 255, 27 / 255, 138 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(254 / 255, 235 / 255, 226 / 255), - grDevices::rgb(251 / 255, 180 / 255, 185 / 255), - grDevices::rgb(247 / 255, 104 / 255, 161 / 255), - grDevices::rgb(174 / 255, 1 / 255, 126 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(254 / 255, 235 / 255, 226 / 255), - grDevices::rgb(251 / 255, 180 / 255, 185 / 255), - grDevices::rgb(247 / 255, 104 / 255, 161 / 255), - grDevices::rgb(197 / 255, 27 / 255, 138 / 255), - grDevices::rgb(122 / 255, 1 / 255, 119 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(254 / 255, 235 / 255, 226 / 255), - grDevices::rgb(252 / 255, 197 / 255, 192 / 255), - grDevices::rgb(250 / 255, 159 / 255, 181 / 255), - grDevices::rgb(247 / 255, 104 / 255, 161 / 255), - grDevices::rgb(197 / 255, 27 / 255, 138 / 255), - grDevices::rgb(122 / 255, 1 / 255, 119 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(254 / 255, 235 / 255, 226 / 255), - grDevices::rgb(252 / 255, 197 / 255, 192 / 255), - grDevices::rgb(250 / 255, 159 / 255, 181 / 255), - grDevices::rgb(247 / 255, 104 / 255, 161 / 255), - grDevices::rgb(221 / 255, 52 / 255, 151 / 255), - grDevices::rgb(174 / 255, 1 / 255, 126 / 255), - grDevices::rgb(122 / 255, 1 / 255, 119 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 243 / 255), - grDevices::rgb(253 / 255, 224 / 255, 221 / 255), - grDevices::rgb(252 / 255, 197 / 255, 192 / 255), - grDevices::rgb(250 / 255, 159 / 255, 181 / 255), - grDevices::rgb(247 / 255, 104 / 255, 161 / 255), - grDevices::rgb(221 / 255, 52 / 255, 151 / 255), - grDevices::rgb(174 / 255, 1 / 255, 126 / 255), - grDevices::rgb(122 / 255, 1 / 255, 119 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 243 / 255), - grDevices::rgb(253 / 255, 224 / 255, 221 / 255), - grDevices::rgb(252 / 255, 197 / 255, 192 / 255), - grDevices::rgb(250 / 255, 159 / 255, 181 / 255), - grDevices::rgb(247 / 255, 104 / 255, 161 / 255), - grDevices::rgb(221 / 255, 52 / 255, 151 / 255), - grDevices::rgb(174 / 255, 1 / 255, 126 / 255), - grDevices::rgb(122 / 255, 1 / 255, 119 / 255), - grDevices::rgb(73 / 255, 0 / 255, 106 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(253 / 255, 229 / 255, 225 / 255), - grDevices::rgb(252 / 255, 209 / 255, 204 / 255), - grDevices::rgb(251 / 255, 184 / 255, 188 / 255), - grDevices::rgb(249 / 255, 153 / 255, 178 / 255), - grDevices::rgb(247 / 255, 110 / 255, 163 / 255), - grDevices::rgb(229 / 255, 71 / 255, 154 / 255), - grDevices::rgb(199 / 255, 34 / 255, 139 / 255), - grDevices::rgb(162 / 255, 0 / 255, 124 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(253 / 255, 230 / 255, 227 / 255), - grDevices::rgb(252 / 255, 213 / 255, 209 / 255), - grDevices::rgb(251 / 255, 193 / 255, 190 / 255), - grDevices::rgb(250 / 255, 166 / 255, 183 / 255), - grDevices::rgb(249 / 255, 132 / 255, 170 / 255), - grDevices::rgb(241 / 255, 94 / 255, 159 / 255), - grDevices::rgb(223 / 255, 58 / 255, 152 / 255), - grDevices::rgb(192 / 255, 27 / 255, 135 / 255), - grDevices::rgb(158 / 255, 0 / 255, 123 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(253 / 255, 232 / 255, 228 / 255), - grDevices::rgb(252 / 255, 216 / 255, 213 / 255), - grDevices::rgb(252 / 255, 199 / 255, 194 / 255), - grDevices::rgb(251 / 255, 176 / 255, 186 / 255), - grDevices::rgb(249 / 255, 149 / 255, 177 / 255), - grDevices::rgb(247 / 255, 114 / 255, 164 / 255), - grDevices::rgb(235 / 255, 82 / 255, 156 / 255), - grDevices::rgb(216 / 255, 48 / 255, 148 / 255), - grDevices::rgb(186 / 255, 20 / 255, 132 / 255), - grDevices::rgb(155 / 255, 0 / 255, 123 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(253 / 255, 233 / 255, 230 / 255), - grDevices::rgb(252 / 255, 219 / 255, 216 / 255), - grDevices::rgb(252 / 255, 203 / 255, 199 / 255), - grDevices::rgb(251 / 255, 184 / 255, 188 / 255), - grDevices::rgb(250 / 255, 162 / 255, 181 / 255), - grDevices::rgb(249 / 255, 132 / 255, 170 / 255), - grDevices::rgb(244 / 255, 100 / 255, 160 / 255), - grDevices::rgb(229 / 255, 71 / 255, 154 / 255), - grDevices::rgb(209 / 255, 42 / 255, 144 / 255), - grDevices::rgb(181 / 255, 14 / 255, 130 / 255), - grDevices::rgb(152 / 255, 0 / 255, 123 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 234 / 255, 231 / 255), - grDevices::rgb(253 / 255, 221 / 255, 218 / 255), - grDevices::rgb(252 / 255, 207 / 255, 203 / 255), - grDevices::rgb(251 / 255, 191 / 255, 190 / 255), - grDevices::rgb(250 / 255, 170 / 255, 184 / 255), - grDevices::rgb(249 / 255, 147 / 255, 176 / 255), - grDevices::rgb(248 / 255, 117 / 255, 165 / 255), - grDevices::rgb(239 / 255, 89 / 255, 157 / 255), - grDevices::rgb(225 / 255, 61 / 255, 152 / 255), - grDevices::rgb(202 / 255, 36 / 255, 141 / 255), - grDevices::rgb(177 / 255, 6 / 255, 127 / 255), - grDevices::rgb(150 / 255, 0 / 255, 122 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 235 / 255, 231 / 255), - grDevices::rgb(253 / 255, 223 / 255, 221 / 255), - grDevices::rgb(252 / 255, 210 / 255, 206 / 255), - grDevices::rgb(252 / 255, 197 / 255, 191 / 255), - grDevices::rgb(251 / 255, 178 / 255, 186 / 255), - grDevices::rgb(249 / 255, 159 / 255, 180 / 255), - grDevices::rgb(249 / 255, 132 / 255, 170 / 255), - grDevices::rgb(247 / 255, 103 / 255, 160 / 255), - grDevices::rgb(234 / 255, 80 / 255, 156 / 255), - grDevices::rgb(221 / 255, 51 / 255, 151 / 255), - grDevices::rgb(197 / 255, 31 / 255, 138 / 255), - grDevices::rgb(173 / 255, 0 / 255, 126 / 255), - grDevices::rgb(148 / 255, 0 / 255, 122 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 236 / 255, 232 / 255), - grDevices::rgb(253 / 255, 225 / 255, 222 / 255), - grDevices::rgb(252 / 255, 213 / 255, 209 / 255), - grDevices::rgb(252 / 255, 200 / 255, 195 / 255), - grDevices::rgb(251 / 255, 184 / 255, 188 / 255), - grDevices::rgb(250 / 255, 166 / 255, 183 / 255), - grDevices::rgb(249 / 255, 145 / 255, 175 / 255), - grDevices::rgb(248 / 255, 119 / 255, 166 / 255), - grDevices::rgb(241 / 255, 94 / 255, 159 / 255), - grDevices::rgb(229 / 255, 71 / 255, 154 / 255), - grDevices::rgb(214 / 255, 46 / 255, 147 / 255), - grDevices::rgb(192 / 255, 27 / 255, 135 / 255), - grDevices::rgb(170 / 255, 0 / 255, 125 / 255), - grDevices::rgb(146 / 255, 0 / 255, 122 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 236 / 255, 233 / 255), - grDevices::rgb(253 / 255, 226 / 255, 223 / 255), - grDevices::rgb(252 / 255, 215 / 255, 211 / 255), - grDevices::rgb(252 / 255, 203 / 255, 199 / 255), - grDevices::rgb(251 / 255, 190 / 255, 189 / 255), - grDevices::rgb(251 / 255, 173 / 255, 185 / 255), - grDevices::rgb(249 / 255, 155 / 255, 179 / 255), - grDevices::rgb(249 / 255, 132 / 255, 170 / 255), - grDevices::rgb(247 / 255, 107 / 255, 162 / 255), - grDevices::rgb(237 / 255, 86 / 255, 157 / 255), - grDevices::rgb(225 / 255, 63 / 255, 152 / 255), - grDevices::rgb(209 / 255, 42 / 255, 144 / 255), - grDevices::rgb(188 / 255, 22 / 255, 133 / 255), - grDevices::rgb(167 / 255, 0 / 255, 125 / 255), - grDevices::rgb(144 / 255, 0 / 255, 122 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 237 / 255, 233 / 255), - grDevices::rgb(253 / 255, 228 / 255, 224 / 255), - grDevices::rgb(252 / 255, 217 / 255, 214 / 255), - grDevices::rgb(252 / 255, 206 / 255, 202 / 255), - grDevices::rgb(251 / 255, 194 / 255, 191 / 255), - grDevices::rgb(251 / 255, 179 / 255, 186 / 255), - grDevices::rgb(250 / 255, 163 / 255, 182 / 255), - grDevices::rgb(249 / 255, 143 / 255, 175 / 255), - grDevices::rgb(248 / 255, 121 / 255, 166 / 255), - grDevices::rgb(243 / 255, 98 / 255, 159 / 255), - grDevices::rgb(233 / 255, 78 / 255, 155 / 255), - grDevices::rgb(222 / 255, 55 / 255, 151 / 255), - grDevices::rgb(204 / 255, 38 / 255, 142 / 255), - grDevices::rgb(184 / 255, 18 / 255, 131 / 255), - grDevices::rgb(164 / 255, 0 / 255, 124 / 255), - grDevices::rgb(143 / 255, 0 / 255, 121 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 238 / 255, 234 / 255), - grDevices::rgb(253 / 255, 229 / 255, 225 / 255), - grDevices::rgb(252 / 255, 219 / 255, 216 / 255), - grDevices::rgb(252 / 255, 209 / 255, 204 / 255), - grDevices::rgb(252 / 255, 198 / 255, 193 / 255), - grDevices::rgb(251 / 255, 184 / 255, 188 / 255), - grDevices::rgb(250 / 255, 169 / 255, 184 / 255), - grDevices::rgb(249 / 255, 153 / 255, 178 / 255), - grDevices::rgb(249 / 255, 132 / 255, 170 / 255), - grDevices::rgb(247 / 255, 110 / 255, 163 / 255), - grDevices::rgb(239 / 255, 91 / 255, 158 / 255), - grDevices::rgb(229 / 255, 71 / 255, 154 / 255), - grDevices::rgb(218 / 255, 49 / 255, 149 / 255), - grDevices::rgb(199 / 255, 34 / 255, 139 / 255), - grDevices::rgb(181 / 255, 14 / 255, 130 / 255), - grDevices::rgb(162 / 255, 0 / 255, 124 / 255), - grDevices::rgb(142 / 255, 0 / 255, 121 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 242 / 255), - grDevices::rgb(254 / 255, 238 / 255, 234 / 255), - grDevices::rgb(253 / 255, 230 / 255, 226 / 255), - grDevices::rgb(253 / 255, 221 / 255, 217 / 255), - grDevices::rgb(252 / 255, 211 / 255, 207 / 255), - grDevices::rgb(252 / 255, 201 / 255, 196 / 255), - grDevices::rgb(251 / 255, 189 / 255, 189 / 255), - grDevices::rgb(251 / 255, 175 / 255, 185 / 255), - grDevices::rgb(250 / 255, 161 / 255, 181 / 255), - grDevices::rgb(249 / 255, 142 / 255, 174 / 255), - grDevices::rgb(248 / 255, 122 / 255, 167 / 255), - grDevices::rgb(245 / 255, 101 / 255, 160 / 255), - grDevices::rgb(236 / 255, 84 / 255, 156 / 255), - grDevices::rgb(226 / 255, 64 / 255, 153 / 255), - grDevices::rgb(213 / 255, 46 / 255, 147 / 255), - grDevices::rgb(196 / 255, 30 / 255, 137 / 255), - grDevices::rgb(178 / 255, 9 / 255, 128 / 255), - grDevices::rgb(160 / 255, 0 / 255, 124 / 255), - grDevices::rgb(141 / 255, 0 / 255, 121 / 255), - grDevices::rgb(121 / 255, 0 / 255, 119 / 255) - ), - "type" = "sequential" - ), - "Greens" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(161 / 255, 217 / 255, 155 / 255)), - "2" = tibble::lst( - grDevices::rgb(229 / 255, 245 / 255, 224 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(229 / 255, 245 / 255, 224 / 255), - grDevices::rgb(161 / 255, 217 / 255, 155 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 233 / 255), - grDevices::rgb(186 / 255, 228 / 255, 179 / 255), - grDevices::rgb(116 / 255, 196 / 255, 118 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 233 / 255), - grDevices::rgb(186 / 255, 228 / 255, 179 / 255), - grDevices::rgb(116 / 255, 196 / 255, 118 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255), - grDevices::rgb(0 / 255, 109 / 255, 44 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 233 / 255), - grDevices::rgb(199 / 255, 233 / 255, 192 / 255), - grDevices::rgb(161 / 255, 217 / 255, 155 / 255), - grDevices::rgb(116 / 255, 196 / 255, 118 / 255), - grDevices::rgb(49 / 255, 163 / 255, 84 / 255), - grDevices::rgb(0 / 255, 109 / 255, 44 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 233 / 255), - grDevices::rgb(199 / 255, 233 / 255, 192 / 255), - grDevices::rgb(161 / 255, 217 / 255, 155 / 255), - grDevices::rgb(116 / 255, 196 / 255, 118 / 255), - grDevices::rgb(65 / 255, 171 / 255, 93 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255), - grDevices::rgb(0 / 255, 90 / 255, 50 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 245 / 255), - grDevices::rgb(229 / 255, 245 / 255, 224 / 255), - grDevices::rgb(199 / 255, 233 / 255, 192 / 255), - grDevices::rgb(161 / 255, 217 / 255, 155 / 255), - grDevices::rgb(116 / 255, 196 / 255, 118 / 255), - grDevices::rgb(65 / 255, 171 / 255, 93 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255), - grDevices::rgb(0 / 255, 90 / 255, 50 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 245 / 255), - grDevices::rgb(229 / 255, 245 / 255, 224 / 255), - grDevices::rgb(199 / 255, 233 / 255, 192 / 255), - grDevices::rgb(161 / 255, 217 / 255, 155 / 255), - grDevices::rgb(116 / 255, 196 / 255, 118 / 255), - grDevices::rgb(65 / 255, 171 / 255, 93 / 255), - grDevices::rgb(35 / 255, 139 / 255, 69 / 255), - grDevices::rgb(0 / 255, 109 / 255, 44 / 255), - grDevices::rgb(0 / 255, 68 / 255, 27 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(233 / 255, 246 / 255, 228 / 255), - grDevices::rgb(212 / 255, 238 / 255, 206 / 255), - grDevices::rgb(186 / 255, 227 / 255, 179 / 255), - grDevices::rgb(156 / 255, 214 / 255, 150 / 255), - grDevices::rgb(121 / 255, 198 / 255, 122 / 255), - grDevices::rgb(83 / 255, 179 / 255, 101 / 255), - grDevices::rgb(52 / 255, 156 / 255, 82 / 255), - grDevices::rgb(28 / 255, 127 / 255, 64 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(234 / 255, 247 / 255, 230 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(195 / 255, 231 / 255, 188 / 255), - grDevices::rgb(168 / 255, 220 / 255, 162 / 255), - grDevices::rgb(138 / 255, 206 / 255, 136 / 255), - grDevices::rgb(106 / 255, 190 / 255, 112 / 255), - grDevices::rgb(70 / 255, 173 / 255, 95 / 255), - grDevices::rgb(47 / 255, 151 / 255, 78 / 255), - grDevices::rgb(25 / 255, 123 / 255, 63 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(235 / 255, 247 / 255, 231 / 255), - grDevices::rgb(220 / 255, 241 / 255, 215 / 255), - grDevices::rgb(201 / 255, 234 / 255, 194 / 255), - grDevices::rgb(178 / 255, 224 / 255, 171 / 255), - grDevices::rgb(153 / 255, 213 / 255, 148 / 255), - grDevices::rgb(124 / 255, 199 / 255, 124 / 255), - grDevices::rgb(94 / 255, 184 / 255, 106 / 255), - grDevices::rgb(62 / 255, 168 / 255, 90 / 255), - grDevices::rgb(43 / 255, 147 / 255, 75 / 255), - grDevices::rgb(23 / 255, 120 / 255, 62 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(236 / 255, 247 / 255, 232 / 255), - grDevices::rgb(224 / 255, 243 / 255, 218 / 255), - grDevices::rgb(206 / 255, 236 / 255, 199 / 255), - grDevices::rgb(186 / 255, 227 / 255, 179 / 255), - grDevices::rgb(164 / 255, 218 / 255, 158 / 255), - grDevices::rgb(138 / 255, 206 / 255, 136 / 255), - grDevices::rgb(112 / 255, 193 / 255, 115 / 255), - grDevices::rgb(83 / 255, 179 / 255, 101 / 255), - grDevices::rgb(57 / 255, 162 / 255, 86 / 255), - grDevices::rgb(40 / 255, 144 / 255, 72 / 255), - grDevices::rgb(21 / 255, 118 / 255, 61 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(237 / 255, 248 / 255, 233 / 255), - grDevices::rgb(226 / 255, 244 / 255, 221 / 255), - grDevices::rgb(210 / 255, 237 / 255, 204 / 255), - grDevices::rgb(193 / 255, 230 / 255, 186 / 255), - grDevices::rgb(172 / 255, 221 / 255, 166 / 255), - grDevices::rgb(150 / 255, 212 / 255, 146 / 255), - grDevices::rgb(126 / 255, 200 / 255, 126 / 255), - grDevices::rgb(101 / 255, 188 / 255, 110 / 255), - grDevices::rgb(73 / 255, 174 / 255, 96 / 255), - grDevices::rgb(53 / 255, 158 / 255, 83 / 255), - grDevices::rgb(37 / 255, 141 / 255, 70 / 255), - grDevices::rgb(20 / 255, 115 / 255, 60 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(238 / 255, 248 / 255, 234 / 255), - grDevices::rgb(229 / 255, 244 / 255, 223 / 255), - grDevices::rgb(214 / 255, 239 / 255, 207 / 255), - grDevices::rgb(198 / 255, 233 / 255, 191 / 255), - grDevices::rgb(180 / 255, 225 / 255, 173 / 255), - grDevices::rgb(160 / 255, 216 / 255, 154 / 255), - grDevices::rgb(138 / 255, 206 / 255, 136 / 255), - grDevices::rgb(115 / 255, 196 / 255, 118 / 255), - grDevices::rgb(91 / 255, 183 / 255, 105 / 255), - grDevices::rgb(64 / 255, 171 / 255, 93 / 255), - grDevices::rgb(50 / 255, 154 / 255, 80 / 255), - grDevices::rgb(34 / 255, 139 / 255, 69 / 255), - grDevices::rgb(18 / 255, 114 / 255, 59 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(238 / 255, 248 / 255, 235 / 255), - grDevices::rgb(230 / 255, 245 / 255, 225 / 255), - grDevices::rgb(217 / 255, 240 / 255, 211 / 255), - grDevices::rgb(203 / 255, 234 / 255, 196 / 255), - grDevices::rgb(186 / 255, 227 / 255, 179 / 255), - grDevices::rgb(168 / 255, 220 / 255, 162 / 255), - grDevices::rgb(149 / 255, 211 / 255, 145 / 255), - grDevices::rgb(128 / 255, 201 / 255, 127 / 255), - grDevices::rgb(106 / 255, 190 / 255, 112 / 255), - grDevices::rgb(83 / 255, 179 / 255, 101 / 255), - grDevices::rgb(61 / 255, 166 / 255, 89 / 255), - grDevices::rgb(47 / 255, 151 / 255, 78 / 255), - grDevices::rgb(32 / 255, 135 / 255, 67 / 255), - grDevices::rgb(17 / 255, 112 / 255, 58 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(239 / 255, 248 / 255, 235 / 255), - grDevices::rgb(231 / 255, 245 / 255, 226 / 255), - grDevices::rgb(219 / 255, 241 / 255, 213 / 255), - grDevices::rgb(206 / 255, 236 / 255, 199 / 255), - grDevices::rgb(191 / 255, 230 / 255, 185 / 255), - grDevices::rgb(175 / 255, 223 / 255, 168 / 255), - grDevices::rgb(158 / 255, 215 / 255, 152 / 255), - grDevices::rgb(138 / 255, 206 / 255, 136 / 255), - grDevices::rgb(118 / 255, 197 / 255, 120 / 255), - grDevices::rgb(98 / 255, 186 / 255, 108 / 255), - grDevices::rgb(75 / 255, 175 / 255, 97 / 255), - grDevices::rgb(57 / 255, 162 / 255, 86 / 255), - grDevices::rgb(44 / 255, 148 / 255, 76 / 255), - grDevices::rgb(31 / 255, 132 / 255, 66 / 255), - grDevices::rgb(16 / 255, 110 / 255, 58 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(239 / 255, 249 / 255, 236 / 255), - grDevices::rgb(232 / 255, 246 / 255, 227 / 255), - grDevices::rgb(221 / 255, 242 / 255, 216 / 255), - grDevices::rgb(209 / 255, 237 / 255, 203 / 255), - grDevices::rgb(196 / 255, 232 / 255, 189 / 255), - grDevices::rgb(181 / 255, 225 / 255, 174 / 255), - grDevices::rgb(165 / 255, 218 / 255, 159 / 255), - grDevices::rgb(148 / 255, 210 / 255, 144 / 255), - grDevices::rgb(129 / 255, 202 / 255, 128 / 255), - grDevices::rgb(110 / 255, 193 / 255, 115 / 255), - grDevices::rgb(90 / 255, 182 / 255, 104 / 255), - grDevices::rgb(68 / 255, 172 / 255, 94 / 255), - grDevices::rgb(54 / 255, 159 / 255, 84 / 255), - grDevices::rgb(42 / 255, 146 / 255, 74 / 255), - grDevices::rgb(29 / 255, 130 / 255, 65 / 255), - grDevices::rgb(15 / 255, 109 / 255, 57 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(240 / 255, 249 / 255, 236 / 255), - grDevices::rgb(233 / 255, 246 / 255, 228 / 255), - grDevices::rgb(224 / 255, 243 / 255, 218 / 255), - grDevices::rgb(212 / 255, 238 / 255, 206 / 255), - grDevices::rgb(200 / 255, 233 / 255, 193 / 255), - grDevices::rgb(186 / 255, 227 / 255, 179 / 255), - grDevices::rgb(171 / 255, 221 / 255, 165 / 255), - grDevices::rgb(156 / 255, 214 / 255, 150 / 255), - grDevices::rgb(138 / 255, 206 / 255, 136 / 255), - grDevices::rgb(121 / 255, 198 / 255, 122 / 255), - grDevices::rgb(102 / 255, 189 / 255, 110 / 255), - grDevices::rgb(83 / 255, 179 / 255, 101 / 255), - grDevices::rgb(63 / 255, 169 / 255, 91 / 255), - grDevices::rgb(52 / 255, 156 / 255, 82 / 255), - grDevices::rgb(40 / 255, 144 / 255, 72 / 255), - grDevices::rgb(28 / 255, 127 / 255, 64 / 255), - grDevices::rgb(14 / 255, 108 / 255, 57 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 244 / 255), - grDevices::rgb(240 / 255, 249 / 255, 237 / 255), - grDevices::rgb(233 / 255, 246 / 255, 229 / 255), - grDevices::rgb(225 / 255, 243 / 255, 220 / 255), - grDevices::rgb(214 / 255, 239 / 255, 208 / 255), - grDevices::rgb(203 / 255, 234 / 255, 197 / 255), - grDevices::rgb(191 / 255, 229 / 255, 184 / 255), - grDevices::rgb(177 / 255, 223 / 255, 170 / 255), - grDevices::rgb(163 / 255, 217 / 255, 156 / 255), - grDevices::rgb(147 / 255, 210 / 255, 143 / 255), - grDevices::rgb(130 / 255, 202 / 255, 129 / 255), - grDevices::rgb(113 / 255, 194 / 255, 116 / 255), - grDevices::rgb(95 / 255, 185 / 255, 107 / 255), - grDevices::rgb(76 / 255, 176 / 255, 98 / 255), - grDevices::rgb(60 / 255, 165 / 255, 89 / 255), - grDevices::rgb(49 / 255, 154 / 255, 80 / 255), - grDevices::rgb(38 / 255, 142 / 255, 71 / 255), - grDevices::rgb(26 / 255, 125 / 255, 63 / 255), - grDevices::rgb(13 / 255, 107 / 255, 56 / 255), - grDevices::rgb(0 / 255, 89 / 255, 50 / 255) - ), - "type" = "sequential" - ), - "YlGnBu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(127 / 255, 205 / 255, 187 / 255)), - "2" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 177 / 255), - grDevices::rgb(44 / 255, 127 / 255, 184 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(237 / 255, 248 / 255, 177 / 255), - grDevices::rgb(127 / 255, 205 / 255, 187 / 255), - grDevices::rgb(44 / 255, 127 / 255, 184 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(161 / 255, 218 / 255, 180 / 255), - grDevices::rgb(65 / 255, 182 / 255, 196 / 255), - grDevices::rgb(34 / 255, 94 / 255, 168 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(161 / 255, 218 / 255, 180 / 255), - grDevices::rgb(65 / 255, 182 / 255, 196 / 255), - grDevices::rgb(44 / 255, 127 / 255, 184 / 255), - grDevices::rgb(37 / 255, 52 / 255, 148 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(199 / 255, 233 / 255, 180 / 255), - grDevices::rgb(127 / 255, 205 / 255, 187 / 255), - grDevices::rgb(65 / 255, 182 / 255, 196 / 255), - grDevices::rgb(44 / 255, 127 / 255, 184 / 255), - grDevices::rgb(37 / 255, 52 / 255, 148 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(199 / 255, 233 / 255, 180 / 255), - grDevices::rgb(127 / 255, 205 / 255, 187 / 255), - grDevices::rgb(65 / 255, 182 / 255, 196 / 255), - grDevices::rgb(29 / 255, 145 / 255, 192 / 255), - grDevices::rgb(34 / 255, 94 / 255, 168 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 217 / 255), - grDevices::rgb(237 / 255, 248 / 255, 177 / 255), - grDevices::rgb(199 / 255, 233 / 255, 180 / 255), - grDevices::rgb(127 / 255, 205 / 255, 187 / 255), - grDevices::rgb(65 / 255, 182 / 255, 196 / 255), - grDevices::rgb(29 / 255, 145 / 255, 192 / 255), - grDevices::rgb(34 / 255, 94 / 255, 168 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 217 / 255), - grDevices::rgb(237 / 255, 248 / 255, 177 / 255), - grDevices::rgb(199 / 255, 233 / 255, 180 / 255), - grDevices::rgb(127 / 255, 205 / 255, 187 / 255), - grDevices::rgb(65 / 255, 182 / 255, 196 / 255), - grDevices::rgb(29 / 255, 145 / 255, 192 / 255), - grDevices::rgb(34 / 255, 94 / 255, 168 / 255), - grDevices::rgb(37 / 255, 52 / 255, 148 / 255), - grDevices::rgb(8 / 255, 29 / 255, 88 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(241 / 255, 249 / 255, 185 / 255), - grDevices::rgb(216 / 255, 239 / 255, 178 / 255), - grDevices::rgb(176 / 255, 223 / 255, 182 / 255), - grDevices::rgb(121 / 255, 202 / 255, 188 / 255), - grDevices::rgb(74 / 255, 184 / 255, 195 / 255), - grDevices::rgb(44 / 255, 157 / 255, 193 / 255), - grDevices::rgb(34 / 255, 122 / 255, 181 / 255), - grDevices::rgb(31 / 255, 82 / 255, 159 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(242 / 255, 250 / 255, 189 / 255), - grDevices::rgb(222 / 255, 242 / 255, 178 / 255), - grDevices::rgb(192 / 255, 230 / 255, 180 / 255), - grDevices::rgb(142 / 255, 210 / 255, 185 / 255), - grDevices::rgb(100 / 255, 193 / 255, 191 / 255), - grDevices::rgb(59 / 255, 174 / 255, 195 / 255), - grDevices::rgb(34 / 255, 148 / 255, 192 / 255), - grDevices::rgb(35 / 255, 114 / 255, 177 / 255), - grDevices::rgb(29 / 255, 78 / 255, 157 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(243 / 255, 250 / 255, 191 / 255), - grDevices::rgb(226 / 255, 243 / 255, 177 / 255), - grDevices::rgb(202 / 255, 234 / 255, 179 / 255), - grDevices::rgb(161 / 255, 217 / 255, 184 / 255), - grDevices::rgb(117 / 255, 200 / 255, 188 / 255), - grDevices::rgb(79 / 255, 186 / 255, 194 / 255), - grDevices::rgb(52 / 255, 164 / 255, 194 / 255), - grDevices::rgb(30 / 255, 140 / 255, 189 / 255), - grDevices::rgb(35 / 255, 107 / 255, 174 / 255), - grDevices::rgb(28 / 255, 75 / 255, 154 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(244 / 255, 250 / 255, 193 / 255), - grDevices::rgb(230 / 255, 245 / 255, 177 / 255), - grDevices::rgb(208 / 255, 236 / 255, 179 / 255), - grDevices::rgb(176 / 255, 223 / 255, 182 / 255), - grDevices::rgb(133 / 255, 207 / 255, 186 / 255), - grDevices::rgb(100 / 255, 193 / 255, 191 / 255), - grDevices::rgb(62 / 255, 178 / 255, 195 / 255), - grDevices::rgb(44 / 255, 157 / 255, 193 / 255), - grDevices::rgb(33 / 255, 132 / 255, 186 / 255), - grDevices::rgb(34 / 255, 102 / 255, 172 / 255), - grDevices::rgb(27 / 255, 72 / 255, 152 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(245 / 255, 251 / 255, 195 / 255), - grDevices::rgb(234 / 255, 246 / 255, 177 / 255), - grDevices::rgb(213 / 255, 238 / 255, 178 / 255), - grDevices::rgb(188 / 255, 228 / 255, 181 / 255), - grDevices::rgb(151 / 255, 213 / 255, 185 / 255), - grDevices::rgb(115 / 255, 199 / 255, 189 / 255), - grDevices::rgb(83 / 255, 187 / 255, 194 / 255), - grDevices::rgb(56 / 255, 170 / 255, 194 / 255), - grDevices::rgb(37 / 255, 150 / 255, 192 / 255), - grDevices::rgb(34 / 255, 125 / 255, 182 / 255), - grDevices::rgb(34 / 255, 97 / 255, 169 / 255), - grDevices::rgb(26 / 255, 70 / 255, 151 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(246 / 255, 251 / 255, 197 / 255), - grDevices::rgb(236 / 255, 248 / 255, 177 / 255), - grDevices::rgb(218 / 255, 240 / 255, 178 / 255), - grDevices::rgb(198 / 255, 233 / 255, 179 / 255), - grDevices::rgb(165 / 255, 218 / 255, 183 / 255), - grDevices::rgb(127 / 255, 204 / 255, 186 / 255), - grDevices::rgb(100 / 255, 193 / 255, 191 / 255), - grDevices::rgb(64 / 255, 182 / 255, 196 / 255), - grDevices::rgb(50 / 255, 163 / 255, 194 / 255), - grDevices::rgb(29 / 255, 145 / 255, 191 / 255), - grDevices::rgb(35 / 255, 119 / 255, 180 / 255), - grDevices::rgb(33 / 255, 94 / 255, 167 / 255), - grDevices::rgb(26 / 255, 68 / 255, 149 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(246 / 255, 251 / 255, 198 / 255), - grDevices::rgb(238 / 255, 248 / 255, 179 / 255), - grDevices::rgb(222 / 255, 242 / 255, 178 / 255), - grDevices::rgb(204 / 255, 235 / 255, 179 / 255), - grDevices::rgb(176 / 255, 223 / 255, 182 / 255), - grDevices::rgb(142 / 255, 210 / 255, 185 / 255), - grDevices::rgb(113 / 255, 198 / 255, 189 / 255), - grDevices::rgb(85 / 255, 188 / 255, 193 / 255), - grDevices::rgb(59 / 255, 174 / 255, 195 / 255), - grDevices::rgb(44 / 255, 157 / 255, 193 / 255), - grDevices::rgb(31 / 255, 138 / 255, 188 / 255), - grDevices::rgb(35 / 255, 114 / 255, 177 / 255), - grDevices::rgb(33 / 255, 90 / 255, 165 / 255), - grDevices::rgb(25 / 255, 67 / 255, 148 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(247 / 255, 251 / 255, 199 / 255), - grDevices::rgb(239 / 255, 248 / 255, 182 / 255), - grDevices::rgb(225 / 255, 243 / 255, 177 / 255), - grDevices::rgb(208 / 255, 236 / 255, 179 / 255), - grDevices::rgb(186 / 255, 227 / 255, 181 / 255), - grDevices::rgb(156 / 255, 215 / 255, 184 / 255), - grDevices::rgb(123 / 255, 203 / 255, 187 / 255), - grDevices::rgb(100 / 255, 193 / 255, 191 / 255), - grDevices::rgb(70 / 255, 183 / 255, 195 / 255), - grDevices::rgb(54 / 255, 167 / 255, 194 / 255), - grDevices::rgb(38 / 255, 151 / 255, 192 / 255), - grDevices::rgb(33 / 255, 132 / 255, 186 / 255), - grDevices::rgb(35 / 255, 109 / 255, 175 / 255), - grDevices::rgb(32 / 255, 87 / 255, 163 / 255), - grDevices::rgb(24 / 255, 65 / 255, 147 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(247 / 255, 252 / 255, 200 / 255), - grDevices::rgb(240 / 255, 249 / 255, 184 / 255), - grDevices::rgb(228 / 255, 244 / 255, 177 / 255), - grDevices::rgb(212 / 255, 238 / 255, 178 / 255), - grDevices::rgb(195 / 255, 231 / 255, 180 / 255), - grDevices::rgb(167 / 255, 219 / 255, 183 / 255), - grDevices::rgb(136 / 255, 208 / 255, 186 / 255), - grDevices::rgb(111 / 255, 198 / 255, 189 / 255), - grDevices::rgb(87 / 255, 188 / 255, 193 / 255), - grDevices::rgb(61 / 255, 177 / 255, 195 / 255), - grDevices::rgb(49 / 255, 162 / 255, 193 / 255), - grDevices::rgb(32 / 255, 147 / 255, 192 / 255), - grDevices::rgb(34 / 255, 126 / 255, 183 / 255), - grDevices::rgb(35 / 255, 105 / 255, 173 / 255), - grDevices::rgb(31 / 255, 85 / 255, 161 / 255), - grDevices::rgb(24 / 255, 64 / 255, 146 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(248 / 255, 252 / 255, 201 / 255), - grDevices::rgb(241 / 255, 249 / 255, 185 / 255), - grDevices::rgb(230 / 255, 245 / 255, 177 / 255), - grDevices::rgb(216 / 255, 239 / 255, 178 / 255), - grDevices::rgb(201 / 255, 233 / 255, 179 / 255), - grDevices::rgb(176 / 255, 223 / 255, 182 / 255), - grDevices::rgb(148 / 255, 212 / 255, 185 / 255), - grDevices::rgb(121 / 255, 202 / 255, 188 / 255), - grDevices::rgb(100 / 255, 193 / 255, 191 / 255), - grDevices::rgb(74 / 255, 184 / 255, 195 / 255), - grDevices::rgb(57 / 255, 171 / 255, 194 / 255), - grDevices::rgb(44 / 255, 157 / 255, 193 / 255), - grDevices::rgb(30 / 255, 142 / 255, 190 / 255), - grDevices::rgb(34 / 255, 122 / 255, 181 / 255), - grDevices::rgb(34 / 255, 102 / 255, 172 / 255), - grDevices::rgb(31 / 255, 82 / 255, 159 / 255), - grDevices::rgb(23 / 255, 63 / 255, 145 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 216 / 255), - grDevices::rgb(248 / 255, 252 / 255, 202 / 255), - grDevices::rgb(241 / 255, 249 / 255, 187 / 255), - grDevices::rgb(233 / 255, 246 / 255, 177 / 255), - grDevices::rgb(219 / 255, 240 / 255, 178 / 255), - grDevices::rgb(205 / 255, 235 / 255, 179 / 255), - grDevices::rgb(185 / 255, 227 / 255, 181 / 255), - grDevices::rgb(159 / 255, 216 / 255, 184 / 255), - grDevices::rgb(131 / 255, 206 / 255, 186 / 255), - grDevices::rgb(110 / 255, 197 / 255, 189 / 255), - grDevices::rgb(88 / 255, 189 / 255, 193 / 255), - grDevices::rgb(63 / 255, 180 / 255, 195 / 255), - grDevices::rgb(53 / 255, 166 / 255, 194 / 255), - grDevices::rgb(39 / 255, 152 / 255, 192 / 255), - grDevices::rgb(31 / 255, 136 / 255, 188 / 255), - grDevices::rgb(35 / 255, 117 / 255, 179 / 255), - grDevices::rgb(34 / 255, 99 / 255, 170 / 255), - grDevices::rgb(30 / 255, 80 / 255, 158 / 255), - grDevices::rgb(23 / 255, 62 / 255, 145 / 255), - grDevices::rgb(12 / 255, 44 / 255, 132 / 255) - ), - "type" = "sequential" - ), - "Purples" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(188 / 255, 189 / 255, 220 / 255)), - "2" = tibble::lst( - grDevices::rgb(239 / 255, 237 / 255, 245 / 255), - grDevices::rgb(117 / 255, 107 / 255, 177 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(239 / 255, 237 / 255, 245 / 255), - grDevices::rgb(188 / 255, 189 / 255, 220 / 255), - grDevices::rgb(117 / 255, 107 / 255, 177 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(242 / 255, 240 / 255, 247 / 255), - grDevices::rgb(203 / 255, 201 / 255, 226 / 255), - grDevices::rgb(158 / 255, 154 / 255, 200 / 255), - grDevices::rgb(106 / 255, 81 / 255, 163 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(242 / 255, 240 / 255, 247 / 255), - grDevices::rgb(203 / 255, 201 / 255, 226 / 255), - grDevices::rgb(158 / 255, 154 / 255, 200 / 255), - grDevices::rgb(117 / 255, 107 / 255, 177 / 255), - grDevices::rgb(84 / 255, 39 / 255, 143 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(242 / 255, 240 / 255, 247 / 255), - grDevices::rgb(218 / 255, 218 / 255, 235 / 255), - grDevices::rgb(188 / 255, 189 / 255, 220 / 255), - grDevices::rgb(158 / 255, 154 / 255, 200 / 255), - grDevices::rgb(117 / 255, 107 / 255, 177 / 255), - grDevices::rgb(84 / 255, 39 / 255, 143 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(242 / 255, 240 / 255, 247 / 255), - grDevices::rgb(218 / 255, 218 / 255, 235 / 255), - grDevices::rgb(188 / 255, 189 / 255, 220 / 255), - grDevices::rgb(158 / 255, 154 / 255, 200 / 255), - grDevices::rgb(128 / 255, 125 / 255, 186 / 255), - grDevices::rgb(106 / 255, 81 / 255, 163 / 255), - grDevices::rgb(74 / 255, 20 / 255, 134 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(252 / 255, 251 / 255, 253 / 255), - grDevices::rgb(239 / 255, 237 / 255, 245 / 255), - grDevices::rgb(218 / 255, 218 / 255, 235 / 255), - grDevices::rgb(188 / 255, 189 / 255, 220 / 255), - grDevices::rgb(158 / 255, 154 / 255, 200 / 255), - grDevices::rgb(128 / 255, 125 / 255, 186 / 255), - grDevices::rgb(106 / 255, 81 / 255, 163 / 255), - grDevices::rgb(74 / 255, 20 / 255, 134 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(252 / 255, 251 / 255, 253 / 255), - grDevices::rgb(239 / 255, 237 / 255, 245 / 255), - grDevices::rgb(218 / 255, 218 / 255, 235 / 255), - grDevices::rgb(188 / 255, 189 / 255, 220 / 255), - grDevices::rgb(158 / 255, 154 / 255, 200 / 255), - grDevices::rgb(128 / 255, 125 / 255, 186 / 255), - grDevices::rgb(106 / 255, 81 / 255, 163 / 255), - grDevices::rgb(84 / 255, 39 / 255, 143 / 255), - grDevices::rgb(63 / 255, 0 / 255, 125 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(241 / 255, 240 / 255, 246 / 255), - grDevices::rgb(227 / 255, 226 / 255, 239 / 255), - grDevices::rgb(207 / 255, 208 / 255, 229 / 255), - grDevices::rgb(184 / 255, 185 / 255, 217 / 255), - grDevices::rgb(161 / 255, 157 / 255, 202 / 255), - grDevices::rgb(138 / 255, 134 / 255, 190 / 255), - grDevices::rgb(118 / 255, 105 / 255, 175 / 255), - grDevices::rgb(99 / 255, 68 / 255, 156 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(242 / 255, 241 / 255, 247 / 255), - grDevices::rgb(230 / 255, 229 / 255, 241 / 255), - grDevices::rgb(214 / 255, 215 / 255, 233 / 255), - grDevices::rgb(193 / 255, 194 / 255, 223 / 255), - grDevices::rgb(172 / 255, 171 / 255, 209 / 255), - grDevices::rgb(152 / 255, 148 / 255, 197 / 255), - grDevices::rgb(131 / 255, 127 / 255, 187 / 255), - grDevices::rgb(115 / 255, 98 / 255, 172 / 255), - grDevices::rgb(97 / 255, 64 / 255, 154 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(243 / 255, 242 / 255, 247 / 255), - grDevices::rgb(233 / 255, 231 / 255, 242 / 255), - grDevices::rgb(219 / 255, 219 / 255, 235 / 255), - grDevices::rgb(201 / 255, 202 / 255, 226 / 255), - grDevices::rgb(182 / 255, 182 / 255, 216 / 255), - grDevices::rgb(163 / 255, 160 / 255, 203 / 255), - grDevices::rgb(144 / 255, 140 / 255, 193 / 255), - grDevices::rgb(126 / 255, 120 / 255, 183 / 255), - grDevices::rgb(112 / 255, 92 / 255, 169 / 255), - grDevices::rgb(95 / 255, 60 / 255, 152 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(244 / 255, 242 / 255, 248 / 255), - grDevices::rgb(235 / 255, 233 / 255, 243 / 255), - grDevices::rgb(223 / 255, 222 / 255, 237 / 255), - grDevices::rgb(207 / 255, 208 / 255, 229 / 255), - grDevices::rgb(190 / 255, 191 / 255, 221 / 255), - grDevices::rgb(172 / 255, 171 / 255, 209 / 255), - grDevices::rgb(155 / 255, 151 / 255, 198 / 255), - grDevices::rgb(138 / 255, 134 / 255, 190 / 255), - grDevices::rgb(122 / 255, 113 / 255, 180 / 255), - grDevices::rgb(109 / 255, 88 / 255, 166 / 255), - grDevices::rgb(93 / 255, 57 / 255, 150 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(244 / 255, 243 / 255, 248 / 255), - grDevices::rgb(237 / 255, 235 / 255, 244 / 255), - grDevices::rgb(226 / 255, 225 / 255, 238 / 255), - grDevices::rgb(213 / 255, 213 / 255, 232 / 255), - grDevices::rgb(197 / 255, 197 / 255, 224 / 255), - grDevices::rgb(181 / 255, 180 / 255, 215 / 255), - grDevices::rgb(164 / 255, 161 / 255, 204 / 255), - grDevices::rgb(148 / 255, 144 / 255, 195 / 255), - grDevices::rgb(132 / 255, 129 / 255, 188 / 255), - grDevices::rgb(119 / 255, 108 / 255, 177 / 255), - grDevices::rgb(107 / 255, 84 / 255, 164 / 255), - grDevices::rgb(91 / 255, 55 / 255, 149 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(245 / 255, 243 / 255, 248 / 255), - grDevices::rgb(238 / 255, 236 / 255, 244 / 255), - grDevices::rgb(228 / 255, 227 / 255, 239 / 255), - grDevices::rgb(217 / 255, 217 / 255, 235 / 255), - grDevices::rgb(202 / 255, 203 / 255, 227 / 255), - grDevices::rgb(187 / 255, 189 / 255, 220 / 255), - grDevices::rgb(172 / 255, 171 / 255, 209 / 255), - grDevices::rgb(158 / 255, 153 / 255, 199 / 255), - grDevices::rgb(143 / 255, 139 / 255, 193 / 255), - grDevices::rgb(127 / 255, 125 / 255, 185 / 255), - grDevices::rgb(117 / 255, 102 / 255, 174 / 255), - grDevices::rgb(106 / 255, 81 / 255, 163 / 255), - grDevices::rgb(90 / 255, 52 / 255, 148 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(245 / 255, 244 / 255, 249 / 255), - grDevices::rgb(239 / 255, 237 / 255, 245 / 255), - grDevices::rgb(230 / 255, 229 / 255, 241 / 255), - grDevices::rgb(220 / 255, 220 / 255, 236 / 255), - grDevices::rgb(207 / 255, 208 / 255, 229 / 255), - grDevices::rgb(193 / 255, 194 / 255, 223 / 255), - grDevices::rgb(179 / 255, 179 / 255, 214 / 255), - grDevices::rgb(165 / 255, 163 / 255, 205 / 255), - grDevices::rgb(152 / 255, 148 / 255, 197 / 255), - grDevices::rgb(138 / 255, 134 / 255, 190 / 255), - grDevices::rgb(125 / 255, 119 / 255, 182 / 255), - grDevices::rgb(115 / 255, 98 / 255, 172 / 255), - grDevices::rgb(104 / 255, 77 / 255, 161 / 255), - grDevices::rgb(89 / 255, 50 / 255, 147 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(246 / 255, 244 / 255, 249 / 255), - grDevices::rgb(240 / 255, 238 / 255, 245 / 255), - grDevices::rgb(232 / 255, 231 / 255, 241 / 255), - grDevices::rgb(223 / 255, 222 / 255, 237 / 255), - grDevices::rgb(212 / 255, 212 / 255, 232 / 255), - grDevices::rgb(199 / 255, 199 / 255, 225 / 255), - grDevices::rgb(186 / 255, 186 / 255, 218 / 255), - grDevices::rgb(172 / 255, 171 / 255, 209 / 255), - grDevices::rgb(159 / 255, 156 / 255, 201 / 255), - grDevices::rgb(146 / 255, 142 / 255, 194 / 255), - grDevices::rgb(133 / 255, 130 / 255, 188 / 255), - grDevices::rgb(122 / 255, 113 / 255, 180 / 255), - grDevices::rgb(113 / 255, 94 / 255, 170 / 255), - grDevices::rgb(102 / 255, 74 / 255, 159 / 255), - grDevices::rgb(88 / 255, 49 / 255, 146 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(246 / 255, 245 / 255, 249 / 255), - grDevices::rgb(241 / 255, 239 / 255, 246 / 255), - grDevices::rgb(234 / 255, 232 / 255, 242 / 255), - grDevices::rgb(225 / 255, 224 / 255, 238 / 255), - grDevices::rgb(216 / 255, 216 / 255, 234 / 255), - grDevices::rgb(203 / 255, 204 / 255, 227 / 255), - grDevices::rgb(191 / 255, 192 / 255, 221 / 255), - grDevices::rgb(179 / 255, 178 / 255, 214 / 255), - grDevices::rgb(166 / 255, 164 / 255, 205 / 255), - grDevices::rgb(154 / 255, 150 / 255, 198 / 255), - grDevices::rgb(142 / 255, 138 / 255, 192 / 255), - grDevices::rgb(129 / 255, 126 / 255, 186 / 255), - grDevices::rgb(120 / 255, 109 / 255, 177 / 255), - grDevices::rgb(111 / 255, 91 / 255, 168 / 255), - grDevices::rgb(100 / 255, 71 / 255, 157 / 255), - grDevices::rgb(87 / 255, 47 / 255, 145 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(246 / 255, 245 / 255, 249 / 255), - grDevices::rgb(241 / 255, 240 / 255, 246 / 255), - grDevices::rgb(235 / 255, 233 / 255, 243 / 255), - grDevices::rgb(227 / 255, 226 / 255, 239 / 255), - grDevices::rgb(219 / 255, 219 / 255, 235 / 255), - grDevices::rgb(207 / 255, 208 / 255, 229 / 255), - grDevices::rgb(196 / 255, 196 / 255, 224 / 255), - grDevices::rgb(184 / 255, 185 / 255, 217 / 255), - grDevices::rgb(172 / 255, 171 / 255, 209 / 255), - grDevices::rgb(161 / 255, 157 / 255, 202 / 255), - grDevices::rgb(149 / 255, 145 / 255, 196 / 255), - grDevices::rgb(138 / 255, 134 / 255, 190 / 255), - grDevices::rgb(126 / 255, 122 / 255, 184 / 255), - grDevices::rgb(118 / 255, 105 / 255, 175 / 255), - grDevices::rgb(109 / 255, 88 / 255, 166 / 255), - grDevices::rgb(99 / 255, 68 / 255, 156 / 255), - grDevices::rgb(87 / 255, 46 / 255, 145 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(252 / 255, 250 / 255, 253 / 255), - grDevices::rgb(247 / 255, 245 / 255, 250 / 255), - grDevices::rgb(242 / 255, 240 / 255, 247 / 255), - grDevices::rgb(236 / 255, 234 / 255, 243 / 255), - grDevices::rgb(229 / 255, 227 / 255, 240 / 255), - grDevices::rgb(221 / 255, 220 / 255, 236 / 255), - grDevices::rgb(211 / 255, 211 / 255, 231 / 255), - grDevices::rgb(200 / 255, 201 / 255, 226 / 255), - grDevices::rgb(189 / 255, 190 / 255, 220 / 255), - grDevices::rgb(178 / 255, 177 / 255, 213 / 255), - grDevices::rgb(167 / 255, 164 / 255, 206 / 255), - grDevices::rgb(156 / 255, 152 / 255, 199 / 255), - grDevices::rgb(145 / 255, 141 / 255, 194 / 255), - grDevices::rgb(134 / 255, 131 / 255, 188 / 255), - grDevices::rgb(124 / 255, 118 / 255, 182 / 255), - grDevices::rgb(116 / 255, 101 / 255, 173 / 255), - grDevices::rgb(108 / 255, 85 / 255, 165 / 255), - grDevices::rgb(98 / 255, 66 / 255, 155 / 255), - grDevices::rgb(86 / 255, 45 / 255, 144 / 255), - grDevices::rgb(74 / 255, 19 / 255, 133 / 255) - ), - "type" = "sequential" - ), - "GnBu" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(168 / 255, 221 / 255, 181 / 255)), - "2" = tibble::lst( - grDevices::rgb(224 / 255, 243 / 255, 219 / 255), - grDevices::rgb(67 / 255, 162 / 255, 202 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(224 / 255, 243 / 255, 219 / 255), - grDevices::rgb(168 / 255, 221 / 255, 181 / 255), - grDevices::rgb(67 / 255, 162 / 255, 202 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(240 / 255, 249 / 255, 232 / 255), - grDevices::rgb(186 / 255, 228 / 255, 188 / 255), - grDevices::rgb(123 / 255, 204 / 255, 196 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(240 / 255, 249 / 255, 232 / 255), - grDevices::rgb(186 / 255, 228 / 255, 188 / 255), - grDevices::rgb(123 / 255, 204 / 255, 196 / 255), - grDevices::rgb(67 / 255, 162 / 255, 202 / 255), - grDevices::rgb(8 / 255, 104 / 255, 172 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(240 / 255, 249 / 255, 232 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(168 / 255, 221 / 255, 181 / 255), - grDevices::rgb(123 / 255, 204 / 255, 196 / 255), - grDevices::rgb(67 / 255, 162 / 255, 202 / 255), - grDevices::rgb(8 / 255, 104 / 255, 172 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(240 / 255, 249 / 255, 232 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(168 / 255, 221 / 255, 181 / 255), - grDevices::rgb(123 / 255, 204 / 255, 196 / 255), - grDevices::rgb(78 / 255, 179 / 255, 211 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255), - grDevices::rgb(8 / 255, 88 / 255, 158 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(224 / 255, 243 / 255, 219 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(168 / 255, 221 / 255, 181 / 255), - grDevices::rgb(123 / 255, 204 / 255, 196 / 255), - grDevices::rgb(78 / 255, 179 / 255, 211 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255), - grDevices::rgb(8 / 255, 88 / 255, 158 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(224 / 255, 243 / 255, 219 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(168 / 255, 221 / 255, 181 / 255), - grDevices::rgb(123 / 255, 204 / 255, 196 / 255), - grDevices::rgb(78 / 255, 179 / 255, 211 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255), - grDevices::rgb(8 / 255, 104 / 255, 172 / 255), - grDevices::rgb(8 / 255, 64 / 255, 129 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(229 / 255, 245 / 255, 223 / 255), - grDevices::rgb(212 / 255, 238 / 255, 206 / 255), - grDevices::rgb(192 / 255, 230 / 255, 191 / 255), - grDevices::rgb(163 / 255, 219 / 255, 182 / 255), - grDevices::rgb(128 / 255, 205 / 255, 194 / 255), - grDevices::rgb(95 / 255, 187 / 255, 206 / 255), - grDevices::rgb(63 / 255, 161 / 255, 201 / 255), - grDevices::rgb(37 / 255, 128 / 255, 182 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(230 / 255, 245 / 255, 225 / 255), - grDevices::rgb(216 / 255, 239 / 255, 210 / 255), - grDevices::rgb(200 / 255, 233 / 255, 195 / 255), - grDevices::rgb(175 / 255, 223 / 255, 184 / 255), - grDevices::rgb(146 / 255, 212 / 255, 188 / 255), - grDevices::rgb(115 / 255, 198 / 255, 199 / 255), - grDevices::rgb(83 / 255, 181 / 255, 209 / 255), - grDevices::rgb(58 / 255, 155 / 255, 198 / 255), - grDevices::rgb(35 / 255, 124 / 255, 180 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(232 / 255, 246 / 255, 226 / 255), - grDevices::rgb(218 / 255, 240 / 255, 212 / 255), - grDevices::rgb(205 / 255, 235 / 255, 198 / 255), - grDevices::rgb(184 / 255, 227 / 255, 188 / 255), - grDevices::rgb(160 / 255, 217 / 255, 183 / 255), - grDevices::rgb(132 / 255, 207 / 255, 193 / 255), - grDevices::rgb(105 / 255, 192 / 255, 202 / 255), - grDevices::rgb(75 / 255, 175 / 255, 209 / 255), - grDevices::rgb(53 / 255, 150 / 255, 195 / 255), - grDevices::rgb(34 / 255, 120 / 255, 178 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(233 / 255, 246 / 255, 227 / 255), - grDevices::rgb(220 / 255, 241 / 255, 215 / 255), - grDevices::rgb(209 / 255, 237 / 255, 202 / 255), - grDevices::rgb(192 / 255, 230 / 255, 191 / 255), - grDevices::rgb(171 / 255, 222 / 255, 182 / 255), - grDevices::rgb(146 / 255, 212 / 255, 188 / 255), - grDevices::rgb(119 / 255, 201 / 255, 197 / 255), - grDevices::rgb(95 / 255, 187 / 255, 206 / 255), - grDevices::rgb(70 / 255, 169 / 255, 205 / 255), - grDevices::rgb(49 / 255, 146 / 255, 193 / 255), - grDevices::rgb(32 / 255, 117 / 255, 176 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(234 / 255, 247 / 255, 228 / 255), - grDevices::rgb(222 / 255, 242 / 255, 217 / 255), - grDevices::rgb(211 / 255, 238 / 255, 205 / 255), - grDevices::rgb(198 / 255, 232 / 255, 194 / 255), - grDevices::rgb(179 / 255, 225 / 255, 185 / 255), - grDevices::rgb(158 / 255, 217 / 255, 184 / 255), - grDevices::rgb(134 / 255, 207 / 255, 192 / 255), - grDevices::rgb(111 / 255, 196 / 255, 200 / 255), - grDevices::rgb(86 / 255, 182 / 255, 208 / 255), - grDevices::rgb(65 / 255, 163 / 255, 202 / 255), - grDevices::rgb(46 / 255, 142 / 255, 191 / 255), - grDevices::rgb(31 / 255, 115 / 255, 175 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(235 / 255, 247 / 255, 229 / 255), - grDevices::rgb(223 / 255, 242 / 255, 218 / 255), - grDevices::rgb(214 / 255, 239 / 255, 207 / 255), - grDevices::rgb(204 / 255, 235 / 255, 197 / 255), - grDevices::rgb(186 / 255, 228 / 255, 188 / 255), - grDevices::rgb(167 / 255, 221 / 255, 180 / 255), - grDevices::rgb(146 / 255, 212 / 255, 188 / 255), - grDevices::rgb(122 / 255, 204 / 255, 196 / 255), - grDevices::rgb(103 / 255, 191 / 255, 203 / 255), - grDevices::rgb(77 / 255, 178 / 255, 210 / 255), - grDevices::rgb(61 / 255, 159 / 255, 200 / 255), - grDevices::rgb(43 / 255, 140 / 255, 190 / 255), - grDevices::rgb(30 / 255, 113 / 255, 173 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(236 / 255, 247 / 255, 230 / 255), - grDevices::rgb(225 / 255, 243 / 255, 220 / 255), - grDevices::rgb(216 / 255, 239 / 255, 210 / 255), - grDevices::rgb(206 / 255, 236 / 255, 199 / 255), - grDevices::rgb(192 / 255, 230 / 255, 191 / 255), - grDevices::rgb(175 / 255, 223 / 255, 184 / 255), - grDevices::rgb(157 / 255, 216 / 255, 185 / 255), - grDevices::rgb(136 / 255, 208 / 255, 192 / 255), - grDevices::rgb(115 / 255, 198 / 255, 199 / 255), - grDevices::rgb(95 / 255, 187 / 255, 206 / 255), - grDevices::rgb(73 / 255, 173 / 255, 208 / 255), - grDevices::rgb(58 / 255, 155 / 255, 198 / 255), - grDevices::rgb(41 / 255, 136 / 255, 187 / 255), - grDevices::rgb(29 / 255, 111 / 255, 172 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(236 / 255, 248 / 255, 230 / 255), - grDevices::rgb(226 / 255, 244 / 255, 221 / 255), - grDevices::rgb(217 / 255, 240 / 255, 212 / 255), - grDevices::rgb(209 / 255, 237 / 255, 202 / 255), - grDevices::rgb(197 / 255, 232 / 255, 193 / 255), - grDevices::rgb(181 / 255, 226 / 255, 186 / 255), - grDevices::rgb(165 / 255, 219 / 255, 181 / 255), - grDevices::rgb(146 / 255, 212 / 255, 188 / 255), - grDevices::rgb(126 / 255, 205 / 255, 195 / 255), - grDevices::rgb(108 / 255, 194 / 255, 201 / 255), - grDevices::rgb(88 / 255, 183 / 255, 208 / 255), - grDevices::rgb(70 / 255, 169 / 255, 205 / 255), - grDevices::rgb(55 / 255, 151 / 255, 196 / 255), - grDevices::rgb(40 / 255, 133 / 255, 185 / 255), - grDevices::rgb(28 / 255, 110 / 255, 171 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(237 / 255, 248 / 255, 231 / 255), - grDevices::rgb(228 / 255, 244 / 255, 222 / 255), - grDevices::rgb(219 / 255, 241 / 255, 213 / 255), - grDevices::rgb(211 / 255, 237 / 255, 204 / 255), - grDevices::rgb(201 / 255, 234 / 255, 196 / 255), - grDevices::rgb(187 / 255, 228 / 255, 189 / 255), - grDevices::rgb(172 / 255, 222 / 255, 182 / 255), - grDevices::rgb(155 / 255, 215 / 255, 185 / 255), - grDevices::rgb(137 / 255, 208 / 255, 191 / 255), - grDevices::rgb(118 / 255, 201 / 255, 197 / 255), - grDevices::rgb(101 / 255, 190 / 255, 204 / 255), - grDevices::rgb(81 / 255, 180 / 255, 210 / 255), - grDevices::rgb(66 / 255, 165 / 255, 203 / 255), - grDevices::rgb(52 / 255, 149 / 255, 194 / 255), - grDevices::rgb(38 / 255, 130 / 255, 184 / 255), - grDevices::rgb(27 / 255, 108 / 255, 171 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(238 / 255, 248 / 255, 231 / 255), - grDevices::rgb(229 / 255, 245 / 255, 223 / 255), - grDevices::rgb(220 / 255, 241 / 255, 215 / 255), - grDevices::rgb(212 / 255, 238 / 255, 206 / 255), - grDevices::rgb(205 / 255, 235 / 255, 198 / 255), - grDevices::rgb(192 / 255, 230 / 255, 191 / 255), - grDevices::rgb(178 / 255, 224 / 255, 185 / 255), - grDevices::rgb(163 / 255, 219 / 255, 182 / 255), - grDevices::rgb(146 / 255, 212 / 255, 188 / 255), - grDevices::rgb(128 / 255, 205 / 255, 194 / 255), - grDevices::rgb(112 / 255, 196 / 255, 200 / 255), - grDevices::rgb(95 / 255, 187 / 255, 206 / 255), - grDevices::rgb(76 / 255, 176 / 255, 209 / 255), - grDevices::rgb(63 / 255, 161 / 255, 201 / 255), - grDevices::rgb(49 / 255, 146 / 255, 193 / 255), - grDevices::rgb(37 / 255, 128 / 255, 182 / 255), - grDevices::rgb(26 / 255, 107 / 255, 170 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(247 / 255, 252 / 255, 240 / 255), - grDevices::rgb(238 / 255, 248 / 255, 232 / 255), - grDevices::rgb(230 / 255, 245 / 255, 224 / 255), - grDevices::rgb(221 / 255, 242 / 255, 216 / 255), - grDevices::rgb(214 / 255, 239 / 255, 208 / 255), - grDevices::rgb(207 / 255, 236 / 255, 200 / 255), - grDevices::rgb(196 / 255, 232 / 255, 193 / 255), - grDevices::rgb(183 / 255, 226 / 255, 187 / 255), - grDevices::rgb(169 / 255, 221 / 255, 181 / 255), - grDevices::rgb(154 / 255, 215 / 255, 185 / 255), - grDevices::rgb(138 / 255, 209 / 255, 191 / 255), - grDevices::rgb(121 / 255, 202 / 255, 196 / 255), - grDevices::rgb(106 / 255, 193 / 255, 202 / 255), - grDevices::rgb(89 / 255, 184 / 255, 207 / 255), - grDevices::rgb(73 / 255, 172 / 255, 207 / 255), - grDevices::rgb(61 / 255, 158 / 255, 199 / 255), - grDevices::rgb(47 / 255, 144 / 255, 192 / 255), - grDevices::rgb(36 / 255, 125 / 255, 181 / 255), - grDevices::rgb(25 / 255, 106 / 255, 169 / 255), - grDevices::rgb(7 / 255, 88 / 255, 158 / 255) - ), - "type" = "sequential" - ), - "Greys" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(189 / 255, 189 / 255, 189 / 255)), - "2" = tibble::lst( - grDevices::rgb(240 / 255, 240 / 255, 240 / 255), - grDevices::rgb(99 / 255, 99 / 255, 99 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(240 / 255, 240 / 255, 240 / 255), - grDevices::rgb(189 / 255, 189 / 255, 189 / 255), - grDevices::rgb(99 / 255, 99 / 255, 99 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(204 / 255, 204 / 255, 204 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(82 / 255, 82 / 255, 82 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(204 / 255, 204 / 255, 204 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(99 / 255, 99 / 255, 99 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(189 / 255, 189 / 255, 189 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(99 / 255, 99 / 255, 99 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(189 / 255, 189 / 255, 189 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(115 / 255, 115 / 255, 115 / 255), - grDevices::rgb(82 / 255, 82 / 255, 82 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(240 / 255, 240 / 255, 240 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(189 / 255, 189 / 255, 189 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(115 / 255, 115 / 255, 115 / 255), - grDevices::rgb(82 / 255, 82 / 255, 82 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(240 / 255, 240 / 255, 240 / 255), - grDevices::rgb(217 / 255, 217 / 255, 217 / 255), - grDevices::rgb(189 / 255, 189 / 255, 189 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(115 / 255, 115 / 255, 115 / 255), - grDevices::rgb(82 / 255, 82 / 255, 82 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255), - grDevices::rgb(0 / 255, 0 / 255, 0 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(243 / 255, 243 / 255, 243 / 255), - grDevices::rgb(227 / 255, 227 / 255, 227 / 255), - grDevices::rgb(207 / 255, 207 / 255, 207 / 255), - grDevices::rgb(184 / 255, 184 / 255, 184 / 255), - grDevices::rgb(154 / 255, 154 / 255, 154 / 255), - grDevices::rgb(126 / 255, 126 / 255, 126 / 255), - grDevices::rgb(100 / 255, 100 / 255, 100 / 255), - grDevices::rgb(71 / 255, 71 / 255, 71 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(244 / 255, 244 / 255, 244 / 255), - grDevices::rgb(230 / 255, 230 / 255, 230 / 255), - grDevices::rgb(214 / 255, 214 / 255, 214 / 255), - grDevices::rgb(194 / 255, 194 / 255, 194 / 255), - grDevices::rgb(169 / 255, 169 / 255, 169 / 255), - grDevices::rgb(142 / 255, 142 / 255, 142 / 255), - grDevices::rgb(118 / 255, 118 / 255, 118 / 255), - grDevices::rgb(94 / 255, 94 / 255, 94 / 255), - grDevices::rgb(67 / 255, 67 / 255, 67 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(245 / 255, 245 / 255, 245 / 255), - grDevices::rgb(233 / 255, 233 / 255, 233 / 255), - grDevices::rgb(219 / 255, 219 / 255, 219 / 255), - grDevices::rgb(201 / 255, 201 / 255, 201 / 255), - grDevices::rgb(181 / 255, 181 / 255, 181 / 255), - grDevices::rgb(156 / 255, 156 / 255, 156 / 255), - grDevices::rgb(133 / 255, 133 / 255, 133 / 255), - grDevices::rgb(111 / 255, 111 / 255, 111 / 255), - grDevices::rgb(90 / 255, 90 / 255, 90 / 255), - grDevices::rgb(64 / 255, 64 / 255, 64 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(246 / 255, 246 / 255, 246 / 255), - grDevices::rgb(236 / 255, 236 / 255, 236 / 255), - grDevices::rgb(222 / 255, 222 / 255, 222 / 255), - grDevices::rgb(207 / 255, 207 / 255, 207 / 255), - grDevices::rgb(191 / 255, 191 / 255, 191 / 255), - grDevices::rgb(169 / 255, 169 / 255, 169 / 255), - grDevices::rgb(147 / 255, 147 / 255, 147 / 255), - grDevices::rgb(126 / 255, 126 / 255, 126 / 255), - grDevices::rgb(106 / 255, 106 / 255, 106 / 255), - grDevices::rgb(87 / 255, 87 / 255, 87 / 255), - grDevices::rgb(62 / 255, 62 / 255, 62 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(246 / 255, 246 / 255, 246 / 255), - grDevices::rgb(238 / 255, 238 / 255, 238 / 255), - grDevices::rgb(225 / 255, 225 / 255, 225 / 255), - grDevices::rgb(212 / 255, 212 / 255, 212 / 255), - grDevices::rgb(197 / 255, 197 / 255, 197 / 255), - grDevices::rgb(179 / 255, 179 / 255, 179 / 255), - grDevices::rgb(158 / 255, 158 / 255, 158 / 255), - grDevices::rgb(139 / 255, 139 / 255, 139 / 255), - grDevices::rgb(120 / 255, 120 / 255, 120 / 255), - grDevices::rgb(102 / 255, 102 / 255, 102 / 255), - grDevices::rgb(84 / 255, 84 / 255, 84 / 255), - grDevices::rgb(60 / 255, 60 / 255, 60 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(240 / 255, 240 / 255, 240 / 255), - grDevices::rgb(228 / 255, 228 / 255, 228 / 255), - grDevices::rgb(216 / 255, 216 / 255, 216 / 255), - grDevices::rgb(202 / 255, 202 / 255, 202 / 255), - grDevices::rgb(189 / 255, 189 / 255, 189 / 255), - grDevices::rgb(169 / 255, 169 / 255, 169 / 255), - grDevices::rgb(150 / 255, 150 / 255, 150 / 255), - grDevices::rgb(132 / 255, 132 / 255, 132 / 255), - grDevices::rgb(114 / 255, 114 / 255, 114 / 255), - grDevices::rgb(98 / 255, 98 / 255, 98 / 255), - grDevices::rgb(82 / 255, 82 / 255, 82 / 255), - grDevices::rgb(58 / 255, 58 / 255, 58 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(247 / 255, 247 / 255, 247 / 255), - grDevices::rgb(240 / 255, 240 / 255, 240 / 255), - grDevices::rgb(230 / 255, 230 / 255, 230 / 255), - grDevices::rgb(220 / 255, 220 / 255, 220 / 255), - grDevices::rgb(207 / 255, 207 / 255, 207 / 255), - grDevices::rgb(194 / 255, 194 / 255, 194 / 255), - grDevices::rgb(178 / 255, 178 / 255, 178 / 255), - grDevices::rgb(160 / 255, 160 / 255, 160 / 255), - grDevices::rgb(142 / 255, 142 / 255, 142 / 255), - grDevices::rgb(126 / 255, 126 / 255, 126 / 255), - grDevices::rgb(110 / 255, 110 / 255, 110 / 255), - grDevices::rgb(94 / 255, 94 / 255, 94 / 255), - grDevices::rgb(78 / 255, 78 / 255, 78 / 255), - grDevices::rgb(57 / 255, 57 / 255, 57 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(248 / 255, 248 / 255, 248 / 255), - grDevices::rgb(241 / 255, 241 / 255, 241 / 255), - grDevices::rgb(232 / 255, 232 / 255, 232 / 255), - grDevices::rgb(222 / 255, 222 / 255, 222 / 255), - grDevices::rgb(211 / 255, 211 / 255, 211 / 255), - grDevices::rgb(199 / 255, 199 / 255, 199 / 255), - grDevices::rgb(186 / 255, 186 / 255, 186 / 255), - grDevices::rgb(169 / 255, 169 / 255, 169 / 255), - grDevices::rgb(152 / 255, 152 / 255, 152 / 255), - grDevices::rgb(136 / 255, 136 / 255, 136 / 255), - grDevices::rgb(121 / 255, 121 / 255, 121 / 255), - grDevices::rgb(106 / 255, 106 / 255, 106 / 255), - grDevices::rgb(92 / 255, 92 / 255, 92 / 255), - grDevices::rgb(76 / 255, 76 / 255, 76 / 255), - grDevices::rgb(55 / 255, 55 / 255, 55 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(248 / 255, 248 / 255, 248 / 255), - grDevices::rgb(242 / 255, 242 / 255, 242 / 255), - grDevices::rgb(234 / 255, 234 / 255, 234 / 255), - grDevices::rgb(225 / 255, 225 / 255, 225 / 255), - grDevices::rgb(215 / 255, 215 / 255, 215 / 255), - grDevices::rgb(203 / 255, 203 / 255, 203 / 255), - grDevices::rgb(192 / 255, 192 / 255, 192 / 255), - grDevices::rgb(177 / 255, 177 / 255, 177 / 255), - grDevices::rgb(161 / 255, 161 / 255, 161 / 255), - grDevices::rgb(145 / 255, 145 / 255, 145 / 255), - grDevices::rgb(131 / 255, 131 / 255, 131 / 255), - grDevices::rgb(117 / 255, 117 / 255, 117 / 255), - grDevices::rgb(103 / 255, 103 / 255, 103 / 255), - grDevices::rgb(89 / 255, 89 / 255, 89 / 255), - grDevices::rgb(73 / 255, 73 / 255, 73 / 255), - grDevices::rgb(54 / 255, 54 / 255, 54 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(249 / 255, 249 / 255, 249 / 255), - grDevices::rgb(243 / 255, 243 / 255, 243 / 255), - grDevices::rgb(236 / 255, 236 / 255, 236 / 255), - grDevices::rgb(227 / 255, 227 / 255, 227 / 255), - grDevices::rgb(218 / 255, 218 / 255, 218 / 255), - grDevices::rgb(207 / 255, 207 / 255, 207 / 255), - grDevices::rgb(196 / 255, 196 / 255, 196 / 255), - grDevices::rgb(184 / 255, 184 / 255, 184 / 255), - grDevices::rgb(169 / 255, 169 / 255, 169 / 255), - grDevices::rgb(154 / 255, 154 / 255, 154 / 255), - grDevices::rgb(140 / 255, 140 / 255, 140 / 255), - grDevices::rgb(126 / 255, 126 / 255, 126 / 255), - grDevices::rgb(113 / 255, 113 / 255, 113 / 255), - grDevices::rgb(100 / 255, 100 / 255, 100 / 255), - grDevices::rgb(87 / 255, 87 / 255, 87 / 255), - grDevices::rgb(71 / 255, 71 / 255, 71 / 255), - grDevices::rgb(53 / 255, 53 / 255, 53 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 255 / 255), - grDevices::rgb(249 / 255, 249 / 255, 249 / 255), - grDevices::rgb(243 / 255, 243 / 255, 243 / 255), - grDevices::rgb(237 / 255, 237 / 255, 237 / 255), - grDevices::rgb(229 / 255, 229 / 255, 229 / 255), - grDevices::rgb(220 / 255, 220 / 255, 220 / 255), - grDevices::rgb(211 / 255, 211 / 255, 211 / 255), - grDevices::rgb(200 / 255, 200 / 255, 200 / 255), - grDevices::rgb(190 / 255, 190 / 255, 190 / 255), - grDevices::rgb(176 / 255, 176 / 255, 176 / 255), - grDevices::rgb(162 / 255, 162 / 255, 162 / 255), - grDevices::rgb(148 / 255, 148 / 255, 148 / 255), - grDevices::rgb(135 / 255, 135 / 255, 135 / 255), - grDevices::rgb(122 / 255, 122 / 255, 122 / 255), - grDevices::rgb(109 / 255, 109 / 255, 109 / 255), - grDevices::rgb(97 / 255, 97 / 255, 97 / 255), - grDevices::rgb(85 / 255, 85 / 255, 85 / 255), - grDevices::rgb(69 / 255, 69 / 255, 69 / 255), - grDevices::rgb(52 / 255, 52 / 255, 52 / 255), - grDevices::rgb(37 / 255, 37 / 255, 37 / 255) - ), - "type" = "sequential" - ), - "YlOrRd" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(254 / 255, 178 / 255, 76 / 255)), - "2" = tibble::lst( - grDevices::rgb(255 / 255, 237 / 255, 160 / 255), - grDevices::rgb(240 / 255, 59 / 255, 32 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(255 / 255, 237 / 255, 160 / 255), - grDevices::rgb(254 / 255, 178 / 255, 76 / 255), - grDevices::rgb(240 / 255, 59 / 255, 32 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 178 / 255), - grDevices::rgb(254 / 255, 204 / 255, 92 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 178 / 255), - grDevices::rgb(254 / 255, 204 / 255, 92 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(240 / 255, 59 / 255, 32 / 255), - grDevices::rgb(189 / 255, 0 / 255, 38 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 178 / 255), - grDevices::rgb(254 / 255, 217 / 255, 118 / 255), - grDevices::rgb(254 / 255, 178 / 255, 76 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(240 / 255, 59 / 255, 32 / 255), - grDevices::rgb(189 / 255, 0 / 255, 38 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 178 / 255), - grDevices::rgb(254 / 255, 217 / 255, 118 / 255), - grDevices::rgb(254 / 255, 178 / 255, 76 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(252 / 255, 78 / 255, 42 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 237 / 255, 160 / 255), - grDevices::rgb(254 / 255, 217 / 255, 118 / 255), - grDevices::rgb(254 / 255, 178 / 255, 76 / 255), - grDevices::rgb(253 / 255, 141 / 255, 60 / 255), - grDevices::rgb(252 / 255, 78 / 255, 42 / 255), - grDevices::rgb(227 / 255, 26 / 255, 28 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 239 / 255, 165 / 255), - grDevices::rgb(254 / 255, 221 / 255, 128 / 255), - grDevices::rgb(254 / 255, 192 / 255, 91 / 255), - grDevices::rgb(253 / 255, 159 / 255, 67 / 255), - grDevices::rgb(253 / 255, 119 / 255, 52 / 255), - grDevices::rgb(245 / 255, 67 / 255, 38 / 255), - grDevices::rgb(220 / 255, 23 / 255, 29 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 240 / 255, 169 / 255), - grDevices::rgb(254 / 255, 225 / 255, 136 / 255), - grDevices::rgb(254 / 255, 204 / 255, 104 / 255), - grDevices::rgb(254 / 255, 174 / 255, 74 / 255), - grDevices::rgb(253 / 255, 145 / 255, 61 / 255), - grDevices::rgb(252 / 255, 101 / 255, 47 / 255), - grDevices::rgb(240 / 255, 58 / 255, 35 / 255), - grDevices::rgb(215 / 255, 20 / 255, 30 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 242 / 255, 173 / 255), - grDevices::rgb(254 / 255, 228 / 255, 143 / 255), - grDevices::rgb(254 / 255, 213 / 255, 113 / 255), - grDevices::rgb(254 / 255, 185 / 255, 84 / 255), - grDevices::rgb(253 / 255, 159 / 255, 67 / 255), - grDevices::rgb(253 / 255, 129 / 255, 56 / 255), - grDevices::rgb(252 / 255, 85 / 255, 43 / 255), - grDevices::rgb(237 / 255, 51 / 255, 33 / 255), - grDevices::rgb(211 / 255, 18 / 255, 31 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 243 / 255, 175 / 255), - grDevices::rgb(255 / 255, 231 / 255, 148 / 255), - grDevices::rgb(254 / 255, 218 / 255, 121 / 255), - grDevices::rgb(254 / 255, 195 / 255, 95 / 255), - grDevices::rgb(254 / 255, 171 / 255, 73 / 255), - grDevices::rgb(253 / 255, 147 / 255, 62 / 255), - grDevices::rgb(253 / 255, 115 / 255, 51 / 255), - grDevices::rgb(249 / 255, 74 / 255, 40 / 255), - grDevices::rgb(233 / 255, 44 / 255, 31 / 255), - grDevices::rgb(208 / 255, 17 / 255, 32 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 244 / 255, 178 / 255), - grDevices::rgb(255 / 255, 233 / 255, 153 / 255), - grDevices::rgb(254 / 255, 221 / 255, 128 / 255), - grDevices::rgb(254 / 255, 204 / 255, 104 / 255), - grDevices::rgb(254 / 255, 181 / 255, 79 / 255), - grDevices::rgb(253 / 255, 159 / 255, 67 / 255), - grDevices::rgb(253 / 255, 136 / 255, 58 / 255), - grDevices::rgb(252 / 255, 101 / 255, 47 / 255), - grDevices::rgb(245 / 255, 67 / 255, 38 / 255), - grDevices::rgb(231 / 255, 38 / 255, 30 / 255), - grDevices::rgb(205 / 255, 15 / 255, 33 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 245 / 255, 180 / 255), - grDevices::rgb(255 / 255, 235 / 255, 156 / 255), - grDevices::rgb(254 / 255, 224 / 255, 134 / 255), - grDevices::rgb(254 / 255, 211 / 255, 111 / 255), - grDevices::rgb(254 / 255, 190 / 255, 89 / 255), - grDevices::rgb(254 / 255, 169 / 255, 72 / 255), - grDevices::rgb(253 / 255, 149 / 255, 63 / 255), - grDevices::rgb(253 / 255, 123 / 255, 54 / 255), - grDevices::rgb(252 / 255, 89 / 255, 44 / 255), - grDevices::rgb(242 / 255, 61 / 255, 36 / 255), - grDevices::rgb(228 / 255, 31 / 255, 29 / 255), - grDevices::rgb(203 / 255, 14 / 255, 33 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 245 / 255, 181 / 255), - grDevices::rgb(255 / 255, 236 / 255, 159 / 255), - grDevices::rgb(254 / 255, 226 / 255, 139 / 255), - grDevices::rgb(254 / 255, 216 / 255, 118 / 255), - grDevices::rgb(254 / 255, 197 / 255, 97 / 255), - grDevices::rgb(254 / 255, 178 / 255, 76 / 255), - grDevices::rgb(253 / 255, 159 / 255, 67 / 255), - grDevices::rgb(253 / 255, 140 / 255, 59 / 255), - grDevices::rgb(253 / 255, 112 / 255, 50 / 255), - grDevices::rgb(252 / 255, 77 / 255, 42 / 255), - grDevices::rgb(239 / 255, 56 / 255, 34 / 255), - grDevices::rgb(227 / 255, 25 / 255, 27 / 255), - grDevices::rgb(201 / 255, 13 / 255, 33 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 246 / 255, 183 / 255), - grDevices::rgb(255 / 255, 238 / 255, 162 / 255), - grDevices::rgb(254 / 255, 228 / 255, 143 / 255), - grDevices::rgb(254 / 255, 219 / 255, 123 / 255), - grDevices::rgb(254 / 255, 204 / 255, 104 / 255), - grDevices::rgb(254 / 255, 185 / 255, 84 / 255), - grDevices::rgb(253 / 255, 168 / 255, 71 / 255), - grDevices::rgb(253 / 255, 151 / 255, 64 / 255), - grDevices::rgb(253 / 255, 129 / 255, 56 / 255), - grDevices::rgb(252 / 255, 101 / 255, 47 / 255), - grDevices::rgb(248 / 255, 72 / 255, 40 / 255), - grDevices::rgb(237 / 255, 51 / 255, 33 / 255), - grDevices::rgb(223 / 255, 24 / 255, 28 / 255), - grDevices::rgb(200 / 255, 12 / 255, 34 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 247 / 255, 184 / 255), - grDevices::rgb(255 / 255, 239 / 255, 165 / 255), - grDevices::rgb(255 / 255, 230 / 255, 146 / 255), - grDevices::rgb(254 / 255, 221 / 255, 128 / 255), - grDevices::rgb(254 / 255, 209 / 255, 110 / 255), - grDevices::rgb(254 / 255, 192 / 255, 91 / 255), - grDevices::rgb(254 / 255, 175 / 255, 74 / 255), - grDevices::rgb(253 / 255, 159 / 255, 67 / 255), - grDevices::rgb(253 / 255, 143 / 255, 60 / 255), - grDevices::rgb(253 / 255, 119 / 255, 52 / 255), - grDevices::rgb(252 / 255, 91 / 255, 45 / 255), - grDevices::rgb(245 / 255, 67 / 255, 38 / 255), - grDevices::rgb(234 / 255, 46 / 255, 32 / 255), - grDevices::rgb(220 / 255, 23 / 255, 29 / 255), - grDevices::rgb(198 / 255, 11 / 255, 34 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 247 / 255, 185 / 255), - grDevices::rgb(255 / 255, 240 / 255, 167 / 255), - grDevices::rgb(255 / 255, 232 / 255, 150 / 255), - grDevices::rgb(254 / 255, 224 / 255, 132 / 255), - grDevices::rgb(254 / 255, 214 / 255, 115 / 255), - grDevices::rgb(254 / 255, 198 / 255, 98 / 255), - grDevices::rgb(254 / 255, 182 / 255, 81 / 255), - grDevices::rgb(253 / 255, 167 / 255, 71 / 255), - grDevices::rgb(253 / 255, 152 / 255, 64 / 255), - grDevices::rgb(253 / 255, 134 / 255, 57 / 255), - grDevices::rgb(253 / 255, 110 / 255, 50 / 255), - grDevices::rgb(252 / 255, 82 / 255, 42 / 255), - grDevices::rgb(243 / 255, 62 / 255, 36 / 255), - grDevices::rgb(232 / 255, 42 / 255, 31 / 255), - grDevices::rgb(218 / 255, 21 / 255, 30 / 255), - grDevices::rgb(197 / 255, 11 / 255, 34 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 247 / 255, 186 / 255), - grDevices::rgb(255 / 255, 240 / 255, 169 / 255), - grDevices::rgb(255 / 255, 233 / 255, 153 / 255), - grDevices::rgb(254 / 255, 225 / 255, 136 / 255), - grDevices::rgb(254 / 255, 218 / 255, 120 / 255), - grDevices::rgb(254 / 255, 204 / 255, 104 / 255), - grDevices::rgb(254 / 255, 188 / 255, 87 / 255), - grDevices::rgb(254 / 255, 174 / 255, 74 / 255), - grDevices::rgb(253 / 255, 159 / 255, 67 / 255), - grDevices::rgb(253 / 255, 145 / 255, 61 / 255), - grDevices::rgb(253 / 255, 125 / 255, 54 / 255), - grDevices::rgb(252 / 255, 101 / 255, 47 / 255), - grDevices::rgb(250 / 255, 75 / 255, 41 / 255), - grDevices::rgb(240 / 255, 58 / 255, 35 / 255), - grDevices::rgb(231 / 255, 38 / 255, 30 / 255), - grDevices::rgb(215 / 255, 20 / 255, 30 / 255), - grDevices::rgb(196 / 255, 10 / 255, 34 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 255 / 255, 204 / 255), - grDevices::rgb(255 / 255, 248 / 255, 187 / 255), - grDevices::rgb(255 / 255, 241 / 255, 171 / 255), - grDevices::rgb(255 / 255, 234 / 255, 155 / 255), - grDevices::rgb(254 / 255, 227 / 255, 140 / 255), - grDevices::rgb(254 / 255, 220 / 255, 124 / 255), - grDevices::rgb(254 / 255, 208 / 255, 109 / 255), - grDevices::rgb(254 / 255, 194 / 255, 93 / 255), - grDevices::rgb(254 / 255, 180 / 255, 78 / 255), - grDevices::rgb(253 / 255, 166 / 255, 70 / 255), - grDevices::rgb(253 / 255, 152 / 255, 64 / 255), - grDevices::rgb(253 / 255, 138 / 255, 58 / 255), - grDevices::rgb(253 / 255, 117 / 255, 52 / 255), - grDevices::rgb(252 / 255, 93 / 255, 45 / 255), - grDevices::rgb(248 / 255, 71 / 255, 39 / 255), - grDevices::rgb(238 / 255, 54 / 255, 34 / 255), - grDevices::rgb(229 / 255, 33 / 255, 29 / 255), - grDevices::rgb(213 / 255, 19 / 255, 31 / 255), - grDevices::rgb(195 / 255, 9 / 255, 35 / 255), - grDevices::rgb(177 / 255, 0 / 255, 38 / 255) - ), - "type" = "sequential" - ), - "PuRd" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(201 / 255, 148 / 255, 199 / 255)), - "2" = tibble::lst( - grDevices::rgb(231 / 255, 225 / 255, 239 / 255), - grDevices::rgb(221 / 255, 28 / 255, 119 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(231 / 255, 225 / 255, 239 / 255), - grDevices::rgb(201 / 255, 148 / 255, 199 / 255), - grDevices::rgb(221 / 255, 28 / 255, 119 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(215 / 255, 181 / 255, 216 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(206 / 255, 18 / 255, 86 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(215 / 255, 181 / 255, 216 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(221 / 255, 28 / 255, 119 / 255), - grDevices::rgb(152 / 255, 0 / 255, 67 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(212 / 255, 185 / 255, 218 / 255), - grDevices::rgb(201 / 255, 148 / 255, 199 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(221 / 255, 28 / 255, 119 / 255), - grDevices::rgb(152 / 255, 0 / 255, 67 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(241 / 255, 238 / 255, 246 / 255), - grDevices::rgb(212 / 255, 185 / 255, 218 / 255), - grDevices::rgb(201 / 255, 148 / 255, 199 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(206 / 255, 18 / 255, 86 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(247 / 255, 244 / 255, 249 / 255), - grDevices::rgb(231 / 255, 225 / 255, 239 / 255), - grDevices::rgb(212 / 255, 185 / 255, 218 / 255), - grDevices::rgb(201 / 255, 148 / 255, 199 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(206 / 255, 18 / 255, 86 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(247 / 255, 244 / 255, 249 / 255), - grDevices::rgb(231 / 255, 225 / 255, 239 / 255), - grDevices::rgb(212 / 255, 185 / 255, 218 / 255), - grDevices::rgb(201 / 255, 148 / 255, 199 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(231 / 255, 41 / 255, 138 / 255), - grDevices::rgb(206 / 255, 18 / 255, 86 / 255), - grDevices::rgb(152 / 255, 0 / 255, 67 / 255), - grDevices::rgb(103 / 255, 0 / 255, 31 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(234 / 255, 229 / 255, 241 / 255), - grDevices::rgb(220 / 255, 202 / 255, 227 / 255), - grDevices::rgb(208 / 255, 172 / 255, 211 / 255), - grDevices::rgb(203 / 255, 143 / 255, 196 / 255), - grDevices::rgb(220 / 255, 106 / 255, 178 / 255), - grDevices::rgb(229 / 255, 66 / 255, 150 / 255), - grDevices::rgb(220 / 255, 31 / 255, 114 / 255), - grDevices::rgb(192 / 255, 13 / 255, 80 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(235 / 255, 230 / 255, 241 / 255), - grDevices::rgb(223 / 255, 208 / 255, 230 / 255), - grDevices::rgb(210 / 255, 181 / 255, 216 / 255), - grDevices::rgb(203 / 255, 155 / 255, 202 / 255), - grDevices::rgb(213 / 255, 126 / 255, 187 / 255), - grDevices::rgb(225 / 255, 91 / 255, 168 / 255), - grDevices::rgb(230 / 255, 49 / 255, 141 / 255), - grDevices::rgb(216 / 255, 27 / 255, 106 / 255), - grDevices::rgb(187 / 255, 11 / 255, 78 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(236 / 255, 231 / 255, 242 / 255), - grDevices::rgb(225 / 255, 214 / 255, 233 / 255), - grDevices::rgb(213 / 255, 188 / 255, 219 / 255), - grDevices::rgb(206 / 255, 164 / 255, 207 / 255), - grDevices::rgb(205 / 255, 140 / 255, 194 / 255), - grDevices::rgb(219 / 255, 110 / 255, 180 / 255), - grDevices::rgb(227 / 255, 78 / 255, 158 / 255), - grDevices::rgb(228 / 255, 39 / 255, 133 / 255), - grDevices::rgb(213 / 255, 24 / 255, 99 / 255), - grDevices::rgb(183 / 255, 10 / 255, 77 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(237 / 255, 232 / 255, 243 / 255), - grDevices::rgb(227 / 255, 218 / 255, 235 / 255), - grDevices::rgb(216 / 255, 194 / 255, 223 / 255), - grDevices::rgb(208 / 255, 172 / 255, 211 / 255), - grDevices::rgb(201 / 255, 151 / 255, 200 / 255), - grDevices::rgb(213 / 255, 126 / 255, 187 / 255), - grDevices::rgb(223 / 255, 97 / 255, 172 / 255), - grDevices::rgb(229 / 255, 66 / 255, 150 / 255), - grDevices::rgb(224 / 255, 35 / 255, 124 / 255), - grDevices::rgb(210 / 255, 22 / 255, 94 / 255), - grDevices::rgb(180 / 255, 9 / 255, 76 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(238 / 255, 233 / 255, 243 / 255), - grDevices::rgb(229 / 255, 221 / 255, 237 / 255), - grDevices::rgb(219 / 255, 200 / 255, 226 / 255), - grDevices::rgb(210 / 255, 179 / 255, 215 / 255), - grDevices::rgb(204 / 255, 159 / 255, 204 / 255), - grDevices::rgb(206 / 255, 138 / 255, 193 / 255), - grDevices::rgb(218 / 255, 113 / 255, 181 / 255), - grDevices::rgb(226 / 255, 86 / 255, 164 / 255), - grDevices::rgb(230 / 255, 53 / 255, 143 / 255), - grDevices::rgb(221 / 255, 32 / 255, 117 / 255), - grDevices::rgb(208 / 255, 20 / 255, 89 / 255), - grDevices::rgb(177 / 255, 8 / 255, 75 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(238 / 255, 234 / 255, 243 / 255), - grDevices::rgb(230 / 255, 224 / 255, 238 / 255), - grDevices::rgb(221 / 255, 204 / 255, 228 / 255), - grDevices::rgb(211 / 255, 184 / 255, 217 / 255), - grDevices::rgb(206 / 255, 166 / 255, 208 / 255), - grDevices::rgb(201 / 255, 147 / 255, 198 / 255), - grDevices::rgb(213 / 255, 126 / 255, 187 / 255), - grDevices::rgb(223 / 255, 101 / 255, 176 / 255), - grDevices::rgb(227 / 255, 76 / 255, 156 / 255), - grDevices::rgb(230 / 255, 40 / 255, 138 / 255), - grDevices::rgb(218 / 255, 30 / 255, 111 / 255), - grDevices::rgb(205 / 255, 18 / 255, 85 / 255), - grDevices::rgb(175 / 255, 7 / 255, 74 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(239 / 255, 235 / 255, 244 / 255), - grDevices::rgb(232 / 255, 226 / 255, 239 / 255), - grDevices::rgb(223 / 255, 208 / 255, 230 / 255), - grDevices::rgb(214 / 255, 190 / 255, 220 / 255), - grDevices::rgb(208 / 255, 172 / 255, 211 / 255), - grDevices::rgb(203 / 255, 155 / 255, 202 / 255), - grDevices::rgb(207 / 255, 136 / 255, 192 / 255), - grDevices::rgb(217 / 255, 114 / 255, 182 / 255), - grDevices::rgb(225 / 255, 91 / 255, 168 / 255), - grDevices::rgb(229 / 255, 66 / 255, 150 / 255), - grDevices::rgb(227 / 255, 38 / 255, 130 / 255), - grDevices::rgb(216 / 255, 27 / 255, 106 / 255), - grDevices::rgb(201 / 255, 16 / 255, 84 / 255), - grDevices::rgb(172 / 255, 7 / 255, 73 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(239 / 255, 235 / 255, 244 / 255), - grDevices::rgb(232 / 255, 227 / 255, 240 / 255), - grDevices::rgb(225 / 255, 212 / 255, 232 / 255), - grDevices::rgb(216 / 255, 194 / 255, 223 / 255), - grDevices::rgb(210 / 255, 178 / 255, 214 / 255), - grDevices::rgb(205 / 255, 161 / 255, 206 / 255), - grDevices::rgb(202 / 255, 145 / 255, 197 / 255), - grDevices::rgb(213 / 255, 126 / 255, 187 / 255), - grDevices::rgb(221 / 255, 104 / 255, 177 / 255), - grDevices::rgb(226 / 255, 82 / 255, 161 / 255), - grDevices::rgb(229 / 255, 56 / 255, 144 / 255), - grDevices::rgb(224 / 255, 35 / 255, 124 / 255), - grDevices::rgb(214 / 255, 25 / 255, 101 / 255), - grDevices::rgb(198 / 255, 15 / 255, 83 / 255), - grDevices::rgb(171 / 255, 6 / 255, 72 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(240 / 255, 236 / 255, 244 / 255), - grDevices::rgb(233 / 255, 228 / 255, 240 / 255), - grDevices::rgb(226 / 255, 215 / 255, 234 / 255), - grDevices::rgb(218 / 255, 199 / 255, 225 / 255), - grDevices::rgb(211 / 255, 182 / 255, 216 / 255), - grDevices::rgb(207 / 255, 167 / 255, 209 / 255), - grDevices::rgb(202 / 255, 152 / 255, 201 / 255), - grDevices::rgb(208 / 255, 135 / 255, 192 / 255), - grDevices::rgb(217 / 255, 116 / 255, 182 / 255), - grDevices::rgb(224 / 255, 95 / 255, 171 / 255), - grDevices::rgb(228 / 255, 74 / 255, 155 / 255), - grDevices::rgb(230 / 255, 46 / 255, 140 / 255), - grDevices::rgb(222 / 255, 33 / 255, 119 / 255), - grDevices::rgb(212 / 255, 24 / 255, 97 / 255), - grDevices::rgb(194 / 255, 14 / 255, 81 / 255), - grDevices::rgb(169 / 255, 6 / 255, 72 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(240 / 255, 236 / 255, 245 / 255), - grDevices::rgb(234 / 255, 229 / 255, 241 / 255), - grDevices::rgb(227 / 255, 218 / 255, 235 / 255), - grDevices::rgb(220 / 255, 202 / 255, 227 / 255), - grDevices::rgb(213 / 255, 187 / 255, 219 / 255), - grDevices::rgb(208 / 255, 172 / 255, 211 / 255), - grDevices::rgb(204 / 255, 158 / 255, 204 / 255), - grDevices::rgb(203 / 255, 143 / 255, 196 / 255), - grDevices::rgb(213 / 255, 126 / 255, 187 / 255), - grDevices::rgb(220 / 255, 106 / 255, 178 / 255), - grDevices::rgb(225 / 255, 87 / 255, 165 / 255), - grDevices::rgb(229 / 255, 66 / 255, 150 / 255), - grDevices::rgb(229 / 255, 39 / 255, 135 / 255), - grDevices::rgb(220 / 255, 31 / 255, 114 / 255), - grDevices::rgb(210 / 255, 22 / 255, 94 / 255), - grDevices::rgb(192 / 255, 13 / 255, 80 / 255), - grDevices::rgb(168 / 255, 5 / 255, 71 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(247 / 255, 243 / 255, 248 / 255), - grDevices::rgb(241 / 255, 236 / 255, 245 / 255), - grDevices::rgb(235 / 255, 229 / 255, 241 / 255), - grDevices::rgb(229 / 255, 220 / 255, 236 / 255), - grDevices::rgb(222 / 255, 205 / 255, 229 / 255), - grDevices::rgb(215 / 255, 191 / 255, 221 / 255), - grDevices::rgb(209 / 255, 177 / 255, 213 / 255), - grDevices::rgb(205 / 255, 163 / 255, 206 / 255), - grDevices::rgb(201 / 255, 149 / 255, 199 / 255), - grDevices::rgb(208 / 255, 134 / 255, 191 / 255), - grDevices::rgb(216 / 255, 117 / 255, 183 / 255), - grDevices::rgb(223 / 255, 98 / 255, 173 / 255), - grDevices::rgb(227 / 255, 80 / 255, 159 / 255), - grDevices::rgb(229 / 255, 58 / 255, 145 / 255), - grDevices::rgb(227 / 255, 37 / 255, 129 / 255), - grDevices::rgb(218 / 255, 29 / 255, 110 / 255), - grDevices::rgb(208 / 255, 20 / 255, 91 / 255), - grDevices::rgb(189 / 255, 12 / 255, 79 / 255), - grDevices::rgb(167 / 255, 5 / 255, 71 / 255), - grDevices::rgb(145 / 255, 0 / 255, 63 / 255) - ), - "type" = "sequential" - ), - "Blues" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(158 / 255, 202 / 255, 225 / 255)), - "2" = tibble::lst( - grDevices::rgb(222 / 255, 235 / 255, 247 / 255), - grDevices::rgb(49 / 255, 130 / 255, 189 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(222 / 255, 235 / 255, 247 / 255), - grDevices::rgb(158 / 255, 202 / 255, 225 / 255), - grDevices::rgb(49 / 255, 130 / 255, 189 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(239 / 255, 243 / 255, 255 / 255), - grDevices::rgb(189 / 255, 215 / 255, 231 / 255), - grDevices::rgb(107 / 255, 174 / 255, 214 / 255), - grDevices::rgb(33 / 255, 113 / 255, 181 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(239 / 255, 243 / 255, 255 / 255), - grDevices::rgb(189 / 255, 215 / 255, 231 / 255), - grDevices::rgb(107 / 255, 174 / 255, 214 / 255), - grDevices::rgb(49 / 255, 130 / 255, 189 / 255), - grDevices::rgb(8 / 255, 81 / 255, 156 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(239 / 255, 243 / 255, 255 / 255), - grDevices::rgb(198 / 255, 219 / 255, 239 / 255), - grDevices::rgb(158 / 255, 202 / 255, 225 / 255), - grDevices::rgb(107 / 255, 174 / 255, 214 / 255), - grDevices::rgb(49 / 255, 130 / 255, 189 / 255), - grDevices::rgb(8 / 255, 81 / 255, 156 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(239 / 255, 243 / 255, 255 / 255), - grDevices::rgb(198 / 255, 219 / 255, 239 / 255), - grDevices::rgb(158 / 255, 202 / 255, 225 / 255), - grDevices::rgb(107 / 255, 174 / 255, 214 / 255), - grDevices::rgb(66 / 255, 146 / 255, 198 / 255), - grDevices::rgb(33 / 255, 113 / 255, 181 / 255), - grDevices::rgb(8 / 255, 69 / 255, 148 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(247 / 255, 251 / 255, 255 / 255), - grDevices::rgb(222 / 255, 235 / 255, 247 / 255), - grDevices::rgb(198 / 255, 219 / 255, 239 / 255), - grDevices::rgb(158 / 255, 202 / 255, 225 / 255), - grDevices::rgb(107 / 255, 174 / 255, 214 / 255), - grDevices::rgb(66 / 255, 146 / 255, 198 / 255), - grDevices::rgb(33 / 255, 113 / 255, 181 / 255), - grDevices::rgb(8 / 255, 69 / 255, 148 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(247 / 255, 251 / 255, 255 / 255), - grDevices::rgb(222 / 255, 235 / 255, 247 / 255), - grDevices::rgb(198 / 255, 219 / 255, 239 / 255), - grDevices::rgb(158 / 255, 202 / 255, 225 / 255), - grDevices::rgb(107 / 255, 174 / 255, 214 / 255), - grDevices::rgb(66 / 255, 146 / 255, 198 / 255), - grDevices::rgb(33 / 255, 113 / 255, 181 / 255), - grDevices::rgb(8 / 255, 81 / 255, 156 / 255), - grDevices::rgb(8 / 255, 48 / 255, 107 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(227 / 255, 238 / 255, 248 / 255), - grDevices::rgb(208 / 255, 226 / 255, 242 / 255), - grDevices::rgb(184 / 255, 213 / 255, 234 / 255), - grDevices::rgb(152 / 255, 198 / 255, 223 / 255), - grDevices::rgb(113 / 255, 177 / 255, 215 / 255), - grDevices::rgb(80 / 255, 155 / 255, 203 / 255), - grDevices::rgb(53 / 255, 131 / 255, 190 / 255), - grDevices::rgb(29 / 255, 102 / 255, 173 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(229 / 255, 239 / 255, 249 / 255), - grDevices::rgb(212 / 255, 228 / 255, 243 / 255), - grDevices::rgb(194 / 255, 217 / 255, 237 / 255), - grDevices::rgb(166 / 255, 205 / 255, 227 / 255), - grDevices::rgb(133 / 255, 187 / 255, 219 / 255), - grDevices::rgb(99 / 255, 168 / 255, 210 / 255), - grDevices::rgb(70 / 255, 148 / 255, 199 / 255), - grDevices::rgb(48 / 255, 126 / 255, 187 / 255), - grDevices::rgb(27 / 255, 99 / 255, 171 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(231 / 255, 240 / 255, 249 / 255), - grDevices::rgb(215 / 255, 230 / 255, 244 / 255), - grDevices::rgb(200 / 255, 220 / 255, 239 / 255), - grDevices::rgb(176 / 255, 209 / 255, 231 / 255), - grDevices::rgb(149 / 255, 196 / 255, 223 / 255), - grDevices::rgb(117 / 255, 179 / 255, 216 / 255), - grDevices::rgb(89 / 255, 161 / 255, 206 / 255), - grDevices::rgb(63 / 255, 142 / 255, 196 / 255), - grDevices::rgb(43 / 255, 121 / 255, 185 / 255), - grDevices::rgb(26 / 255, 96 / 255, 168 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(232 / 255, 241 / 255, 250 / 255), - grDevices::rgb(218 / 255, 232 / 255, 245 / 255), - grDevices::rgb(204 / 255, 222 / 255, 241 / 255), - grDevices::rgb(184 / 255, 213 / 255, 234 / 255), - grDevices::rgb(161 / 255, 203 / 255, 226 / 255), - grDevices::rgb(133 / 255, 187 / 255, 219 / 255), - grDevices::rgb(103 / 255, 171 / 255, 212 / 255), - grDevices::rgb(80 / 255, 155 / 255, 203 / 255), - grDevices::rgb(59 / 255, 137 / 255, 193 / 255), - grDevices::rgb(39 / 255, 118 / 255, 183 / 255), - grDevices::rgb(25 / 255, 94 / 255, 167 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(233 / 255, 242 / 255, 250 / 255), - grDevices::rgb(220 / 255, 233 / 255, 246 / 255), - grDevices::rgb(207 / 255, 225 / 255, 242 / 255), - grDevices::rgb(191 / 255, 216 / 255, 236 / 255), - grDevices::rgb(170 / 255, 207 / 255, 229 / 255), - grDevices::rgb(146 / 255, 195 / 255, 222 / 255), - grDevices::rgb(119 / 255, 180 / 255, 216 / 255), - grDevices::rgb(95 / 255, 165 / 255, 209 / 255), - grDevices::rgb(73 / 255, 150 / 255, 200 / 255), - grDevices::rgb(55 / 255, 133 / 255, 191 / 255), - grDevices::rgb(36 / 255, 115 / 255, 182 / 255), - grDevices::rgb(24 / 255, 92 / 255, 165 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(234 / 255, 242 / 255, 251 / 255), - grDevices::rgb(222 / 255, 235 / 255, 247 / 255), - grDevices::rgb(210 / 255, 226 / 255, 243 / 255), - grDevices::rgb(197 / 255, 218 / 255, 238 / 255), - grDevices::rgb(178 / 255, 210 / 255, 231 / 255), - grDevices::rgb(158 / 255, 202 / 255, 224 / 255), - grDevices::rgb(133 / 255, 187 / 255, 219 / 255), - grDevices::rgb(107 / 255, 173 / 255, 214 / 255), - grDevices::rgb(87 / 255, 159 / 255, 205 / 255), - grDevices::rgb(65 / 255, 146 / 255, 197 / 255), - grDevices::rgb(51 / 255, 129 / 255, 189 / 255), - grDevices::rgb(32 / 255, 113 / 255, 180 / 255), - grDevices::rgb(23 / 255, 90 / 255, 164 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(235 / 255, 243 / 255, 251 / 255), - grDevices::rgb(223 / 255, 236 / 255, 247 / 255), - grDevices::rgb(212 / 255, 228 / 255, 243 / 255), - grDevices::rgb(201 / 255, 221 / 255, 240 / 255), - grDevices::rgb(184 / 255, 213 / 255, 234 / 255), - grDevices::rgb(166 / 255, 205 / 255, 227 / 255), - grDevices::rgb(145 / 255, 194 / 255, 222 / 255), - grDevices::rgb(121 / 255, 181 / 255, 216 / 255), - grDevices::rgb(99 / 255, 168 / 255, 210 / 255), - grDevices::rgb(80 / 255, 155 / 255, 203 / 255), - grDevices::rgb(62 / 255, 141 / 255, 195 / 255), - grDevices::rgb(48 / 255, 126 / 255, 187 / 255), - grDevices::rgb(31 / 255, 109 / 255, 178 / 255), - grDevices::rgb(22 / 255, 89 / 255, 163 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(236 / 255, 243 / 255, 251 / 255), - grDevices::rgb(225 / 255, 236 / 255, 248 / 255), - grDevices::rgb(214 / 255, 229 / 255, 244 / 255), - grDevices::rgb(204 / 255, 222 / 255, 241 / 255), - grDevices::rgb(190 / 255, 215 / 255, 236 / 255), - grDevices::rgb(173 / 255, 208 / 255, 230 / 255), - grDevices::rgb(155 / 255, 200 / 255, 224 / 255), - grDevices::rgb(133 / 255, 187 / 255, 219 / 255), - grDevices::rgb(110 / 255, 175 / 255, 214 / 255), - grDevices::rgb(92 / 255, 163 / 255, 207 / 255), - grDevices::rgb(74 / 255, 151 / 255, 200 / 255), - grDevices::rgb(59 / 255, 137 / 255, 193 / 255), - grDevices::rgb(45 / 255, 123 / 255, 186 / 255), - grDevices::rgb(30 / 255, 107 / 255, 176 / 255), - grDevices::rgb(22 / 255, 87 / 255, 162 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(236 / 255, 244 / 255, 251 / 255), - grDevices::rgb(226 / 255, 237 / 255, 248 / 255), - grDevices::rgb(216 / 255, 231 / 255, 245 / 255), - grDevices::rgb(206 / 255, 224 / 255, 241 / 255), - grDevices::rgb(195 / 255, 217 / 255, 238 / 255), - grDevices::rgb(179 / 255, 210 / 255, 232 / 255), - grDevices::rgb(162 / 255, 203 / 255, 226 / 255), - grDevices::rgb(143 / 255, 193 / 255, 221 / 255), - grDevices::rgb(122 / 255, 182 / 255, 217 / 255), - grDevices::rgb(102 / 255, 170 / 255, 212 / 255), - grDevices::rgb(86 / 255, 159 / 255, 205 / 255), - grDevices::rgb(68 / 255, 147 / 255, 198 / 255), - grDevices::rgb(55 / 255, 134 / 255, 192 / 255), - grDevices::rgb(42 / 255, 120 / 255, 185 / 255), - grDevices::rgb(30 / 255, 105 / 255, 175 / 255), - grDevices::rgb(21 / 255, 86 / 255, 161 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(237 / 255, 244 / 255, 251 / 255), - grDevices::rgb(227 / 255, 238 / 255, 248 / 255), - grDevices::rgb(218 / 255, 232 / 255, 245 / 255), - grDevices::rgb(208 / 255, 226 / 255, 242 / 255), - grDevices::rgb(199 / 255, 219 / 255, 239 / 255), - grDevices::rgb(184 / 255, 213 / 255, 234 / 255), - grDevices::rgb(169 / 255, 206 / 255, 228 / 255), - grDevices::rgb(152 / 255, 198 / 255, 223 / 255), - grDevices::rgb(133 / 255, 187 / 255, 219 / 255), - grDevices::rgb(113 / 255, 177 / 255, 215 / 255), - grDevices::rgb(96 / 255, 166 / 255, 209 / 255), - grDevices::rgb(80 / 255, 155 / 255, 203 / 255), - grDevices::rgb(64 / 255, 144 / 255, 197 / 255), - grDevices::rgb(53 / 255, 131 / 255, 190 / 255), - grDevices::rgb(39 / 255, 118 / 255, 183 / 255), - grDevices::rgb(29 / 255, 102 / 255, 173 / 255), - grDevices::rgb(20 / 255, 85 / 255, 160 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(247 / 255, 250 / 255, 255 / 255), - grDevices::rgb(237 / 255, 245 / 255, 252 / 255), - grDevices::rgb(228 / 255, 239 / 255, 249 / 255), - grDevices::rgb(219 / 255, 233 / 255, 246 / 255), - grDevices::rgb(210 / 255, 227 / 255, 243 / 255), - grDevices::rgb(201 / 255, 221 / 255, 240 / 255), - grDevices::rgb(189 / 255, 215 / 255, 236 / 255), - grDevices::rgb(175 / 255, 209 / 255, 230 / 255), - grDevices::rgb(160 / 255, 202 / 255, 225 / 255), - grDevices::rgb(142 / 255, 193 / 255, 221 / 255), - grDevices::rgb(124 / 255, 182 / 255, 217 / 255), - grDevices::rgb(105 / 255, 172 / 255, 213 / 255), - grDevices::rgb(90 / 255, 162 / 255, 207 / 255), - grDevices::rgb(75 / 255, 151 / 255, 201 / 255), - grDevices::rgb(61 / 255, 140 / 255, 195 / 255), - grDevices::rgb(50 / 255, 128 / 255, 189 / 255), - grDevices::rgb(37 / 255, 116 / 255, 182 / 255), - grDevices::rgb(28 / 255, 101 / 255, 172 / 255), - grDevices::rgb(20 / 255, 84 / 255, 160 / 255), - grDevices::rgb(7 / 255, 69 / 255, 147 / 255) - ), - "type" = "sequential" - ), - "PuBuGn" = tibble::lst( - "1" = tibble::lst(grDevices::rgb(166 / 255, 189 / 255, 219 / 255)), - "2" = tibble::lst( - grDevices::rgb(236 / 255, 226 / 255, 240 / 255), - grDevices::rgb(28 / 255, 144 / 255, 153 / 255) - ), - "3" = tibble::lst( - grDevices::rgb(236 / 255, 226 / 255, 240 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(28 / 255, 144 / 255, 153 / 255) - ), - "4" = tibble::lst( - grDevices::rgb(246 / 255, 239 / 255, 247 / 255), - grDevices::rgb(189 / 255, 201 / 255, 225 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(2 / 255, 129 / 255, 138 / 255) - ), - "5" = tibble::lst( - grDevices::rgb(246 / 255, 239 / 255, 247 / 255), - grDevices::rgb(189 / 255, 201 / 255, 225 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(28 / 255, 144 / 255, 153 / 255), - grDevices::rgb(1 / 255, 108 / 255, 89 / 255) - ), - "6" = tibble::lst( - grDevices::rgb(246 / 255, 239 / 255, 247 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(28 / 255, 144 / 255, 153 / 255), - grDevices::rgb(1 / 255, 108 / 255, 89 / 255) - ), - "7" = tibble::lst( - grDevices::rgb(246 / 255, 239 / 255, 247 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(54 / 255, 144 / 255, 192 / 255), - grDevices::rgb(2 / 255, 129 / 255, 138 / 255), - grDevices::rgb(1 / 255, 100 / 255, 80 / 255) - ), - "8" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 251 / 255), - grDevices::rgb(236 / 255, 226 / 255, 240 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(54 / 255, 144 / 255, 192 / 255), - grDevices::rgb(2 / 255, 129 / 255, 138 / 255), - grDevices::rgb(1 / 255, 100 / 255, 80 / 255) - ), - "9" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 251 / 255), - grDevices::rgb(236 / 255, 226 / 255, 240 / 255), - grDevices::rgb(208 / 255, 209 / 255, 230 / 255), - grDevices::rgb(166 / 255, 189 / 255, 219 / 255), - grDevices::rgb(103 / 255, 169 / 255, 207 / 255), - grDevices::rgb(54 / 255, 144 / 255, 192 / 255), - grDevices::rgb(2 / 255, 129 / 255, 138 / 255), - grDevices::rgb(1 / 255, 108 / 255, 89 / 255), - grDevices::rgb(1 / 255, 70 / 255, 54 / 255) - ), - "10" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(240 / 255, 230 / 255, 242 / 255), - grDevices::rgb(220 / 255, 216 / 255, 234 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(159 / 255, 186 / 255, 217 / 255), - grDevices::rgb(110 / 255, 171 / 255, 208 / 255), - grDevices::rgb(72 / 255, 152 / 255, 196 / 255), - grDevices::rgb(37 / 255, 137 / 255, 167 / 255), - grDevices::rgb(4 / 255, 122 / 255, 124 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "11" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(241 / 255, 232 / 255, 243 / 255), - grDevices::rgb(224 / 255, 219 / 255, 235 / 255), - grDevices::rgb(203 / 255, 206 / 255, 228 / 255), - grDevices::rgb(174 / 255, 192 / 255, 221 / 255), - grDevices::rgb(136 / 255, 179 / 255, 213 / 255), - grDevices::rgb(94 / 255, 163 / 255, 203 / 255), - grDevices::rgb(60 / 255, 146 / 255, 193 / 255), - grDevices::rgb(31 / 255, 135 / 255, 159 / 255), - grDevices::rgb(4 / 255, 120 / 255, 120 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "12" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(242 / 255, 233 / 255, 243 / 255), - grDevices::rgb(228 / 255, 221 / 255, 237 / 255), - grDevices::rgb(210 / 255, 210 / 255, 230 / 255), - grDevices::rgb(185 / 255, 198 / 255, 224 / 255), - grDevices::rgb(155 / 255, 185 / 255, 216 / 255), - grDevices::rgb(115 / 255, 172 / 255, 209 / 255), - grDevices::rgb(82 / 255, 157 / 255, 200 / 255), - grDevices::rgb(51 / 255, 142 / 255, 186 / 255), - grDevices::rgb(24 / 255, 133 / 255, 152 / 255), - grDevices::rgb(5 / 255, 118 / 255, 116 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "13" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(243 / 255, 234 / 255, 244 / 255), - grDevices::rgb(231 / 255, 223 / 255, 238 / 255), - grDevices::rgb(215 / 255, 213 / 255, 232 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(169 / 255, 190 / 255, 219 / 255), - grDevices::rgb(136 / 255, 179 / 255, 213 / 255), - grDevices::rgb(99 / 255, 166 / 255, 205 / 255), - grDevices::rgb(72 / 255, 152 / 255, 196 / 255), - grDevices::rgb(45 / 255, 140 / 255, 178 / 255), - grDevices::rgb(17 / 255, 131 / 255, 146 / 255), - grDevices::rgb(5 / 255, 116 / 255, 113 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "14" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(244 / 255, 235 / 255, 245 / 255), - grDevices::rgb(233 / 255, 224 / 255, 239 / 255), - grDevices::rgb(218 / 255, 215 / 255, 233 / 255), - grDevices::rgb(201 / 255, 205 / 255, 228 / 255), - grDevices::rgb(179 / 255, 195 / 255, 222 / 255), - grDevices::rgb(152 / 255, 184 / 255, 216 / 255), - grDevices::rgb(119 / 255, 173 / 255, 209 / 255), - grDevices::rgb(89 / 255, 161 / 255, 202 / 255), - grDevices::rgb(63 / 255, 147 / 255, 194 / 255), - grDevices::rgb(40 / 255, 138 / 255, 170 / 255), - grDevices::rgb(9 / 255, 130 / 255, 142 / 255), - grDevices::rgb(5 / 255, 115 / 255, 110 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "15" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(245 / 255, 236 / 255, 245 / 255), - grDevices::rgb(235 / 255, 225 / 255, 240 / 255), - grDevices::rgb(222 / 255, 217 / 255, 234 / 255), - grDevices::rgb(208 / 255, 209 / 255, 229 / 255), - grDevices::rgb(187 / 255, 198 / 255, 224 / 255), - grDevices::rgb(165 / 255, 189 / 255, 218 / 255), - grDevices::rgb(136 / 255, 179 / 255, 213 / 255), - grDevices::rgb(102 / 255, 169 / 255, 206 / 255), - grDevices::rgb(80 / 255, 156 / 255, 199 / 255), - grDevices::rgb(53 / 255, 144 / 255, 191 / 255), - grDevices::rgb(35 / 255, 136 / 255, 164 / 255), - grDevices::rgb(1 / 255, 128 / 255, 138 / 255), - grDevices::rgb(5 / 255, 114 / 255, 108 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "16" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(246 / 255, 237 / 255, 245 / 255), - grDevices::rgb(237 / 255, 227 / 255, 240 / 255), - grDevices::rgb(224 / 255, 219 / 255, 235 / 255), - grDevices::rgb(211 / 255, 211 / 255, 231 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(174 / 255, 192 / 255, 221 / 255), - grDevices::rgb(150 / 255, 183 / 255, 215 / 255), - grDevices::rgb(121 / 255, 174 / 255, 210 / 255), - grDevices::rgb(94 / 255, 163 / 255, 203 / 255), - grDevices::rgb(72 / 255, 152 / 255, 196 / 255), - grDevices::rgb(49 / 255, 142 / 255, 184 / 255), - grDevices::rgb(31 / 255, 135 / 255, 159 / 255), - grDevices::rgb(2 / 255, 127 / 255, 134 / 255), - grDevices::rgb(4 / 255, 113 / 255, 106 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "17" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(246 / 255, 237 / 255, 246 / 255), - grDevices::rgb(238 / 255, 228 / 255, 241 / 255), - grDevices::rgb(227 / 255, 220 / 255, 236 / 255), - grDevices::rgb(215 / 255, 213 / 255, 232 / 255), - grDevices::rgb(200 / 255, 205 / 255, 227 / 255), - grDevices::rgb(181 / 255, 196 / 255, 223 / 255), - grDevices::rgb(162 / 255, 187 / 255, 218 / 255), - grDevices::rgb(136 / 255, 179 / 255, 213 / 255), - grDevices::rgb(107 / 255, 170 / 255, 207 / 255), - grDevices::rgb(86 / 255, 159 / 255, 201 / 255), - grDevices::rgb(64 / 255, 148 / 255, 194 / 255), - grDevices::rgb(45 / 255, 140 / 255, 178 / 255), - grDevices::rgb(26 / 255, 133 / 255, 154 / 255), - grDevices::rgb(3 / 255, 125 / 255, 130 / 255), - grDevices::rgb(4 / 255, 112 / 255, 104 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "18" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(247 / 255, 238 / 255, 246 / 255), - grDevices::rgb(239 / 255, 229 / 255, 241 / 255), - grDevices::rgb(229 / 255, 221 / 255, 237 / 255), - grDevices::rgb(217 / 255, 214 / 255, 233 / 255), - grDevices::rgb(205 / 255, 207 / 255, 229 / 255), - grDevices::rgb(188 / 255, 199 / 255, 224 / 255), - grDevices::rgb(171 / 255, 191 / 255, 220 / 255), - grDevices::rgb(148 / 255, 183 / 255, 215 / 255), - grDevices::rgb(123 / 255, 174 / 255, 210 / 255), - grDevices::rgb(98 / 255, 166 / 255, 205 / 255), - grDevices::rgb(79 / 255, 155 / 255, 199 / 255), - grDevices::rgb(57 / 255, 145 / 255, 192 / 255), - grDevices::rgb(41 / 255, 138 / 255, 172 / 255), - grDevices::rgb(22 / 255, 132 / 255, 150 / 255), - grDevices::rgb(4 / 255, 123 / 255, 127 / 255), - grDevices::rgb(4 / 255, 111 / 255, 103 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "19" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(247 / 255, 238 / 255, 246 / 255), - grDevices::rgb(240 / 255, 230 / 255, 242 / 255), - grDevices::rgb(231 / 255, 223 / 255, 238 / 255), - grDevices::rgb(220 / 255, 216 / 255, 234 / 255), - grDevices::rgb(209 / 255, 209 / 255, 230 / 255), - grDevices::rgb(194 / 255, 202 / 255, 226 / 255), - grDevices::rgb(177 / 255, 194 / 255, 222 / 255), - grDevices::rgb(159 / 255, 186 / 255, 217 / 255), - grDevices::rgb(136 / 255, 179 / 255, 213 / 255), - grDevices::rgb(110 / 255, 171 / 255, 208 / 255), - grDevices::rgb(91 / 255, 161 / 255, 202 / 255), - grDevices::rgb(72 / 255, 152 / 255, 196 / 255), - grDevices::rgb(52 / 255, 143 / 255, 188 / 255), - grDevices::rgb(37 / 255, 137 / 255, 167 / 255), - grDevices::rgb(17 / 255, 131 / 255, 146 / 255), - grDevices::rgb(4 / 255, 122 / 255, 124 / 255), - grDevices::rgb(4 / 255, 111 / 255, 102 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "20" = tibble::lst( - grDevices::rgb(255 / 255, 247 / 255, 250 / 255), - grDevices::rgb(247 / 255, 239 / 255, 246 / 255), - grDevices::rgb(240 / 255, 231 / 255, 242 / 255), - grDevices::rgb(233 / 255, 224 / 255, 238 / 255), - grDevices::rgb(222 / 255, 217 / 255, 235 / 255), - grDevices::rgb(212 / 255, 211 / 255, 231 / 255), - grDevices::rgb(199 / 255, 204 / 255, 227 / 255), - grDevices::rgb(183 / 255, 197 / 255, 223 / 255), - grDevices::rgb(168 / 255, 190 / 255, 219 / 255), - grDevices::rgb(147 / 255, 182 / 255, 215 / 255), - grDevices::rgb(124 / 255, 175 / 255, 210 / 255), - grDevices::rgb(100 / 255, 167 / 255, 206 / 255), - grDevices::rgb(84 / 255, 158 / 255, 200 / 255), - grDevices::rgb(66 / 255, 149 / 255, 195 / 255), - grDevices::rgb(48 / 255, 141 / 255, 183 / 255), - grDevices::rgb(34 / 255, 136 / 255, 163 / 255), - grDevices::rgb(12 / 255, 130 / 255, 143 / 255), - grDevices::rgb(4 / 255, 121 / 255, 122 / 255), - grDevices::rgb(4 / 255, 110 / 255, 100 / 255), - grDevices::rgb(0 / 255, 100 / 255, 80 / 255) - ), - "type" = "sequential" - ) -) diff --git a/R/sits_check.R b/R/sits_check.R index f3df17e3f..f7147ca50 100644 --- a/R/sits_check.R +++ b/R/sits_check.R @@ -95,7 +95,8 @@ NULL #' @rdname check_functions #' -#' @return \code{.check_identify_caller()} returns a \code{character} value. +#' @return +#' \code{.check_identify_caller()} returns a \code{character} value. .check_identify_caller <- function() { # check calling stack @@ -158,6 +159,7 @@ NULL #' function throws an error when applied to each \code{x} element. #' } #' } +#' @keywords internal .check_that <- function(x, ..., local_msg = NULL, msg = NULL) { @@ -188,6 +190,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_null <- function(x, ..., msg = NULL) { @@ -200,6 +203,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_na <- function(x, ..., msg = NULL) { @@ -214,6 +218,7 @@ NULL #' @rdname check_functions +#' @keywords internal .check_names <- function(x, ..., is_named = TRUE, msg = NULL) { @@ -245,6 +250,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_length <- function(x, ..., len_min = NULL, len_max = NULL, @@ -286,6 +292,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_apply <- function(x, fn_check, ...) { if (!is.function(fn_check)) @@ -325,7 +332,7 @@ NULL #' type is not \code{list}. #' } #' } -#' +#' @keywords internal .check_lgl_type <- function(x, ..., msg = NULL) { @@ -339,6 +346,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_num_type <- function(x, ..., is_integer = FALSE, msg = NULL) { @@ -367,6 +375,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_chr_type <- function(x, ..., msg = NULL) { @@ -380,6 +389,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_lst_type <- function(x, ..., msg = NULL) { @@ -427,6 +437,7 @@ NULL #' its elements. In this case, extra parameters can be passed by \code{...}. #' } #' } +#' @keywords internal .check_lgl <- function(x, ..., allow_na = FALSE, len_min = NULL, @@ -459,6 +470,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_num <- function(x, ..., allow_na = FALSE, min = -Inf, @@ -520,6 +532,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_chr <- function(x, ..., allow_na = FALSE, allow_empty = TRUE, @@ -571,6 +584,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_lst <- function(x, ..., min_len = NULL, max_len = NULL, @@ -641,7 +655,7 @@ NULL #' (can it repeat?) equal to \code{x}. #' } #' } -#' +#'@keywords internal .check_chr_within <- function(x, within, ..., case_sensitive = TRUE, @@ -732,6 +746,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_chr_contains <- function(x, contains, ..., case_sensitive = TRUE, @@ -831,6 +846,7 @@ NULL #' existing file path. #' } #' } +#' @keywords internal .check_file <- function(x, ..., extensions = NULL, msg = NULL) { @@ -875,6 +891,7 @@ NULL #' not existing. #' } #' } +#' @keywords internal .check_env_var <- function(x, ..., msg = NULL) { @@ -910,6 +927,7 @@ NULL #' \code{expr} parameter, and shows a personalized message. #' } #' } +#' @keywords internal .check_warn <- function(expr) { result <- tryCatch({ @@ -922,6 +940,7 @@ NULL } #' @rdname check_functions +#' @keywords internal .check_error <- function(expr, ..., msg = NULL) { diff --git a/R/sits_classification.R b/R/sits_classification.R index 9efacda89..49cf117d8 100644 --- a/R/sits_classification.R +++ b/R/sits_classification.R @@ -1,4 +1,4 @@ -#' @title Classify time series or data cube using machine learning models +#' @title Classify time series or data cubes #' #' @name sits_classify #' @@ -76,7 +76,7 @@ #' ml_method = sits_xgboost(verbose = FALSE) #' ) #' # classify the point -#' point_2bands <- sits_select(samples_mt_6bands, +#' point_2bands <- sits_select(point_mt_6bands, #' bands = c("NDVI", "EVI")) #' point_class <- sits_classify(point_2bands, xgb_model) #' plot(point_class) diff --git a/R/sits_classify_ts.R b/R/sits_classify_ts.R index 85f7117c8..d9eaf8916 100644 --- a/R/sits_classify_ts.R +++ b/R/sits_classify_ts.R @@ -30,8 +30,8 @@ sits_show_prediction <- function(class) { .sits_tibble_test(class) .check_chr_within( - x = names(class$predicted[[1]]), - within = c("from", "to", "class", "probs"), + x = .config_get("ts_predicted_cols"), + within = names(class$predicted[[1]]), msg = "tibble has not been classified" ) diff --git a/R/sits_cluster.R b/R/sits_cluster.R index 4868c6cba..ed354963e 100644 --- a/R/sits_cluster.R +++ b/R/sits_cluster.R @@ -1,14 +1,25 @@ -#' @title Clusters a set of time series -#' using aglomerative hierarchical clustering -#' @name sits_cluster_dendro +#' @title Find clusters in time series samples +#' @name sits_clustering #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' -#' @description Takes a SITS tibble and produces a sits tibble -#' with an added "cluster" column. -#' This is done in several steps: -#' 1. Calculation of the dendrogram; -#' 2. Get validity index for best cluster using the adjusted Rand Index; -#' 3. Cut the dendrogram using the chosen validity index. +#' @description These functions support hierarchical agglomerative clustering in sits. +#' They provide support from creating a dendrogram and using it for cleaning samples. +#' +#' \code{sits_cluster_dendro()} takes a tibble containing time series and produces +#' a sits tibble with an added "cluster" column. The function first calculates a dendrogram and +#' obtains a validity index for best clustering using the adjusted Rand Index. +#' After cutting the dendrogram using the chosen validity index, it assigns a +#' cluster to each sample. +#' +#' \code{sits_cluster_frequency()} computes the contingency table between labels and clusters +#' and produces a matrix +#' It needs as input a tibble produced by \code{sits_cluster_dendro()}. +#' +#' \code{sits_cluster_clean()} takes a tibble with time series +#' that has an additional `cluster` produced by \code{sits_cluster_dendro()} +#' and removes labels that are minority in each cluster. +#' +#' #' #' @references "dtwclust" package (https://CRAN.R-project.org/package=dtwclust) #' @@ -19,20 +30,32 @@ #' Can be any `hclust` method (see `hclust`). #' Default is 'ward.D2'. #' @param k Desired number of clusters (overrides default value) -#' @param colors Color scheme as per .sits_brewer_color_name` function. +#' @param palette Color palette as per `grDevices::hcl.pals()` function. #' @param .plot Plot the dendrogram? #' @param ... Additional parameters to be passed #' to dtwclust::tsclust() function. -#' @return A tibble with the clusters or clusters' members. +#' +#' @rdname sits_clustering +#' @return +#' \code{sits_cluster_dendro()} takes a tibble containing time series and produces +#' a sits tibble with an added "cluster" column. #' #' @examples #' \dontrun{ -#' # Load the "dtwclust" package -#' # library(dtwclust) #' # load a simple data set with two classes #' data(cerrado_2classes) #' # calculate the dendrogram and the best clusters #' clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) +#' # show clusters samples frequency +#' sits_cluster_frequency(clusters) +#' # remove cluster 3 from the samples +#' clusters_new <- dplyr::filter(clusters, cluster != 3) +#' # show clusters samples frequency of the new data set +#' sits_cluster_frequency(clusters_new) +#' # clean all remaining clusters +#' cleaned <- sits_cluster_clean(clusters_new) +#' # show clusters samples frequency +#' sits_cluster_frequency(cleaned) #' } #' @export sits_cluster_dendro <- function(samples = NULL, @@ -40,12 +63,17 @@ sits_cluster_dendro <- function(samples = NULL, dist_method = "dtw_basic", linkage = "ward.D2", k = NULL, - colors = "RdYlGn", + palette = "RdYlGn", .plot = TRUE, ...) { # verify if data is OK .sits_tibble_test(samples) + .check_that( + requireNamespace("dtwclust", quietly = TRUE), + msg = "Please install package dtwclust" + ) + # bands in sits are uppercase bands <- .sits_tibble_bands_check(samples, bands) @@ -84,33 +112,21 @@ sits_cluster_dendro <- function(samples = NULL, # plot the dendrogram message("Plotting dendrogram...") if (.plot) - .sits_plot_dendrogram(samples, cluster, best_cut["height"], colors) + .sits_plot_dendrogram(data = samples, + cluster = cluster, + cutree_height = best_cut["height"], + palette = palette) # return the result message("result is a tibble with cluster indexes...") return(samples) } - - - -#' @title Cluster contigency table -#' @name sits_cluster_frequency -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' -#' @description Computes the contingency table between labels and clusters. -#' This function needs as input a sits tibble with `cluster` column. +#' @rdname sits_clustering +#' @return +#' \code{sits_cluster_frequency()} returns a matrix containing +#' all frequencies of labels in clusters. #' -#' @param samples A tibble with `cluster` column. -#' @return A matrix containing all frequencies of labels in clusters. -#' @examples -#' \dontrun{ -#' # Load the "dtwclust" package -#' # library(dtwclust) -#' # create clusters by cutting a dendrogram -#' clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) -#' # show clusters samples frequency -#' sits_cluster_frequency(clusters) -#' } #' @export sits_cluster_frequency <- function(samples) { @@ -134,32 +150,12 @@ sits_cluster_frequency <- function(samples) { ) return(result) } - -#' @title Cluster cleaner -#' @name sits_cluster_clean -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' -#' @description Removes labels that are minority in each cluster. -#' -#' @param samples Tibble with `cluster` column. -#' @return A tibble with all selected samples. -#' @examples -#' \dontrun{ -#' # Load the "dtwclust" package -#' # library(dtwclust) -#' # calculate the dendrogram and the best clusters -#' clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) -#' # show clusters samples frequency -#' sits_cluster_frequency(clusters) -#' # remove cluster 3 from the samples -#' clusters_new <- dplyr::filter(clusters, cluster != 3) -#' # show clusters samples frequency -#' sits_cluster_frequency(clusters_new) -#' # clean all remaining clusters -#' cleaned <- sits_cluster_clean(clusters_new) -#' # show clusters samples frequency -#' sits_cluster_frequency(cleaned) -#' } +#' @rdname sits_clustering +#' @return +#' \code{sits_cluster_clean()} takes a tibble with time series +#' that has an additional `cluster` produced by \code{sits_cluster_dendro()} +#' and removes labels that are minority in each cluster. #' @export sits_cluster_clean <- function(samples) { diff --git a/R/sits_config.R b/R/sits_config.R index d06300917..4b9b732ca 100644 --- a/R/sits_config.R +++ b/R/sits_config.R @@ -1,10 +1,14 @@ -#' @title sits configuration +#' @title Configure parameters for sits package #' @name sits_configuration #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' #' @description These functions load and show sits configurations. #' +#' The `sits` package uses a configuration file +#' that contains information on parameters required by different functions. +#' This includes information about the image collections handled by `sits`. +#' #' \code{sits_config()} loads the default configuration file and #' the user provided configuration file. The final configuration is #' obtained by overriding the options by the values provided in @@ -42,8 +46,8 @@ #' @param collection A \code{character} value used in conjunction #' with \code{source} parameter to indicate a collection key entry to be shown #' in detail. -#' @param palette A \code{character} value indicating a palette -#' to be shown in detail. +#' @param colors A \code{logical} value indicating if colors +#' will to be shown in detail. #' #' @details #' Users can provide additional configuration files, by specifying the @@ -83,9 +87,23 @@ sits_config <- function(processing_bloat = NULL, # set options defined in sits config do.call(.config_set_options, args = config) + message(paste0("Using configuration file: ", yml_file)) + # load the internal configuration file + config_internals_file <- .config_internals_file() + # read the configuration parameters + config_internals <- yaml::yaml.load_file(input = config_internals_file, + merge.precedence = "override") - message(paste0("Using configuration file: ", yml_file)) + # set options defined in sits config + do.call(.config_set_options, args = config_internals) + + # load the color configuration file + color_yml_file <- .config_colors_file() + message(paste("Color configurations found in", color_yml_file)) + config_colors <- yaml::yaml.load_file(input = color_yml_file, + merge.precedence = "override") + .config_set_options(colors = config_colors[["colors"]]) # try to find a valid user configuration file user_yml_file <- .config_user_file() @@ -109,7 +127,7 @@ sits_config <- function(processing_bloat = NULL, leaflet_max_Mbytes = config[["leaflet_max_Mbytes"]], leaflet_comp_factor = config[["leaflet_comp_factor"]], sources = config[["sources"]], - palettes = config[["palettes"]] + colors = config[["colors"]] ) } else { message(paste("To provide additional configurations, create an", @@ -142,7 +160,7 @@ sits_config <- function(processing_bloat = NULL, #' @export sits_config_show <- function(source = NULL, collection = NULL, - palette = NULL) { + colors = FALSE) { config <- sits_env$config @@ -177,14 +195,8 @@ sits_config_show <- function(source = NULL, list(names(x)) }) - } else if (!is.null(palette)) { - - .check_chr(palette, allow_empty = FALSE, len_min = 1, len_max = 1) - .check_chr_within(palette, - within = .config_palettes(), - discriminator = "one_of") - - config <- config[[c("palettes", palette)]] + } else if (colors) { + config <- config[["colors"]] } else config <- lapply(config, function(x) { if (is.atomic(x)) @@ -256,6 +268,8 @@ sits_list_collections <- function(source = NULL) { cat("(requires access token)") } + else + cat("- not opendata collection") cat("\n") cat("\n") }) @@ -268,15 +282,10 @@ sits_list_collections <- function(source = NULL) { raster_api_package = NULL, gdal_creation_options = NULL, gdalcubes_chunk_size = NULL, - local_s3_class = NULL, - local_file_extensions = NULL, - probs_cube_scale_factor = NULL, - probs_cube_data_type = NULL, - class_cube_data_type = NULL, leaflet_max_Mbytes = NULL, leaflet_comp_factor = NULL, sources = NULL, - palettes = NULL, ...) { + colors = NULL, ...) { # set caller to show in errors .check_set_caller(".config_set_options") @@ -328,39 +337,6 @@ sits_list_collections <- function(source = NULL) { msg = "Invalid gdalcubes chunk size") sits_env$config[["gdalcubes_chunk_size"]] <- gdalcubes_chunk_size } - - # process local_s3_class - if (!is.null(local_s3_class)) { - .check_chr(local_s3_class, allow_empty = FALSE, len_min = 1, - msg = "Invalid 'local_s3_class' parameter") - sits_env$config[["local_s3_class"]] <- local_s3_class - } - - # process local_file_extensions - if (!is.null(local_file_extensions)) { - .check_chr(local_file_extensions, - allow_empty = FALSE, len_min = 1, - msg = "Invalid 'local_file_extensions' parameter") - sits_env$config[["local_file_extensions"]] <- local_file_extensions - } - - # process probs cube scale factor - if (!is.null(probs_cube_scale_factor)) { - .check_num(probs_cube_scale_factor, - min = 0.0001, len_min = 1, len_max = 1, - msg = "Invalid 'probs_cube_scale_factor' parameter") - sits_env$config[["probs_cube_scale_factor"]] <- probs_cube_scale_factor - } - # process probs cube data type - if (!is.null(probs_cube_data_type)) { - .raster_data_type(probs_cube_data_type) - sits_env$config[["probs_cube_data_type"]] <- probs_cube_data_type - } - # process class cube data type - if (!is.null(class_cube_data_type)) { - .raster_data_type(class_cube_data_type) - sits_env$config[["class_cube_data_type"]] <- class_cube_data_type - } if (!is.null(leaflet_max_Mbytes)) { .check_num(leaflet_max_Mbytes, min = 16, @@ -377,7 +353,6 @@ sits_list_collections <- function(source = NULL) { msg = "Invalid leaflet_comp_factor") sits_env$config[["leaflet_comp_factor"]] <- leaflet_comp_factor } - # process sources if (!is.null(sources)) { .check_lst(sources, min_len = 1) @@ -411,14 +386,14 @@ sits_list_collections <- function(source = NULL) { ) } # check and initialize palettes - if (!is.null(palettes)) { - # initialize palettes - if (is.null(sits_env$config[["palettes"]])) - sits_env$config[["palettes"]] <- palettes - - sits_env$config[["palettes"]] <- utils::modifyList( - sits_env$config[["palettes"]], - palettes, + if (!is.null(colors)) { + # initialize colors + if (is.null(sits_env$config[["colors"]])) + sits_env$config[["colors"]] <- colors + # add colors + sits_env$config[["colors"]] <- utils::modifyList( + sits_env$config[["colors"]], + colors, keep.null = FALSE ) } @@ -435,33 +410,48 @@ sits_list_collections <- function(source = NULL) { } return(invisible(sits_env$config)) } -#' @title Get values from config file -#' @name config_functions +#' @title Return the default configuration file +#' @name config_file +#' @keywords internal +#' @return default configuration file #' -#' @description Functions that get values from config file. #' +.config_file <- function() { + + # load the default configuration file + yml_file <- system.file("extdata", "config.yml", package = "sits") + + # check that the file name is valid + .check_file(yml_file, msg = "invalid configuration file") + + return(yml_file) +} +#' @title Return the internal configuration file (only for developers) +#' @name config_internals_file #' @keywords internal +#' @return default configuration file #' -#' @param collection Collection to be searched in the data source. -#' @param data A sits data cube. -#' @param labels Vector with labels. -#' @param pallete The palette that should be chosen based on the -#' configuration file. -#' @param simplify A logical value that specifies whether the return should be -#' in vector form, if true, or list form, if false. Default value is FALSE. -#' @param source Source of data cube -#' @param ... Additional parameters. #' -#' @return Functions that search for values from a key or collection -#' return atomic values. Check functions return invisible null values or give -#' an error. -NULL +.config_internals_file <- function() { -#' @rdname config_functions -.config_file <- function() { + # load the default configuration file + yml_file <- system.file("extdata", "config_internals.yml", package = "sits") + + # check that the file name is valid + .check_file(yml_file, msg = "invalid configuration file") + + return(yml_file) +} +#' @title Return the default configuration file for colors +#' @name config_colors_file +#' @keywords internal +#' @return default configuration file +#' +#' +.config_colors_file <- function() { # load the default configuration file - yml_file <- system.file("extdata", "config.yml", package = "sits") + yml_file <- system.file("extdata", "config_colors.yml", package = "sits") # check that the file name is valid .check_file(yml_file, msg = "invalid configuration file") @@ -469,7 +459,10 @@ NULL return(yml_file) } -#' @rdname config_functions +#' @title Return the user configuration file +#' @name .config_user_file +#' @keywords internal +#' @return user configuration file .config_user_file <- function() { # load the default configuration file @@ -487,7 +480,10 @@ NULL return(yml_file) } -#' @rdname config_functions +#' @title Given a key, get config values +#' @name .config_get +#' @keywords internal +#' @return config values associated to a key .config_get <- function(key, default = NULL) { res <- tryCatch({ @@ -509,13 +505,11 @@ NULL return(res) } - - -#' @title Check cube collection +#' @title Check band availability #' @name .config_check_bands +#' @description Checks if the requested bands are available in the collection #' -#' @description A suite of check to verify collection in cube. -#' +#' @keywords internal #' @param source Data source #' @param collection Collection to be searched in the data source. #' @param bands Bands to be included. @@ -539,24 +533,13 @@ NULL # remove bands with equal names, like NDVI, EVI... source_bands <- source_bands[!source_bands %in% sits_bands] - # warning in case user provide source band - # GC: I consider this not to be necessary, skipping the message - if (FALSE) { - if (any(bands %in% source_bands)) - warning( - sprintf("Bands %s converted to sits names %s", - paste(bands, collapse = ", "), - paste( - .source_bands_to_sits(source = source, - collection = collection, - bands = bands), - collapse = ", ")), - call. = FALSE) - } - return(invisible(NULL)) } -#' @rdname config_functions +#' @title Check GEOTIFF creation options +#' @name .config_gtiff_default_options +#' @keywords internal +#' @return the creation options associated to the configuration +#' .config_gtiff_default_options <- function() { res <- .config_get(key = c("gdal_creation_options")) @@ -567,37 +550,32 @@ NULL return(res) } -#' @title meta-type for data +#' @title Check metatype associated to the data #' @name .config_data_meta_type #' @keywords internal -#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} -#' @param data tibble (time series or cube) +#' @description associates a valid SITS class to the data +#' +#' @param data time series or cube #' -#' @return file path to the appended to data_dir +#' @return an error if the meta data type is wrong .config_data_meta_type <- function(data) { # set caller to show in errors .check_set_caller(".config_data_meta_type") - if (inherits(data, c("sits", "patterns", "predicted", - "sits_model", "sits_cube", "raster_cube", - "probs_cube", "wtss_cube", "satveg_cube", - "stac_cube", "aws_cube"))) { + # if the data is one of the classes recognized by sits + if (inherits(data, .config_get("sits_s3_classes"))) { return(data) } else if (inherits(data, "tbl_df")) { - - if (all(c("source", "collection", - "tile", "bands", "labels", - "xmin", "xmax", "ymin", "ymax", "crs") + # is this a data cube or a sits tibble? + if (all(.config_get("sits_cube_cols") %in% colnames(data))) { - class(data) <- .cube_s3class(cube = data) + class(data) <- c("raster_cube", class(data)) return(data) - } else if (all(c("longitude", "latitude", "start_date", - "end_date", "label", "cube", - "time_series") %in% colnames(data))) { + } else if (all(.config_get("sits_tibble_cols") %in% colnames(data))) { class(data) <- c("sits", class(data)) return(data) @@ -608,8 +586,10 @@ NULL local_msg = "Data not recognized as a sits object", msg = "Invalid data parameter") } - -#' @rdname config_functions +#' @title Get local file extensions +#' @name .config_local_file_extension +#' @keywords internal +#' @return local file extensions known to sits .config_local_file_extensions <- function() { res <- .config_get(key = c("local_file_extensions")) @@ -620,8 +600,10 @@ NULL return(res) } - -#' @rdname config_functions +#' @title Get local S3 class +#' @name .config_local_s3_class +#' @keywords internal +#' @return classes associated to local cubes .config_local_s3_class <- function() { res <- .config_get(key = c("local_s3_class")) @@ -632,7 +614,11 @@ NULL return(res) } -#' @rdname config_functions +#' @title Get names associated to a configuration key +#' @name .config_names +#' @param key key combination to access config information +#' @keywords internal +#' @return names associated to the chosen access key .config_names <- function(key) { res <- tryCatch({ @@ -651,6 +637,16 @@ NULL return(res) } +#' @title Include a new source in the configuration +#' @name .config_new_source +#' @description creates a new data source in the config file +#' @param s3_class s3 class associated to the source +#' @param collections collections associated to the source +#' @param ... other parameters associated to the new source +#' @param service protocol associated to the source (e.g., "STAC") +#' @param url url associated to the endpoint of the service +#' @keywords internal +#' @return list with the configuration associated to the new source .config_new_source <- function(s3_class, collections, ..., service = NULL, @@ -699,7 +695,15 @@ NULL url = url, collections = collections), dots)) } - +#' @title Include a new collection in the configuration +#' @name .config_new_collection +#' @description creates a new collection associated to a source +#' @param bands bands associated to the collection +#' @param ... other relevant parameters +#' @param satellite satellite associated to the collection +#' @param sensor sensor associated to the collection +#' @keywords internal +#' @return list with the configuration associated to the new collection .config_new_collection <- function(bands, ..., satellite = NULL, sensor = NULL) { @@ -771,7 +775,20 @@ NULL # return a new collection data return(res) } - +#' @title Include a new band in the configuration +#' @name .config_new_band +#' @description creates a description associated to a new band +#' @param missing_value missing value +#' @param minimum_value minimum value +#' @param maximum_value maximum_value +#' @param scale_factor scale_factor associated with the data +#' @param offset_value offset_value for the band +#' @param band_name name of the band +#' @param resolution spatial resolution (in meters) +#' @param ... other relevant parameters +#' @keywords internal +#' @return list with the configuration associated to the new band +#' .config_new_band <- function(missing_value, minimum_value, maximum_value, @@ -823,7 +840,17 @@ NULL # return a band object return(res) } - +#' @title Include a new cloud band in the configuration +#' @name .config_new_cloud_band +#' @description creates a description associated to a new cloud band +#' @param bit_mask bit mask to describe clouds (if applicable) +#' @param value values of the cloud band +#' @param interp_values pixel values that need to be replaced by interpolation +#' @param resolution spatial resolution (in meters) +#' @param band_name name of the band +#' @param ... other relevant parameters +#' @keywords internal +#' @return list with the configuration associated to the new band .config_new_cloud_band <- function(bit_mask, values, interp_values, @@ -863,57 +890,67 @@ NULL # return a cloud band object return(res) } -#' @rdname config_functions -.config_palettes <- function() { - - res <- .config_names(key = "palettes") - - # post-condition - .check_chr(res, len_min = 1) - - return(res) -} - -#' @rdname config_functions -.config_palette_colors <- function(labels, ..., - palette = "default") { - - # pre-condition - .config_palette_check(palette = palette) - - # get the names of the colors in the chosen pallete - color_names <- .config_get(key = c("palettes", palette)) - - .check_chr_within( - x = labels, - within = names(color_names), - msg = "some labels are missing from the palette" - ) - colors <- color_names[labels] +#' @title Get colors associated to the labels +#' @name .config_colors +#' @param labels labels associated to the training classes +#' @param palette palette from `grDevices::hcl.pals()` +#' replaces default colors +#' when labels are not included in the config palette +#' @param rev revert the order of colors? +#' @keywords internal +#' @return colors required to display the labels +#' +.config_colors <- function(labels, + palette = "Harmonic", + rev = TRUE) { + + # ensure labels are unique + labels <- unique(labels) + # get the names of the colors in the chosen palette + colors_palette <- unlist(.config_get(key = "colors")) + # if labels are included in the config palette, use them + if (all(labels %in% names(colors_palette))) { + colors <- colors_palette[labels] + } + else { + labels_found <- labels[labels %in% names(colors_palette)] + if (length(labels_found) > round(length(labels)/2)) { + warning("Some labels are not available in the chosen palette", + call. = FALSE) + missing_labels <- unique(labels[!(labels %in% labels_found)]) + warning(paste0("Consider adjusting labels: ", missing_labels), + call. = FALSE) + } + else + warning("Most labels are not available in the chosen palette", + call. = FALSE) - # simplify - colors <- unlist(colors) + warning(paste0("Using hcl_color palette ", palette), + call. = FALSE) + # get the number of labels + n_labels <- length(unique(labels)) + # generate a set of hcl colors + colors <- grDevices::hcl.colors(n = n_labels, + palette = palette, + alpha = 1, + rev = rev) + names(colors) <- labels + } # post-condition .check_chr(colors, len_min = length(labels), len_max = length(labels), is_named = TRUE, - msg = "invalid 'color' values") + msg = "invalid color values") return(colors) } - -.config_palette_check <- function(palette) { - - # check if palette name exists - .check_chr(palette, len_min = 1, len_max = 1, - msg = "invalid 'palette' parameter") - .check_chr_within(palette, within = .config_palettes(), - msg = "invalid 'palette' parameter") -} - -#' @rdname config_functions +#' @title Retrieve the processing bloat +#' @name .config_processing_bloat +#' @keywords internal +#' @return estimated processing bloat +#' .config_processing_bloat <- function() { res <- .config_get(key = c("processing_bloat")) @@ -924,8 +961,11 @@ NULL return(res) } - -#' @rdname config_functions +#' @title Retrieve the rstac pagination limit +#' @name .config_rstac_limit +#' @keywords internal +#' @return pagination limit to rstac output +#' .config_rstac_limit <- function() { res <- .config_get(key = c("rstac_pagination_limit")) @@ -937,7 +977,11 @@ NULL return(res) } -#' @rdname config_functions +#' @title Retrieve the raster package to be used +#' @name .config_raster_pkg +#' @keywords internal +#' @return the raster package used to process raster data +#' .config_raster_pkg <- function() { res <- .config_get(key = c("raster_api_package")) diff --git a/R/sits_csv.R b/R/sits_csv.R index 14a90e409..ffc380fbf 100644 --- a/R/sits_csv.R +++ b/R/sits_csv.R @@ -56,53 +56,6 @@ sits_metadata_to_csv <- function(data, file) { return(invisible(file)) } - -#' @title Export a sits tibble data to the CSV format -#' -#' @name sits_data_to_csv -#' -#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} -#' -#' @description Converts time series data from a sits tibble to a CSV file. -#' The CSV file will not contain the metadata, -#' but only the actual time series, with a reference value. -#' This function is useful to export the data to external apps. -#' -#' @param data A tibble with time series data and metadata. -#' @param file Name of the exported CSV file. -#' -#' @return Status of the operation. -#' -#' @examples -#' # read a tibble with 400 samples of Cerrado and 346 samples of Pasture -#' data(cerrado_2classes) -#' # export a time series -#' csv_file <- paste0(tempdir(), "/cerrado_2classes.csv") -#' sits_data_to_csv(cerrado_2classes, file = csv_file) -#' -#' @export -#' -sits_data_to_csv <- function(data, file) { - - # set caller to show in errors - .check_set_caller("sits_data_to_csv") - - # check if data is valid - .sits_tibble_test(data) - - .check_that( - x = suppressWarnings(file.create(file)), - msg = "file is not writable." - ) - - distances <- .sits_distances(data) - - # write the CSV file - utils::write.csv(distances, file, row.names = FALSE, quote = FALSE) - - return(invisible(TRUE)) -} - #' @title Check if a CSV tibble is valid #' @name .sits_csv_check #' @keywords internal @@ -117,7 +70,7 @@ sits_data_to_csv <- function(data, file) { # check if required col names are available .check_chr_within( - x = c("longitude", "latitude", "start_date", "end_date", "label"), + x = .config_get("csv_sample_columns"), within = colnames(csv), msg = "invalid csv file") diff --git a/R/sits_cube.R b/R/sits_cube.R index fabbd2c63..123149982 100755 --- a/R/sits_cube.R +++ b/R/sits_cube.R @@ -1,4 +1,4 @@ -#' @title Defines a data cube +#' @title Create data cubes from image collections #' @name sits_cube #' #' @references `rstac` package (https://github.com/brazil-data-cube/rstac) @@ -51,8 +51,8 @@ #' For requester-pays data, users need to provide their access codes as #' environment variables, as follows: #' Sys.setenv( -#' "AWS_ACCESS_KEY_ID" = , -#' "AWS_SECRET_ACCESS_KEY" = +#' AWS_ACCESS_KEY_ID = , +#' AWS_SECRET_ACCESS_KEY = #' ) #' #' @note Sentinel-2/2A level 2A files in AWS are organized by sensor @@ -70,15 +70,15 @@ #' corresponds to Landsat Collection 2 Level-2 surface reflectance data, #' covering datasets from Landsat-4 to Landsat-8. This collection is open data. #' -#'@note All BDC collections have been regularized. +#' @note All BDC collections have been regularized. #' BDC users need to provide their credentials using environment #' variables. To create your credentials, please see -#' "https://brazildatacube.dpi.inpe.br/portal/explore". There is no -#' cost for accessing data in the BDC. -#' After obtaining the BDC access key, please include it as -#' an environment variable. +#' "https://brazildatacube.dpi.inpe.br/portal/explore". There is no +#' cost for accessing data in the BDC. +#' After obtaining the BDC access key, please include it as +#' an environment variable, as follows: #' Sys.setenv( -#' "BDC_ACCESS_KEY" = +#' BDC_ACCESS_KEY = #' ) #' #'@note To create a cube from local files, the user needs to inform: @@ -149,9 +149,9 @@ #' #' # --- Access to the Brazil Data Cube #' # Provide your BDC credentials as environment variables -#' Sys.setenv( -#' "BDC_ACCESS_KEY" = -#' ) +#' bdc_access_key <- Sys.getenv("BDC_ACCESS_KEY") +#' if (nchar(bdc_access_key) == 0) +#' stop("No BDC_ACCESS_KEY defined in environment.") #' #' # create a raster cube file based on the information in the BDC #' cbers_tile <- sits_cube( @@ -165,22 +165,22 @@ #' #' # --- Create a WTSS cube from BDC cubes #' # Provide your BDC credentials as environment variables -#' Sys.setenv( -#' "BDC_ACCESS_KEY" = -#' ) +#' bdc_access_key <- Sys.getenv("BDC_ACCESS_KEY") +#' if (nchar(bdc_access_key) == 0) +#' stop("No BDC_ACCESS_KEY defined in environment.") #' -#' cube_wtss <- sits::sits_cube(source = "WTSS", -#' collection = "MOD13Q1-6") +#' cube_wtss <- sits_cube(source = "WTSS", +#' collection = "MOD13Q1-6") #' #' # --- Access to Digital Earth Africa #' # create a raster cube file based on the information about the files #' cube_dea <- sits_cube(source = "DEAFRICA", #' collection = "s2_l2a", #' bands = c("B04", "B08"), -#' bbox = c("xmin" = 17.379, -#' "ymin" = 1.1573, -#' "xmax" = 17.410, -#' "ymax" = 1.1910), +#' roi = c("lat_min" = 17.379, +#' "lon_min" = 1.1573, +#' "lat_max" = 17.410, +#' "lon_max" = 1.1910), #' start_date = "2019-01-01", #' end_date = "2019-10-28" #' ) @@ -189,9 +189,9 @@ #' s2_cube <- sits_cube(source = "AWS", #' collection = "sentinel-s2-l2a-cogs", #' tiles = c("20LKP","20LLP"), -#' bands = c("B03", "B04", "B08"), +#' bands = c("B04", "B08", "B11"), #' start_date = as.Date("2018-07-18"), -#' end_date = as.Date("2018-07-23") +#' end_date = as.Date("2019-07-23") #' ) #' #' # --- Create a cube based on a local MODIS data @@ -214,7 +214,7 @@ sits_cube <- function(source, ..., collection, data_dir = NULL) { .check_set_caller("sits_cube") if (purrr::is_null(data_dir)) - source <- .source_new(source = source) + source <- .source_new(source = source, collection = collection) else source <- .source_new(source = source, is_local = TRUE) @@ -293,8 +293,8 @@ sits_cube.stac_cube <- function(source, # Pre-condition - checks if the bands are supported by the collection .config_check_bands(source = source, - collection = collection, - bands = bands) + collection = collection, + bands = bands) # dry run to verify if service is running .source_collection_access_test(source = source, ..., @@ -352,12 +352,6 @@ sits_cube.local_cube <- function(source, .source_check(source = source) .source_collection_check(source = source, collection = collection) - # precondition - check parse info - .check_chr(x = parse_info, - allow_empty = FALSE, - len_min = 2, - msg = "invalid parsing information.") - # precondition - does the parse info have band and date? .check_chr_contains( parse_info, @@ -397,7 +391,7 @@ sits_cube.satveg_cube <- function( # precondition .check_chr_within(x = collection, - within = c("TERRA", "AQUA", "COMB"), + within = .source_collections(source = "SATVEG"), msg = "invalid SATVEG collection.") # precondition - is service online? diff --git a/R/sits_cube_aux_functions.R b/R/sits_cube_aux_functions.R index c60e2318f..9696306e9 100644 --- a/R/sits_cube_aux_functions.R +++ b/R/sits_cube_aux_functions.R @@ -112,7 +112,8 @@ add_cloud = TRUE) { # all bands are upper case - .check_chr_within(bands, within = .cube_bands(cube = cube, + .check_chr_within(bands, + within = .cube_bands(cube = cube, add_cloud = add_cloud), case_sensitive = FALSE, msg = "invalid 'bands' parameter") diff --git a/R/sits_filters.R b/R/sits_filters.R index a4134bc91..f6471e26b 100644 --- a/R/sits_filters.R +++ b/R/sits_filters.R @@ -1,4 +1,4 @@ -#' @title General function for filtering +#' @title Filter time series and data cubes #' @name sits_filter #' #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} @@ -10,7 +10,6 @@ #' \itemize{ #' \item{Whittaker smoother - see \code{\link{sits_whittaker}}} #' \item{Savitsky-Golay filter - see \code{\link{sits_sgolay}}} -#' \item{Envelope filter - see \code{\link{sits_envelope}}} #' \item{Interpolation filter - see \code{\link{sits_interp}}} #' } #' @@ -39,182 +38,8 @@ sits_filter <- function(data, filter = sits_whittaker()) { # return a valid machine learning method return(result) } -#' @title Envelope filter -#' @name sits_envelope -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} -#' @description This function computes the envelope of a time series using the -#' streaming algorithm proposed by Lemire (2009). -#' This functions calls `dtwclust::compute_envelope` function. -#' @param data A tibble with time series data and metadata. -#' @param operations A character sequence for the sequence operations. -#' ("U" for upper filter, "L" for lower filter). -#' @param bands_suffix Suffix of the resulting data. -#' @return A tibble with filtered time series values. -#' @examples -#' # Select the NDVI band of a point in Mato Grosso -#' point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") -#' # Apply the envelope filter -#' point_env <- sits_envelope(point_ndvi) -#' # Merge the filtered with the raw data -#' point2 <- sits_merge(point_ndvi, point_env) -#' # Plot the result -#' plot(point2) -#' @export -sits_envelope <- function(data = NULL, - operations = "UULL", - bands_suffix = "env") { - - # set caller to show in errors - .check_set_caller("sits_envelope") - - # verifies if dtwclust package is installed - if (!requireNamespace("dtwclust", quietly = TRUE)) { - stop("Please install package dtwclust", call. = FALSE) - } - - filter_fun <- function(data) { - # definitions of operations - def_op <- list( - "U" = "upper", "L" = "lower", - "u" = "upper", "l" = "lower" - ) - - # split envelope operations - operations <- strsplit(operations, "")[[1]] - # verify if operations are either "U" or "L" - .check_chr_within( - x = operations, - within = names(def_op), - msg = "invalid operation sequence" - ) - - # compute envelopes - result <- sits_apply(data, - fun = function(band) { - for (op in operations) { - upper_lower <- dtwclust::compute_envelope(band, - window.size = 1, - error.check = FALSE - ) - band <- upper_lower[[def_op[[op]]]] - } - return(band) - }, - fun_index = function(band) band, - bands_suffix = bands_suffix - ) - return(result) - } - result <- .sits_factory_function(data, filter_fun) - return(result) -} - -#' @title Interpolation function of the time series of a sits_tibble -#' @name sits_interp -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} -#' @description Computes the linearly interpolated bands -#' using the R base function approx. -#' @param data A tibble with time series data and metadata. -#' @param fun Interpolation function. -#' @param n Number of time series elements to be created -#' between start date and end date. -#' When a class function is passed to `n`, -#' it is evaluated with each band time series as -#' an argument, e.g. n(band) (default: `length` function). -#' @param ... Additional parameters to be used by the fun function. -#' @return A tibble with same samples and the new bands. -#' @examples -#' # Retrieve a time series with values of NDVI -#' point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") -#' # find out how many time instances are there -#' n_times <- nrow(sits_time_series(point_ndvi)) -#' # interpolate three times more points -#' point_int.tb <- sits_interp(point_ndvi, fun = stats::spline, n = 3 * n_times) -#' # plot the result -#' plot(point_int.tb) -#' @export -sits_interp <- function(data = NULL, fun = stats::approx, - n = base::length, ...) { - filter_fun <- function(data) { - # compute linear approximation - result <- sits_apply(data, - fun = function(band) { - if (inherits(n, "function")) { - return(fun(band, n = n(band), ...)$y) - } - return(fun(band, n = n, ...)$y) - }, - fun_index = function(band) { - as.Date(fun(band, n = n, ...)$y, - origin = "1970-01-01" - ) - } - ) - return(result) - } - result <- .sits_factory_function(data, filter_fun) - return(result) -} -#' @title Interpolation function of the time series in a sits tibble -#' @name sits_linear_interp -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} -#' @description Computes the linearly interpolated bands for a given resolution -#' using the R base function approx. -#' @param data A tibble with time series data and metadata. -#' @param n Number of time series elements to be created -#' between start date and end date. -#' @return A sits tibble with same samples and the new bands. -#' @examples -#' # Retrieve a time series with values of NDVI -#' point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") -#' # find out how many time instances are there -#' n_times <- nrow(sits_time_series(point_ndvi)) -#' # interpolate three times more points -#' point_int.tb <- sits_linear_interp(point_ndvi, n = 3 * n_times) -#' # plot the result -#' plot(point_int.tb) -#' @export -sits_linear_interp <- function(data = NULL, n = 23) { - - filter_fun <- function(data) { - # compute linear approximation - result <- sits_apply(data, - fun = function(band) stats::approx(band, n = n, ties = mean)$y, - fun_index = function(band) { - as.Date(stats::approx(band, n = n, ties = mean)$y, - origin = "1970-01-01" - ) - } - ) - return(result) - } - result <- .sits_factory_function(data, filter_fun) - return(result) -} - -#' @title Remove missing values -#' @name sits_missing_values -#' @author Gilberto Camara, \email{gilberto.camara@inpe.br} -#' @description This function removes the missing values from -#' an image time series by substituting them by NA. -#' @param data A tibble with time series data and metadata. -#' @param miss_value Number indicating missing values in a time series. -#' @return Time series data and metadata (missing values removed). -#' @export -sits_missing_values <- function(data, miss_value) { - - # test if data has data - .sits_tibble_test(data) - - # remove missing values by NAs - result <- sits_apply(data, fun = function(band) { - return(ifelse(band == miss_value, NA, band)) - }) - return(result) -} - -#' @title Smooth the time series using Savitsky-Golay filter +#' @title Filter time series using Savitsky-Golay method #' #' @name sits_sgolay #' @description An optimal polynomial for warping a time series. @@ -265,10 +90,10 @@ sits_sgolay <- function(data = NULL, } if (inherits(data, "matrix")) { result <- apply(data, 2, function(row) { - .sits_signal_sgolayfilt(row, - p = order, - n = length, - ts = scaling + .sits_signal_sgolayfilt(row, + p = order, + n = length, + ts = scaling ) }) } @@ -279,7 +104,7 @@ sits_sgolay <- function(data = NULL, return(result) } -#' @title Filter the time series using Whittaker smoother +#' @title Filter time series using Whittaker smoother #' #' @name sits_whittaker #' @description The algorithm searches for an optimal warping polynomial. @@ -312,18 +137,18 @@ sits_whittaker <- function(data = NULL, lambda = 0.5, bands_suffix = "wf") { result <- NULL if (inherits(data, "tbl")) { result <- sits_apply(data, - fun = function(band) { - smooth_whit(band, lambda = lambda, length = length(band)) - }, - fun_index = function(band) band, - bands_suffix = bands_suffix + fun = function(band) { + smooth_whit(band, lambda = lambda, length = length(band)) + }, + fun_index = function(band) band, + bands_suffix = bands_suffix ) } if (inherits(data, "matrix")) { result <- apply( data, 2, function(row) { - smooth_whit(row, lambda = lambda, length = length(row)) + smooth_whit(row, lambda = lambda, length = length(row)) } ) } @@ -332,3 +157,43 @@ sits_whittaker <- function(data = NULL, lambda = 0.5, bands_suffix = "wf") { result <- .sits_factory_function(data, filter_fun) return(result) } + + +#' @title Interpolate values in time series +#' @name sits_interp +#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} +#' @description Computes the interpolated bands using a user-defined +#' function (by default the R base function approx) +#' @param data A tibble with time series data and metadata. +#' @param fun Interpolation function (by default, stats::approx()) +#' @param n Number of time series elements to be created +#' between start date and end date. +#' @param ... Additional parameters to be used by the fun function. +#' @return A tibble with interpolated samples. +#' @examples +#' # Retrieve a time series with values of NDVI +#' point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") +#' # find out how many time instances are there +#' n_times <- length(sits_timeline(point_ndvi)) +#' # interpolate three times more points +#' point_int.tb <- sits_interp(point_ndvi, fun = stats::spline, n = 3 * n_times) +#' # plot the result +#' plot(point_int.tb) +#' @export +sits_interp <- function(data, + fun = stats::approx, + n = 2 * length(sits_timeline(data)), ...) { + # compute function on data + result <- sits_apply(data, + fun = function(band) { + return(fun(band, n = n, ...)$y) + }, + fun_index = function(band) { + as.Date(fun(band, n = n, ...)$y, + origin = "1970-01-01" + ) + } + ) + return(result) + +} diff --git a/R/sits_gdalcubes.R b/R/sits_gdalcubes.R index b4ae7026d..d01dc686b 100644 --- a/R/sits_gdalcubes.R +++ b/R/sits_gdalcubes.R @@ -52,6 +52,22 @@ res = numeric(), path = character()) + # create a list of creation options and metadata + .get_gdalcubes_pack <- function(cube, band) { + + # returns the type that the file will write + format_type <- .source_collection_gdal_type( + .cube_source(cube = tile), + collection = .cube_collection(cube = tile) + ) + + list(type = format_type, + nodata = .cube_band_missing_value(cube = cube, band = band), + scale = 1, + offset = 0 + ) + } + for (band in .cube_bands(tile, add_cloud = FALSE)) { # create a raster_cube object to each band the select below change @@ -66,7 +82,9 @@ dir = output_dir, prefix = paste("cube", tile$tile, band, "", sep = "_"), creation_options = list("COMPRESS" = "LZW", "BIGTIFF" = "YES"), - write_json_descr = TRUE, ...) + pack = .get_gdalcubes_pack(tile, band), + write_json_descr = TRUE, ... + ) # retrieving image date images_date <- .gc_get_date(path_write) @@ -339,9 +357,6 @@ len_max = 1 ) - if (is.null(res)) - res <- tile[["xres"]][[1]] - bbox_roi <- sits_bbox(tile) if (!is.null(roi)) diff --git a/R/sits_get_data.R b/R/sits_get_data.R index d57214b11..6988a518d 100644 --- a/R/sits_get_data.R +++ b/R/sits_get_data.R @@ -1,16 +1,15 @@ -#' @title Obtain time series from different sources +#' @title Get time series from data cubes and cloud services #' @name sits_get_data #' @author Gilberto Camara #' #' @description Retrieve a set of time series from a data cube or from -#' a time series service. Data cubes -#' and puts it in a "sits tibble". +#' a time series service. Data cubes and puts it in a "sits tibble". #' Sits tibbles are the main structures of sits package. #' They contain both the satellite image time series and their metadata. #' A sits tibble is a tibble with pre-defined columns that #' has the metadata and data for each time series. The columns are #' . -#' There are many ways of retrieving time series: +#' There are three ways of retrieving time series: (a) #' \itemize{ #' \item{SATVEG:}{Retrieve data from SATVEG service using a lat/long point #' (see S3 method for class 'satveg_cube'), @@ -103,15 +102,14 @@ sits_get_data <- function(cube, # is there a shapefile or a CSV file? if (!purrr::is_null(file)) { - .check_file(file, extensions = c("csv", "shp"), - msg = "invalid file extension") # get the file extension file_ext <- tolower(tools::file_ext(file)) # sits only accepts "csv" or "shp" files .check_chr_within( x = file_ext, - within = c("csv", "shp"), - msg = "accepts only csv and shp files" + within = .config_get("sample_file_formats"), + msg = paste0("samples should be of type ", + paste(.config_get("sample_file_formats"), collapse = " or ")) ) # append "csv" or "shp" to the cube class to call the correct function class(cube) <- c(paste0(file_ext, "_", class(cube)[1]), diff --git a/R/sits_imputation.R b/R/sits_imputation.R index e84d81ad5..3e36e6178 100644 --- a/R/sits_imputation.R +++ b/R/sits_imputation.R @@ -1,4 +1,4 @@ -#' @title Linear imputation of NA values using C++ implementation +#' @title Replace NA values with linear interpolation #' @name sits_impute_linear #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' diff --git a/R/sits_indexes.R b/R/sits_indexes.R deleted file mode 100644 index 8c5adaff6..000000000 --- a/R/sits_indexes.R +++ /dev/null @@ -1,63 +0,0 @@ -#' @title Builds soil-adjusted vegetation index -#' @name sits_savi -#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} -#' @description Adds new tasseled cap bands. -#' @param data Valid sits tibble. -#' @return A sits tibble with the SAVI index. -#' @examples -#' # Retrieve data for time series with label samples in Mato Grosso in Brazil -#' data(samples_mt_6bands) -#' # Generate a new image with the tasseled cap -#' savi.tb <- sits_savi(samples_mt_6bands) -#' @export -sits_savi <- function(data) { - - # set caller to show in errors - .check_set_caller("sits_savi") - - bands <- sits_bands(data) - bands_savi <- c("NIR", "RED") - .check_chr_within( - x = bands_savi, - within = bands, - msg = "not enough bands to compute" - ) - - data <- sits_mutate_bands(data, - SAVI = (1.5) * (NIR - RED) / (NIR + RED + 0.5) - ) - - return(data) -} - -#' @title Builds normalized difference water index -#' @name sits_ndwi -#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} -#' @description Adds new tasseled cap bands. -#' @param data A valid sits tibble. -#' @return A sits tibble with the SAVI index. -#' @examples -#' -#' # Retrieve data for time series with label samples in Mato Grosso in Brazil -#' data(samples_mt_6bands) -#' # Generate a new image with the tasseled cap -#' ndwi.tb <- sits_ndwi(samples_mt_6bands) -#' @export -sits_ndwi <- function(data) { - - # set caller to show in errors - .check_set_caller("sits_ndwi") - - bands <- sits_bands(data) - bands_ndwi <- c("NIR", "MIR") - - .check_chr_within( - x = bands_ndwi, - within = bands, - msg = "not enough bands to compute." - ) - - data <- sits_mutate_bands(data, NDWI = (1.5) * (NIR - MIR) / (NIR + MIR)) - - return(data) -} diff --git a/R/sits_keras.R b/R/sits_keras.R index 81192846c..8aef43cc9 100644 --- a/R/sits_keras.R +++ b/R/sits_keras.R @@ -1,51 +1,3 @@ -#' @title Diagnostic information about a Keras deep learning model -#' @name sits_keras_diagnostics -#' -#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} -#' -#' @description After the Keras deeplearning model is compiled and fit, this -#' function provides access to the history plot -#' and the evaluation results. -#' -#' @param dl_model A valid keras model. -#' -#' @return This function returns NULL. It only prints the model diagnostics. -#' -#' @examples -#' \dontrun{ -#' # Retrieve the set of samples for the Mato Grosso (provided by EMBRAPA) -#' data(cerrado_2classes) -#' # obtain a DL model -#' dl_model <- sits_train( -#' cerrado_2classes, -#' sits_deeplearning( -#' layers = c(512, 512), dropout_rates = c(0.45, 0.25), -#' epochs = 100 -#' ) -#' ) -#' # run the keras diagnostics -#' sits_keras_diagnostics(dl_model) -#' } -#' @export -sits_keras_diagnostics <- function(dl_model) { - if (purrr::is_null(environment(dl_model)$model_keras)) { - message("Please configure a keras model before running this function") - return(FALSE) - } - - test_eval <- keras::evaluate(environment(dl_model)$model_keras, - environment(dl_model)$test_x, - environment(dl_model)$test_y, - verbose = 0 - ) - message("Estimated loss and accuracy based on test data") - message(paste0( - "Estimated accuracy: ", round(test_eval["accuracy"], digits = 3), - " estimated loss: ", round(test_eval["loss"], digits = 3) - )) - return(test_eval) -} - #' @title Adjust keras prediction for the binary classification case #' @name .sits_keras_binary_class #' @keywords internal diff --git a/R/sits_label_classification.R b/R/sits_label_classification.R index 4888a89be..229e10181 100644 --- a/R/sits_label_classification.R +++ b/R/sits_label_classification.R @@ -1,4 +1,4 @@ -#' @title Post-process a classified data raster probs to obtain a labelled image +#' @title Build a labelled image from a probability cube #' #' @name sits_label_classification #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} diff --git a/R/sits_labels.R b/R/sits_labels.R index 42e7bf07e..4e5211f37 100644 --- a/R/sits_labels.R +++ b/R/sits_labels.R @@ -1,13 +1,10 @@ -#' @title Returns the information about labels of a data set (tibble or cube) -#' +#' @title Get labels associated to a data set #' @name sits_labels #' #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} -#' #' @description Finds labels in a sits tibble or data cube #' #' @param data Valid sits tibble (time series or a cube) -#' #' @return A string vector with the labels. #' #' @examples @@ -72,3 +69,133 @@ sits_labels.sits_model <- function(data) { return(sits_labels.sits(environment(data)$data)) } +#' @title Change the labels of a set of time series +#' +#' @name `sits_labels<-` +#' +#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} +#' +#' @description Given a sits tibble with a set of labels, renames the labels +#' to the specified in value. +#' +#' @param data A sits tibble. +#' @param value A character vector used to convert labels. Labels will +#' be renamed to the respective value positioned at the +#' labels order returned by \code{\link{sits_labels}}. +#' +#' @return A sits tibble with modified labels. +#' +#' @examples +#' # Read a set of time series with information on deforestation +#' data("samples_modis_4bands") +#' # Print the labels +#' sits_labels(samples_modis_4bands) +#' # Create a conversion list. +#' # relabel the data +#' sits_labels(samples_modis_4bands) <- c("Natural", "Natural", +#' "Anthropic", "Anthropic") +#' # show the new labels +#' sits_labels(samples_modis_4bands) +#' +#' @export +#' +`sits_labels<-` <- function(data, value) { + + # set caller to show in errors + .check_set_caller("sits_labels") + + # get the meta-type (sits or cube) + data <- .config_data_meta_type(data) + + UseMethod("sits_labels<-", data) +} + +#' @export +#' +`sits_labels<-.sits` <- function(data, value) { + + # does the input data exist? + .sits_tibble_test(data) + + labels <- sits_labels(data) + + # check if value is an atomic vector + .check_chr_type(x = value, + msg = "value must be a character vetor") + + # check if length is correct + .check_length( + x = labels, + len_max = length(value), + len_min = length(value), + msg = "informed labels have a different expected length" + ) + + # check if there are no NA + .check_that( + x = all(!is.na(value)), + msg = "invalid values to replace labels" + ) + + # check if there are empty strings + .check_that( + x = any(trimws(value) != ""), + msg = "invalid values to replace labels" + ) + + names(value) <- labels + + data$label <- value[data$label] + + return(data) +} +#' @export +#' +`sits_labels<-.probs_cube` <- function(data, value) { + # precondition + n_labels <- length(sits_labels(data)) + .check_chr(value, len_min = n_labels, + msg = "not enough new labels to replace current ones") + rows <- slider::slide_dfr(data, function(row){ + row$labels <- list(value) + return(row) + }) +} + +#' @title Inform label distribution of a set of time series +#' @name sits_labels_summary +#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} +#' @description Describes labels in a sits tibble +#' +#' @param data Valid sits tibble +#' +#' @return A tibble with labels frequency. +#' +#' @examples +#' # read a tibble with 400 samples of Cerrado and 346 samples of Pasture +#' data(cerrado_2classes) +#' # print the labels +#' sits_labels_summary(cerrado_2classes) +#' +#' @export +#' +sits_labels_summary <- function(data) { + + UseMethod("sits_labels_summary", data) +} + +#' @export +#' +sits_labels_summary.sits <- function(data) { + + # get frequency table + data_labels <- table(data$label) + + # compose tibble containing labels, count and relative frequency columns + result <- tibble::as_tibble(list( + label = names(data_labels), + count = as.integer(data_labels), + prop = as.numeric(prop.table(data_labels)) + )) + return(result) +} diff --git a/R/sits_labels_set.R b/R/sits_labels_set.R deleted file mode 100644 index 8ed24cf76..000000000 --- a/R/sits_labels_set.R +++ /dev/null @@ -1,88 +0,0 @@ -#' @title Change labels of a sits tibble -#' -#' @name `sits_labels<-` -#' -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} -#' -#' @description Given a sits tibble with a set of labels, renames the labels -#' to the specified in value. -#' -#' @param data A sits tibble. -#' @param value A character vector used to convert labels. Labels will -#' be renamed to the respective value positioned at the -#' labels order returned by \code{\link{sits_labels}}. -#' -#' @return A sits tibble with modified labels. -#' -#' @examples -#' # Read a set of time series with information on deforestation -#' data("samples_modis_4bands") -#' # Print the labels -#' sits_labels(samples_modis_4bands) -#' # Create a conversion list. -#' # relabel the data -#' sits_labels(samples_modis_4bands) <- c("Natural", "Natural", -#' "Anthropic", "Anthropic") -#' # show the new labels -#' sits_labels(samples_modis_4bands) -#' -#' @export -#' -`sits_labels<-` <- function(data, value) { - - # set caller to show in errors - .check_set_caller("sits_labels") - - # get the meta-type (sits or cube) - data <- .config_data_meta_type(data) - - UseMethod("sits_labels<-", data) -} - -#' @export -#' -`sits_labels<-.sits` <- function(data, value) { - - # does the input data exist? - .sits_tibble_test(data) - - labels <- sits_labels(data) - - # check if value is an atomic vector - .check_chr_type(x = value, - msg = "value must be a character vetor") - - # check if length is correct - .check_length( - x = labels, - len_max = length(value), - len_min = length(value), - msg = "informed labels have a different expected length" - ) - - # check if there are no NA - .check_that( - x = all(!is.na(value)), - msg = "invalid labels value" - ) - - # check if there are empty strings - .check_that( - x = any(trimws(value) != ""), - msg = "invalid labels value" - ) - - names(value) <- labels - - data$label <- value[data$label] - - return(data) -} - -#' @export -#' -`sits_labels<-.pattern` <- function(data, value) { - - return(`sits_labels<-.pattern`(data, value)) -} - diff --git a/R/sits_labels_summary.R b/R/sits_labels_summary.R deleted file mode 100644 index 8bce7e14e..000000000 --- a/R/sits_labels_summary.R +++ /dev/null @@ -1,40 +0,0 @@ -#' @title Returns the information about labels of a tibble data set -#' -#' @name sits_labels_summary -#' -#' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} -#' -#' @description Finds labels in a sits tibble -#' -#' @param data Valid sits tibble -#' -#' @return A tibble with labels frequency. -#' -#' @examples -#' # read a tibble with 400 samples of Cerrado and 346 samples of Pasture -#' data(cerrado_2classes) -#' # print the labels -#' sits_labels_summary(cerrado_2classes) -#' -#' @export -#' -sits_labels_summary <- function(data) { - - UseMethod("sits_labels_summary", data) -} - -#' @export -#' -sits_labels_summary.sits <- function(data) { - - # get frequency table - data_labels <- table(data$label) - - # compose tibble containing labels, count and relative frequency columns - result <- tibble::as_tibble(list( - label = names(data_labels), - count = as.integer(data_labels), - prop = as.numeric(prop.table(data_labels)) - )) - return(result) -} diff --git a/R/sits_machine_learning.R b/R/sits_machine_learning.R index 24b53815d..1f101e5b1 100644 --- a/R/sits_machine_learning.R +++ b/R/sits_machine_learning.R @@ -1,4 +1,4 @@ -#' @title Train sits classification models +#' @title Train classification models #' @name sits_train #' #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} @@ -26,7 +26,7 @@ #' @examples #' # Retrieve the set of samples for Mato Grosso (provided by EMBRAPA) #' # fit a training model (RFOR model) -#' samples <- sits_select(samples_mt_6bands, bands = c("NDVI")) +#' samples <- sits_select(samples_modis_4bands, bands = c("NDVI")) #' ml_model <- sits_train(samples, sits_rfor(num_trees = 100)) #' # get a point and classify the point with the ml_model #' point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") @@ -65,7 +65,7 @@ sits_train <- function(data, ml_method = sits_svm()) { return(result) } -#' @title Train a sits classification model using multinomial log-linear +#' @title Train multinomial log-linear models #' @name sits_mlr #' #' @author Alexandre Ywata de Carvalho, \email{alexandre.ywata@@ipea.gov.br} @@ -160,7 +160,7 @@ sits_mlr <- function(data = NULL, formula = sits_formula_linear(), return(result) } -#' @title Train a SITS classifiction model using random forest algorithm +#' @title Train random forest models #' @name sits_rfor #' #' @author Alexandre Ywata de Carvalho, \email{alexandre.ywata@@ipea.gov.br} @@ -238,7 +238,7 @@ sits_rfor <- function(data = NULL, num_trees = 200, nodesize = 1, ...) { result <- .sits_factory_function(data, result_fun) return(result) } -#' @title Train a sits classification model using a support vector machine +#' @title Train support vector machine models #' @name sits_svm #' #' @author Alexandre Ywata de Carvalho, \email{alexandre.ywata@@ipea.gov.br} @@ -360,7 +360,7 @@ sits_svm <- function(data = NULL, formula = sits_formula_logref(), } -#' @title Train a model with an extreme gradient boosting machine +#' @title Train extreme gradient boosting models #' @name sits_xgboost #' #' @author Alexandre Ywata de Carvalho, \email{alexandre.ywata@@ipea.gov.br} diff --git a/R/sits_mlp.R b/R/sits_mlp.R index e04d94c2f..a33fbd8b3 100644 --- a/R/sits_mlp.R +++ b/R/sits_mlp.R @@ -1,4 +1,4 @@ -#' @title Train a deep learning model using multi-layer perceptron +#' @title Train multi-layer perceptron models #' @name sits_mlp #' #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} @@ -105,10 +105,9 @@ sits_mlp <- function(samples = NULL, x = length(activation) == 1, msg = "use only one activation function" ) - valid_activations <- c("relu", "elu", "selu", "sigmoid") .check_chr_within( x = activation, - within = valid_activations, + within = .config_get("dl_activation_methods"), discriminator = "any_of", msg = "invalid node activation method" ) diff --git a/R/sits_patterns.R b/R/sits_patterns.R index 81e638bb1..4bf727037 100644 --- a/R/sits_patterns.R +++ b/R/sits_patterns.R @@ -1,4 +1,4 @@ -#' @title Create temporal patterns using a generalised additive model (gam) +#' @title Find temporal patterns associated to a set of time series #' @name sits_patterns #' @author Victor Maus, \email{vwmaus1@@gmail.com} #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} @@ -14,8 +14,7 @@ #' based on a smooth function. #' #' This method is based on the "createPatterns" method of the dtwSat package, -#' which is also -#' described in the reference paper. +#' which is also described in the reference paper. #' #' @references Maus V, Camara G, Cartaxo R, Sanchez A, Ramos F, Queiroz GR. #' A Time-Weighted Dynamic Time Warping Method for Land-Use diff --git a/R/sits_plot.R b/R/sits_plot.R index 7c9e54db0..7f31e2732 100644 --- a/R/sits_plot.R +++ b/R/sits_plot.R @@ -1,4 +1,4 @@ -#' @title Generic interface for ploting time series +#' @title Plot time series #' @method plot sits #' @name plot #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} @@ -30,8 +30,6 @@ #' @param x object of class "sits" #' @param y ignored #' @param ... further specifications for \link{plot}. -#' @param colors Color palette to be used (based on Color Brewer -#' - default is "Dark2"). #' @return The plot itself. #' #' @examples @@ -45,21 +43,21 @@ #' #' @export #' -plot.sits <- function(x, y, ..., colors = "Dark2") { +plot.sits <- function(x, y, ...) { stopifnot(missing(y)) # Are there more than 30 samples? Plot them together! if (nrow(x) > 30) { - p <- .sits_plot_together(x, colors) + p <- .sits_plot_together(x) } # If no conditions are met, take "allyears" as the default else { - p <- .sits_plot_allyears(x, colors) + p <- .sits_plot_allyears(x) } # return the plot return(invisible(p)) } -#' @title Generic interface for ploting patterns +#' @title Plot patterns that describe classes #' @name plot.patterns #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @description Given a sits tibble with a set of patterns, plot them. @@ -84,7 +82,7 @@ plot.patterns <- function(x, y, ...) { return(invisible(p)) } -#' @title Generic interface for ploting time series predictions +#' @title Plot time series predictions #' @name plot.predicted #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @description Given a sits tibble with a set of predictions, plot them @@ -93,6 +91,8 @@ plot.patterns <- function(x, y, ...) { #' @param y ignored #' @param ... further specifications for \link{plot}. #' @param bands bands used for visualisation +#' @param palette hcl palette used for visualisation +#' (in case classes are not in the default sits palette) #' @return The plot itself. #' #' @examples @@ -109,12 +109,14 @@ plot.patterns <- function(x, y, ...) { #' #' @export #' -plot.predicted <- function(x, y, ..., bands = "NDVI") { +plot.predicted <- function(x, y, ..., + bands = "NDVI", + palette = "Harmonic") { stopifnot(missing(y)) - p <- .sits_plot_classification(x, bands) + p <- .sits_plot_predicted_ts(x, bands, palette) return(invisible(p)) } -#' @title Generic interface for RGB plotting of data cube +#' @title Plot RGB data cubes #' @name plot.raster_cube #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @@ -243,7 +245,7 @@ plot.raster_cube <- function(x, ..., return(invisible(rgb)) } -#' @title Generic interface for plotting probability cubes +#' @title Plot probability cubes #' @name plot.probs_cube #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @description plots a probability cube using stars @@ -252,11 +254,9 @@ plot.raster_cube <- function(x, ..., #' @param y ignored #' @param ... further specifications for \link{plot}. #' @param time temporal reference for plot. -#' @param breaks type of breaks #' @param title string. -#' @param colors color palette. -#' @param n_colors number of colors. #' @param labels labels to plot (optional) +#' @param palette hcl palette used for visualisation #' #' @return The plot itself. #' @@ -264,21 +264,23 @@ plot.raster_cube <- function(x, ..., #' plot.probs_cube <- function(x, y, ..., time = 1, title = "Probabilities for Classes", - breaks = "kmeans", - colors = "YlGnBu", - n_colors = 10, - labels = NULL) { + labels = NULL, + palette = "Terrain") { stopifnot(missing(y)) # verifies if stars package is installed if (!requireNamespace("stars", quietly = TRUE)) { stop("Please install package stars.", call. = FALSE) } + breaks <- "pretty" + n_colors <- 20 + n_breaks <- n_colors + 1 # define the output color palette - col <- grDevices::hcl.colors(10, colors, rev = TRUE) + col <- grDevices::hcl.colors(n = n_colors, palette = palette, + alpha = 1, rev = TRUE) # create a stars object st <- stars::read_stars(x$file_info[[1]]$path[[time]]) # get the labels - labels_cube <- x$labels[[1]] + labels_cube <- sits_labels(x) # verify if label is not NULL if (!purrr::is_null(labels)) { @@ -287,15 +289,15 @@ plot.probs_cube <- function(x, y, ..., time = 1, p <- st %>% dplyr::slice(index = layers, along = "band") %>% plot(breaks = breaks, - nbreaks = 11, + nbreaks = n_breaks, col = col, main = labels) %>% - suppressWarnings() + suppressMessages() } else { - p <- suppressWarnings(plot(st, + p <- suppressMessages(plot(st, breaks = breaks, - nbreaks = 11, + nbreaks = n_breaks, col = col, main = labels_cube) ) @@ -305,18 +307,19 @@ plot.probs_cube <- function(x, y, ..., time = 1, } -#' @title Generic interface for ploting classified images +#' @title Plot classified images #' @name plot.classified_image #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @description plots a classified raster using ggplot. #' -#' @param x object of class "classified_image" -#' @param y ignored -#' @param ... further specifications for \link{plot}. -#' @param time temporal reference for plot. -#' @param title Title of the plot -#' @param legend named vector that associates labels to colors -#' @param palette palette provided in the configuration file +#' @param x object of class "classified_image" +#' @param y ignored +#' @param ... further specifications for \link{plot}. +#' @param time temporal reference for plot. +#' @param title title of the plot +#' @param legend named vector that associates labels to colors +#' @param palette alternative palette that uses grDevices::hcl.pals() +#' @param rev invert the order of hcl palette (TRUE/FALSE) #' #' @export #' @@ -324,18 +327,20 @@ plot.classified_image <- function(x, y, ..., time = 1, title = "Classified Image", legend = NULL, - palette = "default") { + palette = "Spectral", + rev = TRUE) { stopifnot(missing(y)) p <- .sits_plot_classified_image(cube = x, time = time, title = title, legend = legend, - palette = palette) + palette = palette, + rev = rev) } -#' @title Plot information about confusion between clusters +#' @title Plot confusion between clusters #' @name plot.som_evaluate_cluster #' @author Lorena Santos \email{lorena.santos@@inpe.br} #' @@ -352,7 +357,7 @@ plot.classified_image <- function(x, y, ..., #' \dontrun{ #' # Produce a cluster map #' -#' samples_mt_2bands <- sits_select(samples_mt_6bands, bands = c("NDVI", "EVI")) +#' samples_mt_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) #' som_map <- sits_som_map(samples_mt_2bands) #' # Evaluate the clusters #' cluster_overall <- sits_som_evaluate_cluster(som_map) @@ -369,7 +374,7 @@ plot.som_evaluate_cluster <- function(x, y, ..., p <- .sits_plot_som_evaluate_cluster(x, name_cluster, title) return(invisible(p)) } -#' @title Generic interface for plotting a SOM map +#' @title Plot a SOM map #' @name plot.som_map #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @description plots a SOM map generated by "sits_som_map" @@ -384,14 +389,14 @@ plot.som_evaluate_cluster <- function(x, y, ..., #' @param ... Further specifications for \link{plot}. #' @param type Type of plot: "codes" for neuron weight (time series) and #' "mapping" for the number of samples allocated in a neuron. -#' @param whatmap What data layer will be plotted. +#' @param band What band will be plotted. #' #' @return The plot itself. #' #' @examples #' \dontrun{ #' # Produce a cluster map -#' samples_mt_2bands <- sits_select(samples_mt_6bands, bands = c("NDVI", "EVI")) +#' samples_mt_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) #' som_map <- sits_som_map(samples_mt_2bands) #' # Plot the clusters #' plot(som_map, type = "codes") @@ -401,12 +406,12 @@ plot.som_evaluate_cluster <- function(x, y, ..., #' #' @export #' -plot.som_map <- function(x, y, ..., type = "codes", whatmap = 1) { +plot.som_map <- function(x, y, ..., type = "codes", band = 1) { stopifnot(missing(y)) - .sits_plot_som_map(x, type, whatmap) + .sits_plot_som_map(x, type, band) } -#' @title Generic interface for plotting a Keras model +#' @title Plot Keras (deep learning) model #' @name plot.keras_model #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @description plots a deep learning model developed using keras @@ -417,7 +422,7 @@ plot.som_map <- function(x, y, ..., type = "codes", whatmap = 1) { #' @return The plot itself. #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Get a set of samples #' samples_ndvi_evi <- sits_select(samples_modis_4bands, #' bands = c("NDVI", "EVI")) @@ -441,15 +446,14 @@ plot.keras_model <- function(x, y, ...) { #' @description For each lat/long location in the data, join temporal #' instances of the same place together for plotting. #' @param data One or more time series (stored in a sits tibble). -#' @param colors The color palette to be used (default is "Set2"). -.sits_plot_allyears <- function(data, colors) { +.sits_plot_allyears <- function(data) { locs <- dplyr::distinct(data, longitude, latitude) plots <- purrr::pmap( list(locs$longitude, locs$latitude), function(long, lat) { dplyr::filter(data, longitude == long, latitude == lat) %>% - .sits_plot_ggplot_series(colors) %>% + .sits_plot_ggplot_series() %>% graphics::plot() } ) @@ -516,9 +520,8 @@ plot.keras_model <- function(x, y, ...) { #' the time series for a given label. #' #' @param data A sits tibble with the list of time series to be plotted. -#' @param colors The color palette to be used (default is "Set1"). #' @return The plot itself. -.sits_plot_together <- function(data, colors) { +.sits_plot_together <- function(data) { # create a data frame with the median, and 25% and 75% quantiles create_iqr <- function(dt, band) { data.table::setnames(dt, band, "V1") @@ -622,14 +625,13 @@ plot.keras_model <- function(x, y, ...) { #' for showing the same lat/long location in a series of time steps. #' #' @param row row of a sits tibble with the time series to be plotted. -#' @param colors brewer colors to be used for plotting. #' @return The plot itself. -.sits_plot_ggplot_series <- function(row, colors = "Dark2") { +.sits_plot_ggplot_series <- function(row) { # Are there NAs in the data? if (any(is.na(row$time_series[[1]]))) { - g <- .sits_plot_ggplot_series_na(row, colors) + g <- .sits_plot_ggplot_series_na(row) } else { - g <- .sits_plot_ggplot_series_no_na(row, colors) + g <- .sits_plot_ggplot_series_no_na(row) } return(g) } @@ -642,13 +644,14 @@ plot.keras_model <- function(x, y, ...) { #' has no NA values. #' #' @param row row of a sits tibble with the time series to be plotted. -#' @param colors brewer colors to be used for plotting. #' @return The plot itself. -.sits_plot_ggplot_series_no_na <- function(row, colors = "Dark2") { +.sits_plot_ggplot_series_no_na <- function(row) { # create the plot title plot_title <- .sits_plot_title(row$latitude, row$longitude, row$label) + # + colors <- grDevices::hcl.colors(n = 20, palette = "Harmonic", alpha = 1, rev = TRUE) # extract the time series - data_ts <- row$time_series[[1]] + data_ts <- dplyr::bind_rows(row$time_series) # melt the data into long format melted_ts <- data_ts %>% tidyr::pivot_longer(cols = -Index, names_to = "variable") %>% @@ -661,7 +664,7 @@ plot.keras_model <- function(x, y, ...) { )) + ggplot2::geom_line(ggplot2::aes(color = variable)) + ggplot2::labs(title = plot_title) + - ggplot2::scale_color_brewer(palette = colors) + ggplot2::scale_fill_manual(palette = colors) return(g) } #' @title Plot one timeSeries wih NAs using ggplot @@ -672,9 +675,8 @@ plot.keras_model <- function(x, y, ...) { #' @description Plots a set of time series using ggplot, showing where NAs are. #' #' @param row row of a sits tibble with the time series to be plotted. -#' @param colors brewer colors to be used for plotting. #' @return The plot itself. -.sits_plot_ggplot_series_na <- function(row, colors = "Dark2") { +.sits_plot_ggplot_series_na <- function(row) { # verifies if tidyr package is installed if (!requireNamespace("tidyr", quietly = TRUE)) { @@ -774,17 +776,18 @@ plot.keras_model <- function(x, y, ...) { return(title) } -#' @title Plot classification results -#' @name .sits_plot_classification +#' @title Plot time series classification results +#' @name .sits_plot_predicted_ts #' @keywords internal #' @author Victor Maus, \email{vwmaus1@@gmail.com} #' @description plots the classification results #' (code reused from the dtwSat package by Victor Maus). #' @param data sits tibble with classified time series. #' @param bands band for plotting the classification. +#' @param palette hcl palette used for visualisation #' #' @return The plot itself. -.sits_plot_classification <- function(data, bands = NULL) { +.sits_plot_predicted_ts <- function(data, bands, palette) { # verifies if scales package is installed if (!requireNamespace("scales", quietly = TRUE)) { @@ -793,6 +796,14 @@ plot.keras_model <- function(x, y, ...) { if (purrr::is_null(bands)) { bands <- sits_bands(data) } + if (!all(bands %in% sits_bands(data))) + bands <- sits_bands(data) + # configure plot colors + # get labels from predicted tibble + labels <- unique(data$predicted[[1]]$class) + colors <- .config_colors(labels = labels, + palette = palette, + rev = FALSE) # put the time series in the data frame g_lst <- purrr::pmap( @@ -872,7 +883,7 @@ plot.keras_model <- function(x, y, ...) { ), alpha = .7 ) + - ggplot2::scale_fill_brewer(palette = "Set3") + + ggplot2::scale_fill_manual(values = colors) + ggplot2::geom_line( data = df_x, ggplot2::aes_string( @@ -881,6 +892,7 @@ plot.keras_model <- function(x, y, ...) { colour = "variable" ) ) + + ggplot2::scale_color_brewer(palette = "Set1") + ggplot2::scale_y_continuous( expand = c(0, 0), breaks = y_breaks, @@ -913,16 +925,16 @@ plot.keras_model <- function(x, y, ...) { #' @description Plot a dendrogram #' #' @param data sits tibble with data used to extract the dendrogram. -#' @param cluster_obj cluster object produced by `sits_cluster` function. +#' @param cluster cluster object produced by `sits_cluster` function. #' @param cutree_height dashed horizontal line to be drawn #' indicating the height of dendrogram cutting. -#' @param colors color scheme as per .sits_brewer_color_name` function. +#' @param palette hcl color palette #' #' @return The plot itself. .sits_plot_dendrogram <- function(data, - cluster_obj, - cutree_height = NULL, - colors = "RdYlGn") { + cluster, + cutree_height, + palette) { # set caller to show in errors .check_set_caller(".sits_plot_dendrogram") @@ -937,48 +949,35 @@ plot.keras_model <- function(x, y, ...) { } # ensures that a cluster object exists .check_null( - x = cluster_obj, + x = cluster, msg = "no valid cluster object available" ) - # get unique labels + # get data labels data_labels <- data$label - u_lb <- base::unique(data_labels) - - # warns if the number of available colors is insufficient to all labels - if (length(u_lb) > ( - length(.sits_brewer_rgb[[.sits_brewer_color_name(colors)]]) - 1)) { - message("The number of labels is greater than the number of available", - "colors.") - } # extract the dendrogram object - hclust_cl <- methods::S3Part(cluster_obj, strictS3 = TRUE) + hclust_cl <- methods::S3Part(cluster, strictS3 = TRUE) dend <- hclust_cl %>% stats::as.dendrogram() - # prepare labels color vector - cols <- character(length(data_labels)) - cols[] <- grDevices::rgb(0 / 255, 0 / 255, 0 / 255, 0 / 255) + # colors vector + colors <- .config_colors(labels = data_labels, + palette = palette, + rev = TRUE) + colors_clust <- colors[data_labels] + + # set the visualisation params for dendrogram + dend <- dend %>% + dendextend::set( + what = "labels", + value = character(length = length(data_labels))) %>% + dendextend::set( + what = "branches_k_color", + value = colors_clust, + k = length(data_labels)) - i <- 1 - seq(u_lb) %>% - purrr::map(function(i) { - cols[data_labels[cluster_obj$order] == u_lb[i]] <<- - .sits_brewer_rgb[[.sits_brewer_color_name(colors)]][[length(u_lb)]][[i]] - i <<- i + 1 - }) - - # plot the dendrogram - dend <- dendextend::set( - dend, "labels", - character(length = length(data_labels)) - ) - dend <- dendextend::set(dend, "branches_k_color", - value = cols, - k = length(data_labels) - ) p <- graphics::plot(dend, ylab = paste( - tools::file_path_sans_ext(cluster_obj@method), + tools::file_path_sans_ext(cluster@method), "linkage distance" ) ) @@ -989,10 +988,8 @@ plot.keras_model <- function(x, y, ...) { # plot legend graphics::legend("topright", - fill = as.character( - .sits_brewer_rgb[[.sits_brewer_color_name(colors)]][[length(u_lb)]] - ), - legend = u_lb + fill = colors, + legend = sits_labels(data) ) return(invisible(p)) } @@ -1012,9 +1009,9 @@ plot.keras_model <- function(x, y, ...) { #' #' @param koh SOM map produced by "sits_som_map" function #' @param type Type of plot ("codes" or "mapping") -#' @param whatmap What data layer will be plotted. +#' @param band What band will be plotted #' -.sits_plot_som_map <- function(koh, type = "codes", whatmap = 1) { +.sits_plot_som_map <- function(koh, type = "codes", band = 1) { # Sanity check if (!inherits(koh, "som_map")) { message("wrong input data; please run sits_som_map first") @@ -1023,14 +1020,14 @@ plot.keras_model <- function(x, y, ...) { if (type == "mapping") { graphics::plot(koh$som_properties, bgcol = koh$som_properties$paint_map, - "mapping", whatmap = whatmap, + "mapping", whatmap = band, codeRendering = "lines" ) } else if (type == "codes") { graphics::plot(koh$som_properties, bgcol = koh$som_properties$paint_map, - "codes", whatmap = whatmap, + "codes", whatmap = band, codeRendering = "lines" ) } @@ -1062,7 +1059,7 @@ plot.keras_model <- function(x, y, ...) { #' The percentage of mixture between the clusters. #' #' @param data Percentage of mixture between the clusters -#' @param name_cluster Choose the cluster to plot +#' @param cluster_name Choose the cluster to plot #' @param title Title of plot. #' #' @return ggplot2 object @@ -1078,6 +1075,13 @@ plot.keras_model <- function(x, y, ...) { if (!(is.null(cluster_name))) { data <- dplyr::filter(data, cluster %in% cluster_name) } + # configure plot colors + # get labels from cluster table + labels <- unique(data$class) + colors <- .config_colors(labels = labels, + palette = "Spectral", + rev = TRUE) + p <- ggplot2::ggplot() + ggplot2::geom_bar( ggplot2::aes( @@ -1093,7 +1097,7 @@ plot.keras_model <- function(x, y, ...) { ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1)) + ggplot2::labs(x = "Cluster", y = "Percentage of mixture") + - ggplot2::scale_fill_discrete(name = "Class label") + + ggplot2::scale_fill_manual(name = "Class label", values = colors) + ggplot2::ggtitle(title) p <- graphics::plot(p) @@ -1107,16 +1111,18 @@ plot.keras_model <- function(x, y, ...) { #' @description plots a raster using ggplot. This function is used #' for showing the same lat/long location in a series of time steps. #' -#' @param cube A tibble with the metadata for a labelled data cube. -#' @param time Temporal reference for plot. -#' @param title Title of the plot -#' @param legend named vector that associates labels to colors. -#' @param palette palette provided in the configuration file +#' @param cube metadata for a labelled data cube. +#' @param time temporal reference for plot. +#' @param title title of the plot +#' @param legend named vector that associates labels to colors. +#' @param palette palette (one of grDevices::hcl.pals()) +#' @param rev revert the order of hcl palette (TRUE/FALSE) .sits_plot_classified_image <- function(cube, time, title, legend, - palette) { + palette, + rev) { # set caller to show in errors @@ -1149,7 +1155,9 @@ plot.keras_model <- function(x, y, ...) { # if colors are not specified, get them from the configuration file if (purrr::is_null(legend)) { - colors <- .config_palette_colors(labels, palette = palette) + colors <- .config_colors(labels = labels, + palette = palette, + rev = rev) } else { .check_chr_within( @@ -1166,7 +1174,8 @@ plot.keras_model <- function(x, y, ...) { g <- ggplot2::ggplot(df, ggplot2::aes(x, y)) + ggplot2::geom_raster(ggplot2::aes(fill = factor(class))) + ggplot2::labs(title = title) + - ggplot2::scale_fill_manual(values = colors, labels = labels, + ggplot2::scale_fill_manual(values = colors, + labels = labels, guide = ggplot2::guide_legend( title = "Classes") ) diff --git a/R/sits_raster_api.R b/R/sits_raster_api.R index 4211fb3fb..d75dd2962 100644 --- a/R/sits_raster_api.R +++ b/R/sits_raster_api.R @@ -105,15 +105,12 @@ #' @return character string .raster_data_type <- function(data_type) { - # allowed data types - valid_data_types <- c("INT1U", "INT2U", "INT2S", "INT4U", - "INT4S", "FLT4S", "FLT8S") # check data type .check_chr_within( x = data_type, - within = valid_data_types, + within = .config_get("valid_raster_data_types"), msg = paste(".raster_data_type: valid data types are", - paste0("'", valid_data_types, "'", collapse = ", ")) + paste0("'", .config_get("valid_raster_data_types"), "'", collapse = ", ")) ) # check package diff --git a/R/sits_raster_api_raster.R b/R/sits_raster_api_raster.R index cb9f1d625..d2143769a 100644 --- a/R/sits_raster_api_raster.R +++ b/R/sits_raster_api_raster.R @@ -1,4 +1,4 @@ - +# nocov start #' @keywords internal #' @export .raster_check_package.raster <- function() { @@ -317,4 +317,4 @@ # raster package resample names return(c("ngb", "bilinear")) } - +# nocov end diff --git a/R/sits_raster_data.R b/R/sits_raster_data.R index 52118df07..cb27ec2c4 100644 --- a/R/sits_raster_data.R +++ b/R/sits_raster_data.R @@ -245,9 +245,8 @@ msg = "need a valid metadata for data cube" ) - names <- c("longitude", "latitude", "label") .check_chr_within( - x = names, + x = .config_get("csv_sample_columns"), within = colnames(points), msg = "data input is not valid" ) diff --git a/R/sits_regularize.R b/R/sits_regularize.R index 1ec320d65..faf5c03d4 100644 --- a/R/sits_regularize.R +++ b/R/sits_regularize.R @@ -1,4 +1,4 @@ -#' @title Creates a regularized data cube from an irregular one +#' @title Build a regular data cube from an irregular one #' #' @name sits_regularize #' @@ -15,15 +15,9 @@ #' \dontrun{ #' #' # --- Access to the AWS STAC -#' # Provide your AWS credentials as environment variables -#' Sys.setenv( -#' "AWS_ACCESS_KEY_ID" = , -#' "AWS_SECRET_ACCESS_KEY" = -#' ) #' #' # define an AWS data cube #' s2_cube <- sits_cube(source = "AWS", -#' name = "T20LKP_2018_2019", #' collection = "sentinel-s2-l2a-cogs", #' bands = c("B08", "SCL"), #' tiles = c("20LKP"), @@ -40,6 +34,7 @@ #' period = "P1M", #' agg_method = "median", #' resampling = "bilinear", +#' res = 60, #' cloud_mask = TRUE) #' } #' } @@ -59,9 +54,8 @@ #' @param multicores A \code{numeric} with the number of cores will be used in #' the regularize. By default is used 1 core. #' @param agg_method A \code{character} with method that will be applied by -#' \code{gdalcubes} for aggregation. -#' Options: \code{min}, \code{max}, \code{mean}, \code{median} and -#' \code{first}. +#' \code{gdalcubes} for aggregation. Options: \code{min}, \code{max}, +#' \code{mean}, \code{median} and \code{first}. Default is \code{median}. #' @param resampling A \code{character} with method to be used by #' \code{gdalcubes} for resampling in mosaic operation. #' Options: \code{near}, \code{bilinear}, \code{bicubic} or others supported by @@ -81,13 +75,13 @@ #' @export sits_regularize <- function(cube, output_dir, - period = NULL, - res = NULL, - roi = NULL, + period, + res = NULL, + roi = NULL, agg_method = "median", resampling = "bilinear", cloud_mask = TRUE, - multicores = 1) { + multicores = 2) { # set caller to show in errors .check_set_caller("sits_regularize") @@ -102,35 +96,69 @@ sits_regularize <- function(cube, msg = "sits_regularize not available for collection ", cube$collection, " from ", cube$source ) - - .check_num( - x = multicores, - allow_zero = FALSE, - min = 1, - msg = "invalid 'multicores' parameter." - ) - - # setting in global env multicores options - gdalcubes::gdalcubes_options(threads = multicores) - - # test if provided object its a sits cube + # precondition - test if provided object is a raster cube .check_that( x = inherits(cube, "raster_cube"), msg = paste("provided cube is invalid,", "please provide a 'raster_cube' object.", "see '?sits_cube' for more information.") ) - - # fix slashes for windows + # precondition - check output dir fix output_dir <- normalizePath(output_dir) - # verifies the path to save the images .check_that( x = dir.exists(output_dir), msg = "invalid 'output_dir' parameter." ) - + # append gdalcubes path path_db <- paste0(output_dir, "/gdalcubes.db") + # precondition - is the period valid? + .check_na(lubridate::duration(period), msg = "invalid period specified") + + # precondition - is the resolution valid? + # is there a single resolution? Is not, "res" needs to be set + if (length(unique(cube$file_info[[1]]$res)) > 1) { + .check_num(x = res, + allow_zero = FALSE, + min = 1, + len_min = 1, + len_max = 1, + msg = "a valid resolution needs to be provided") + } + # precondition - is the aggregation valid? + .check_chr_within( + x = agg_method, + within = .config_get("gdalcubes_aggreg_methods"), + discriminator = "any_of", + msg = "invalid aggregation method" + ) + # precondition - is the resampling valid? + .check_chr_within( + x = resampling, + within = .config_get("gdalcubes_resampling_methods"), + discriminator = "any_of", + msg = "invalid resampling method" + ) + # precondition - is the cloud mask valid? + .check_lgl_type(cloud_mask, msg = "cloud mask parameter should be TRUE/FALSE") + # if the cloud mask is true, is there a cloud band? + if (cloud_mask) { + .check_chr_contains( + x = sits_bands(cube), + contains = "CLOUD", + msg = "no cloud band available in the cube" + ) + } + # precondition - is the multicores valid? + .check_num( + x = multicores, + allow_zero = FALSE, + min = 1, + msg = "invalid 'multicores' parameter." + ) + + # setting in global env multicores options + gdalcubes::gdalcubes_options(threads = multicores) if (!is.null(roi)) { diff --git a/R/sits_shp.R b/R/sits_shp.R index 97f3ce781..0de457a03 100644 --- a/R/sits_shp.R +++ b/R/sits_shp.R @@ -151,10 +151,10 @@ # precondition - can the function deal with the geometry_type? .check_chr_within( x = as.character(geom_type), - within = c("POINT", "POLYGON", "MULTIPOLYGON"), + within = .config_get("sf_geom_types_supported"), discriminator = "one_of", - msg = paste("only handles POINT, POLYGON or", - "MULTIPOLYGON shapefiles") + msg = paste0("only handles shapefiles of types", + .config_get("sf_geom_types_supported")) ) # precondition - is the default label valid? diff --git a/R/sits_signal.R b/R/sits_signal.R index 9b914b24d..ba4a1e936 100644 --- a/R/sits_signal.R +++ b/R/sits_signal.R @@ -1,13 +1,33 @@ -# sits interface to the "signal" package +# Sits interface to the "signal" package +# +# The "signal" package is A set of signal processing functions originally written for +# 'Matlab' and 'Octave'. Includes filter generation utilities, +# filtering functions, resampling routines, and visualization of +# filter models. It also includes interpolation functions. +# +# Further information on "signal" +# Authors: Uwe Ligges [aut, cre] (new maintainer), +# Tom Short [aut], Paul Kienzle [aut], Sarah Schnackenberg [ctb], +# David Billinghurst [ctb], Hans-Werner Borchers [ctb], +# Andre Carezia [ctb], Pascal Dupuis [ctb], John W. Eaton [ctb], +# E. Farhi [ctb], Kai Habel [ctb], Kurt Hornik [ctb], +# Sebastian Krey [ctb], Bill Lash [ctb], Friedrich Leisch [ctb], +# Olaf Mersmann [ctb], Paulo Neis [ctb], Jaakko Ruohio [ctb], +# Julius O. Smith III [ctb], Doug Stewart [ctb], +# Andreas Weingessel [ctb] +# Maintainer: Uwe Ligges -# the Savitsky-Golay filter of the "signal" package has been +# The code on this file has been lifted from the "signal" package + +# The Savitsky-Golay filter of the "signal" package has been # lifted to be part of "sits" and thus reduce the package load # Since signal is licensed as GPL >= 2, # sits is also licensed as GPL >= 2 #' @title Savitsky-Golay smoothing filter #' @name .sits_signal_sgolayfilt -#' @author Gilberto Camara +#' +#' @keywords internal #' #' @description Smooth the data in x with a Savitsky-Golay smoothing filter of #' polynomial order p and length n, n odd, n > p. By default, p=3 @@ -42,8 +62,7 @@ } #' @title Savitsky-Golay smoothing filter coefficients -#' @name .sits_signal_sgolayfilt -#' @author Gilberto Camara +#' @name .sits_signal_sgolay #' #' @description Computes the filter coefficients for all Savitzky-Golay smoothing #' filters of order p for length n (odd). m can be used in order to @@ -55,6 +74,8 @@ #' based on the i-1 preceding values and the n-i following values of x #' values as y(k) = F(i,:) * x(k-i+1:k+n-i). #' +#' @keywords internal +#' #' @param p Filter order (integer). #' @param n Filter length (must be odd) #' @param m Derivative to calculate (default = 0) @@ -117,6 +138,8 @@ #' #' @description Calculates the Moore-Penrose generalized inverse of a matrix X. #' +#' @keywords internal +#' #' @param X Matrix for which the Moore-Penrose inverse is required. #' @param tol A relative tolerance to detect zero singular values. #' @return A MP generalized inverse matrix for X. diff --git a/R/sits_smooth.R b/R/sits_smooth.R index 0f729a7a7..871395838 100644 --- a/R/sits_smooth.R +++ b/R/sits_smooth.R @@ -1,4 +1,4 @@ -#' @title Post-process a classified data raster probs using smoothing +#' @title Smooth probability cubes with spatial predictors #' #' @name sits_smooth #' diff --git a/R/sits_som.R b/R/sits_som.R index 850d9d8cc..9df9bc9f5 100644 --- a/R/sits_som.R +++ b/R/sits_som.R @@ -1,94 +1,43 @@ -#' @title Clustering a set of satellite image time series using SOM -#' @name sits_som_cluster +#' @title Use SOM for quality analysis of time series samples +#' @name sits_som +#' #' @author Lorena Alves, \email{lorena.santos@@inpe.br} #' @author Karine Ferreira. \email{karine.ferreira@@inpe.br} -#' @description This function uses self-organized maps to find clusters in -#' satellite image time series for quality control of the samples. -#' Calls \code{\link[sits]{sits_som_map}} to generate the som map and -#' \code{\link[sits]{sits_som_clean_samples}} to produce a clean set of samples. -#' The parameters "grid_xdim", "grid_ydim", "rlen", "distance", "alpha", and -#' "iterations" are used by \code{\link[sits]{sits_som_map}} to control -#' how the Kohonen map is generated. -#' The parameters "prior_threshold" and "posterior_threshold" control -#' how the good quality samples are selected, based on the Kohonen map. #' -#' @references `kohonen` package (https://CRAN.R-project.org/package=kohonen) +#' @description These function use self-organized maps to perform +#' quality analysis in satellite image time series #' -#' @param data A tibble with samples to be clustered. -#' @param grid_xdim X dimension of the SOM grid (default = 25). -#' @param grid_ydim Y dimension of the SOM grid. -#' @param alpha Starting learning rate, -#' which decreases according to number of iterations. -#' @param distance The similarity measure (distance). -#' @param rlen How many times dataset will be presented to the SOM. -#' @param prior_threshold Threshold of priot probability -#' (frequency of samples assigned to a same SOM neuron) -#' @param posterior_threshold Threshold of posterior probability -#' (influenced by the SOM neighborhood) -#' @param som_radius Radius of neighborhood on the SOM map -#' (controls the size of the neighbourhood) -#' @return A sits tibble with an evaluation column indicating if -#' each samples is clean, should be analyzed or -#' should be removed, and with a new column indicating -#' the posterior probability of the sample -#' @examples -#' \dontrun{ -#' # Evaluate the quality of the samples using SOM clustering -#' new_samples <- sits_som_cluster(samples_modis_4bands) -#' } -#' @export -sits_som_cluster <- function(data, - grid_xdim = 10, - grid_ydim = 10, - alpha = 1.0, - distance = "euclidean", - rlen = 100, - prior_threshold = 0.6, - posterior_threshold = 0.6, - som_radius = 2) { - - # generate a som map where each neuron is associated to one or - # more samples - som_map <- sits_som_map( - data, - grid_xdim, - grid_ydim, - alpha, - rlen, - distance, - som_radius - ) - plot(som_map) - # clean the data based on the prior and posterior probabilities - data_clean <- sits_som_clean_samples( - som_map, - prior_threshold, - posterior_threshold - ) - - return(data_clean) -} -#' @title Generate a Kohonen map for sample quality control -#' @name sits_som_map -#' @author Lorena Alves, \email{lorena.santos@@inpe.br} -#' @author Karine Ferreira. \email{karine.ferreira@@inpe.br} +#' \code{sits_som_map()} creates a SOM map, where high-dimensional data +#' is mapped into a two dimensional map, keeping the topological relations +#' between data patterns. Each sample is assigned to a neuron, +#' and neurons are placed in the grid based on similarity. #' -#' @description This function uses package self-organized maps -#' to find clusters in satellite image time series to cluster the samples. -#' It also evaluates the quality of each sample using SOM properties. +#' \code{sits_som_evaluate_cluster()} analyses the neurons of the SOM map, +#' and builds clusters based on them. Each cluster is a neuron +#' or a set of neuron categorized with same label. +#' It produces a tibble with the percentage of mixture of classes +#' in each cluster. +#' +#' \code{sits_som_clean_samples()} evaluates the quality of the samples +#' based on the results of the SOM map. The algorithm identifies noisy samples, +#' using `prior_threshold` for the prior probability +#' and `posterior_threshold` for the posterior probability. +#' Each sample receives an evaluation tag, according to the following rule: +#' (a) If the prior probability is < `prior_threshold`, the sample is tagged as "remove"; +#' (b) If the prior probability is >= `prior_threshold` and the posterior probability +#' is >=`posterior_threshold`, the sample is tagged as "clean"; +#' (c) If the prior probability is >= `posterior_threshold` and +#' the posterior probability is < `posterior_threshold`, the sample is tagged as "analyze" for further inspection. +#' The user can define which tagged samples will be returned using the "keep" +#' parameter, with the following options: "clean", "analyze", "remove". #' -#' The results is a list with three members: -#' (1) the samples tibble, with one additional column indicating -#' to which neuron it has been mapped; -#' (2) the Kohonen map, used for plotting and cluster quality measures; -#' (3) a tibble with the labelled neurons, -#' where each class of each neuron is associated to two values: -#' (a) the prior probability that this class belongs to a cluster -#' based on the frequency of samples of this class allocated to the neuron; -#' (b) the posterior probability that this class belongs to a cluster, -#' using data for the neighbours on the SOM map. #' -#' @references `kohonen` package (https://CRAN.R-project.org/package=kohonen) +#' @references +#' Lorena Santos, Karine Ferreira, Gilberto Camara, Michelle Picoli, +#' Rolf Simoes, “Quality control and class noise reduction of satellite +#' image time series”. ISPRS Journal of Photogrammetry and Remote Sensing, +#' vol. 177, pp 75-88, 2021. https://doi.org/10.1016/j.isprsjprs.2021.04.014. +#' #' #' @param data A tibble with samples to be clustered. #' @param grid_xdim X dimension of the SOM grid (default = 25). @@ -99,19 +48,42 @@ sits_som_cluster <- function(data, #' @param rlen Number of iterations to produce the SOM. #' @param som_radius Radius of SOM neighborhood #' @param mode Type of learning algorithm (default = "online") -#' @return A list of tibbles containing statistics -#' about the samples and the neuron in each iteration. - +#' @param som_map An object returned by \code{\link[sits]{sits_som_map}} +#' @param prior_threshold Threshold of conditional probability +#' (frequency of samples assigned to the same SOM neuron) +#' @param posterior_threshold Threshold of posterior probability +#' (influenced by the SOM neighborhood) +#' @param keep Which types of evaluation to be maintained in the data #' #' @examples #' \dontrun{ #' # Produce a cluster map -#' som_cluster <- sits_som_map(samples_modis_4bands) +#' som_map <- sits_som_map(samples_modis_4bands) #' # plot the som map -#' plot(som_cluster) +#' plot(som_map) +#' # calculate the mixture inside clusters +#' eval <- sits_som_evaluate_cluster(som_map) +#' # plot the cluster evaluation +#' plot(eval) #' # Clean the samples to get better quality ones -#' clean_samples <- sits_som_clean_samples(som_cluster) +#' clean_samples <- sits_som_clean_samples(som_map) #' } +#' +#' + +#' @rdname sits_som +#' @return +#' \code{sits_som_map()} prodices a list with three members: +#' (1) the samples tibble, with one additional column indicating +#' to which neuron each sample has been mapped; +#' (2) the Kohonen map, used for plotting and cluster quality measures; +#' (3) a tibble with the labelled neurons, +#' where each class of each neuron is associated to two values: +#' (a) the prior probability that this class belongs to a cluster +#' based on the frequency of samples of this class allocated to the neuron; +#' (b) the posterior probability that this class belongs to a cluster, +#' using data for the neighbours on the SOM map. +#' #' @export sits_som_map <- function(data, grid_xdim = 10, @@ -229,54 +201,14 @@ sits_som_map <- function(data, return(som_map) } -#' @title Clean samples -#' @name sits_som_clean_samples -#' @author Lorena Santos, \email{lorena.santos@@inpe.br} -#' @author Karine Ferreira. \email{karine.ferreira@@inpe.br} -#' -#' @description This function evaluate the quality of the samples -#' based on the results of the SOM map. It produces -#' a sits tibble with an evaluation column indicating if +#' @rdname sits_som +#' @return +#' \code{sits_som_clean_samples()} produces +#' a sits tibble with an two additional columns.The first indicates if #' each sample is clean, should be analyzed or -#' should be removed, and with a new column indicating +#' should be removed. The second indicates #' the posterior probability of the sample #' -#' @param som_map An object returned -#' by \code{\link[sits]{sits_som_map}} -#' @param prior_threshold Threshold of conditional probability -#' (frequency of samples assigned to the same SOM neuron) -#' @param posterior_threshold Threshold of posterior probability -#' (influenced by the SOM neighborhood) -#' @param keep Samples evaluation to be maintained in the data -#' -#' @return List with two sits tibbles. -#' The first tibble has clean samples -#' The second has samples that need to be analysed. -#' -#' @note -#' The algorithm identifies noisy samples, using `prior_threshold` for -#' the prior probability and `posterior_threshold` for the posterior probability. -#' Each sample receives an evaluation tag, according to the following rule: -#' (a) If the prior probability is < `prior_threshold`, the sample is tagged as "remove"; -#' (b) If the prior probability is >= `prior_threshold` and the posterior probability -#' is >=`posterior_threshold`, the sample is tagged as "clean"; -#' (c) If the prior probability is >= `posterior_threshold` and -#' the posterior probability is < `posterior_threshold`, -#' the sample is tagged as "analyze" for further inspection. -#' -#' The user can define which tagged samples will be returned using the "keep" -#' parameter, with the following options: "clean", "analyze", "remove". -#' -#' @examples -#' \dontrun{ -#' # Read a set of samples -#' # Get a new subset of samples evaluated by clustering methods -#' som_map <- sits_som_map(samples_modis_4bands, -#' grid_xdim = 10, grid_ydim = 10, -#' distance = "euclidean" -#' ) -#' new_samples <- sits_som_clean_samples(som_map) -#' } #' @export sits_som_clean_samples <- function(som_map, prior_threshold = 0.6, @@ -293,7 +225,7 @@ sits_som_clean_samples <- function(som_map, } .check_chr_within( x = keep, - within = c("clean", "analyze", "remove"), + within = .config_get("som_outcomes"), msg = "invalid keep parameter" ) @@ -317,31 +249,12 @@ sits_som_clean_samples <- function(som_map, return(data) } -#' @title Evaluate cluster -#' @name sits_som_evaluate_cluster -#' @author Lorena Santos, \email{lorena.santos@@inpe.br} -#' @author Karine Ferreira. \email{karine.ferreira@@inpe.br} -#' -#' @description This function evaluate the clusters created by -#' SOM. Each cluster is a neuron or a set of neuron categorized with same label. -#' It produces a sits tibble indicating the percentage of mixture -#' of classes in each cluster. +#' @rdname sits_som #' -#' @param som_map An object returned -#' by \code{\link[sits]{sits_som_map}} -#' @return A tibble with the cluster and the percentage of classes -#' mixtured in each cluster. - -#' @examples -#' \dontrun{ -#' # Read a set of samples -#' # Get a new subset of samples evaluated by clustering methods -#' som_map <- sits_som_map(samples_modis_4bands, -#' grid_xdim = 10, grid_ydim = 10, -#' distance = "euclidean" -#' ) -#' cluster_purity <- sits_som_evaluate_cluster(som_map) -#' } +#' @return +#' \code{sits_som_evaluate_cluster()} produces a tibble with the clusters +#' found by the SOM map. For each cluster, ir provides the percentage +#' of classes inside it. #' @export sits_som_evaluate_cluster <- function(som_map) { # Sanity check @@ -446,7 +359,7 @@ sits_som_evaluate_cluster <- function(som_map) { } else { label_neuron <- tibble::tibble( id_neuron = as.numeric(i), - label_samples = "NoSamples", + label_samples = "No_Samples", count = 0, prior_prob = 0 ) @@ -557,32 +470,14 @@ sits_som_evaluate_cluster <- function(som_map) { #' colour of the neuron. #' .sits_som_paint_neurons <- function(kohonen_obj) { - # set colors to paint neurons - pallete1 <- .sits_brewer_rgb[[.sits_brewer_color_name("Set1")]] - set1 <- utils::head(unique(unlist(pallete1, use.names = FALSE)), -1) - pallete2 <- .sits_brewer_rgb[[.sits_brewer_color_name("Accent")]] - accent <- utils::head(unique(unlist(pallete2, use.names = FALSE)), -1) + # assign one color per unique label - pallete3 <- .sits_brewer_rgb[[.sits_brewer_color_name("Pastel1")]] - pastel1 <- utils::head(unique(unlist(pallete3, use.names = FALSE)), -1) + colors <- .config_colors(labels = kohonen_obj$neuron_label, + palette = "Spectral", + rev = TRUE) - # build a mixed pallete with different colors - pallete <- c(accent, pastel1, set1) - - # unique label - labels <- unique(kohonen_obj$neuron_label) - - # Paint - colors <- kohonen_obj$neuron_label %>% - purrr::map(function(label) { - if (label == "NoSamples") { - return("White") - } else { - return(pallete[which(labels == label)]) - } - }) - kohonen_obj$paint_map <- unlist(colors) + kohonen_obj$paint_map <- unname(colors[kohonen_obj$neuron_label]) return(kohonen_obj) } diff --git a/R/sits_source_api.R b/R/sits_source_api.R index 06b82364c..923f3c1ad 100644 --- a/R/sits_source_api.R +++ b/R/sits_source_api.R @@ -59,7 +59,7 @@ NULL #' @return \code{.source_new()} returns a \code{character} vector with the #' S3 class defined in source's \code{S3class} attribute. #' -.source_new <- function(source, is_local = FALSE) { +.source_new <- function(source, collection = NULL, is_local = FALSE) { # if local, return local cube if (is_local) { @@ -69,11 +69,13 @@ NULL # source name is upper case classes <- .source_s3class(source = toupper(source)) - # if (!is.null(collection)) - # classes <- c(paste(classes, tolower(collection), sep = "_"), classes) - class(source) <- c(classes, class(source)) + if (!is.null(collection)) { + classes <- c(paste(classes, tolower(collection), sep = "_"), classes) + class(source) <- c(classes, class(source)) + } + return(source) } @@ -626,6 +628,29 @@ NULL # return the gdal format file path system.file(paste0("extdata/gdalcubes/", gdal_config), package = "sits") } + +#' @rdname source_collection +#' +#' @description \code{.source_collection_gdal_type()} checks if a collection +#' has a gdalcubes type for writing files. +#' +#' @return \code{.source_collection_gdal_type()} returns the gdal type. +.source_collection_gdal_type <- function(source, collection){ + + # try to find the gdalcubes configuration type for this collection + gdal_format <- .config_get(key = c("sources", source, "collections", + collection, "gdalcubes_type_format"), + default = NA) + + # if the format does not exist, report to the user + .check_that(!(is.na(gdal_format)), + msg = paste0("no type was found for collection ", collection, + " and source ", source, + ". Please raise an issue in github")) + + # return the gdal format file path + return(gdal_format) +} #' @rdname source_collection #' #' @description \code{.source_collection_name()} returns the name of a @@ -804,7 +829,7 @@ NULL #' metadata. #' .source_cube <- function(source, ..., collection) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_cube", source) } @@ -869,7 +894,7 @@ NULL #' of a sits cube. #' .source_items_new <- function(source, ..., collection) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_new", source) } @@ -887,7 +912,7 @@ NULL #' \code{items} with selected bands. #' .source_items_bands_select <- function(source, ..., collection, items, bands) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_bands_select", source) } @@ -900,7 +925,7 @@ NULL #' sits cube. #' .source_items_fileinfo <- function(source, ..., items, collection = NULL) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_fileinfo", source) } @@ -913,7 +938,7 @@ NULL #' items. #' .source_items_tiles_group <- function(source, ..., items, collection = NULL) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_tiles_group", source) } @@ -965,7 +990,7 @@ NULL .source_items_tile_get_crs <- function(source, ..., tile_items, collection = NULL) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_tile_get_crs", source) } @@ -980,7 +1005,7 @@ NULL .source_items_tile_get_name <- function(source, ..., tile_items, collection = NULL) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_tile_get_name", source) } @@ -995,7 +1020,7 @@ NULL .source_items_tile_get_bbox <- function(source, ..., tile_items, collection = NULL) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_tile_get_bbox", source) } @@ -1010,6 +1035,6 @@ NULL collection, items, file_info) { - source <- .source_new(source) + source <- .source_new(source = source, collection = collection) UseMethod(".source_items_cube", source) } diff --git a/R/sits_source_api_mspc.R b/R/sits_source_api_mspc.R new file mode 100644 index 000000000..2aa2371ca --- /dev/null +++ b/R/sits_source_api_mspc.R @@ -0,0 +1,250 @@ +#' @keywords internal +#' @export +.source_collection_access_test.mspc_cube <- function(source, ..., + collection, bands, + dry_run = TRUE) { + # require package + if (!requireNamespace("rstac", quietly = TRUE)) { + stop("Please install package rstac", call. = FALSE + ) + } + + items_query <- .stac_items_query(source = source, + collection = collection, + limit = 1) + + # assert that service is online + tryCatch({ + items <- rstac::post_request(items_query, ...) + }, error = function(e) { + stop(paste(".source_collection_access_test.stac_cube: service is", + "unreachable\n", e$message), call. = FALSE) + }) + + # signing the url with the mspc token + items <- suppressWarnings( + rstac::items_sign(items, sign_fn = rstac::sign_planetary_computer()) + ) + + items <- .source_items_bands_select(source = source, ..., + collection = collection, + items = items, + bands = bands[[1]]) + + href <- .source_item_get_hrefs(source = source, ..., + item = items$feature[[1]], + collection = collection) + + # assert that token and/or href is valid + if (dry_run) + tryCatch({ + .raster_open_rast(href) + }, error = function(e) { + stop(paste(".source_collection_access_test.stac_cube: cannot", + "open url\n", href, "\n", e$message), call. = FALSE) + }) + + + return(invisible(NULL)) +} + +#' @keywords internal +#' @export +`.source_items_new.mspc_cube_sentinel-2-l2a` <- function(source, ..., + collection, + stac_query, + tiles = NULL) { + + # set caller to show in errors + .check_set_caller(".source_items_new.mspc_cube_sentinel-2-l2a") + + # if specified, a filter per tile is added to the query + if (!is.null(tiles)) { + + items_list <- lapply(tiles, function(tile) { + + stac_query <- rstac::ext_query( + q = stac_query, "s2:mgrs_tile" == tile + ) + + # making the request + items_info <- rstac::post_request(q = stac_query, ...) + + # check if matched items + .check_that( + x = rstac::items_length(items_info) > 0, + msg = "no items matched the query criteria." + ) + + # fetching all the metadata + suppressWarnings( + rstac::items_fetch(items = items_info, progress = FALSE) + ) + }) + + # getting the first item info + items_info <- items_list[[1]] + + # joining the items + items_info$features <- do.call( + c, args = lapply(items_list, `[[`, "features") + ) + } else { + items_info <- rstac::post_request(q = stac_query, ...) + + # check if matched items + .check_that( + x = rstac::items_length(items_info) > 0, + msg = "no items matched the query criteria." + ) + + # fetching all the metadata + items_info <- suppressWarnings( + rstac::items_fetch(items = items_info, progress = FALSE) + ) + } + + # assign href + items_info <- suppressWarnings( + rstac::items_sign(items_info, + sign_fn = rstac::sign_planetary_computer()) + ) + + return(items_info) +} + +#' @keywords internal +#' @export +`.source_items_tiles_group.mspc_cube_sentinel-2-l2a` <- function(source, ..., + items, + collection = NULL) { + + rstac::items_group(items, field = c("properties", "s2:mgrs_tile")) +} + +#' @keywords internal +#' @export +`.source_items_tile_get_name.mspc_cube_sentinel-2-l2a` <- function(source, ..., + tile_items, + collection = NULL) { + + tile_items[["features"]][[1]][[c("properties", "s2:mgrs_tile")]] +} + +#' @keywords internal +#' @export +`.source_items_tile_get_crs.mspc_cube_sentinel-2-l2a` <- function(source,..., + tile_items, + collection = NULL) { + + # format collection crs + crs <- .sits_proj_format_crs( + tile_items[["features"]][[1]][[c("properties", "proj:epsg")]] + ) + + return(crs) +} + +#' @keywords internal +#' @export +`.source_items_new.mspc_cube_landsat-8-c2-l2` <- function(source, ..., + collection, + stac_query, + tiles = NULL) { + + # set caller to show in errors + .check_set_caller(".source_items_new.mspc_cube_landsat-8-c2-l2") + + # if specified, a filter per tile is added to the query + if (!is.null(tiles)) { + + items_list <- lapply(tiles, function(tile) { + + # format tile parameter provided by users + sep_tile <- .usgs_format_tiles(tile) + + # add filter by wrs path and row + stac_query <- rstac::ext_query( + q = stac_query, + "landsat:wrs_path" == sep_tile$wrs_path, + "landsat:wrs_row" == sep_tile$wrs_row + ) + + # making the request + items <- rstac::post_request(q = stac_query, ...) + + # checks if the collection returned zero items + .check_that( + x = !(rstac::items_length(items) == 0), + msg = "the provided search returned zero items." + ) + + # fetching all the metadata and updating to upper case instruments + items <- suppressWarnings( + rstac::items_fetch(items = items, progress = FALSE) + ) + }) + + # getting the first item info + items <- items_list[[1]] + + # joining the items + items$features <- do.call( + c, args = lapply(items_list, `[[`, "features") + ) + } else { + # making the request + items <- rstac::post_request(q = stac_query, ...) + + # checks if the collection returned zero items + .check_that( + x = !(rstac::items_length(items) == 0), + msg = "the provided search returned zero items." + ) + + # fetching all the metadata and updating to upper case instruments + items <- suppressWarnings( + rstac::items_fetch(items = items, progress = FALSE) + ) + } + + # assign href + items <- suppressWarnings( + rstac::items_sign(items, sign_fn = rstac::sign_planetary_computer()) + ) + + + return(items) +} + +#' @keywords internal +#' @export +`.source_items_tiles_group.mspc_cube_landsat-8-c2-l2` <- function(source, ..., + items, + collection = NULL) { + + # store tile info in items object + items$features <- purrr::map(items$features, function(feature) { + feature$properties$tile <- paste0( + feature$properties[["landsat:wrs_path"]], + feature$properties[["landsat:wrs_row"]] + ) + + feature + }) + + rstac::items_group(items, field = c("properties", "tile")) +} + +#' @keywords internal +#' @export +`.source_items_tile_get_crs.mspc_cube_landsat-8-c2-l2` <- function(source, + tile_items, ..., + collection = NULL) { + + epsg_code <- tile_items[["features"]][[1]][[c("properties", "proj:epsg")]] + # format collection crs + crs <- .sits_proj_format_crs(epsg_code) + + return(crs) +} diff --git a/R/sits_source_api_stac.R b/R/sits_source_api_stac.R index 10c025a94..761e629d5 100644 --- a/R/sits_source_api_stac.R +++ b/R/sits_source_api_stac.R @@ -73,6 +73,7 @@ bands = bands) items_lst <- .source_items_tiles_group(source = source, ..., + collection = collection, items = items) cube <- purrr::map_dfr(items_lst, function(tile) { diff --git a/R/sits_source_api_usgs.R b/R/sits_source_api_usgs.R index c92e9c530..8803cd4c7 100644 --- a/R/sits_source_api_usgs.R +++ b/R/sits_source_api_usgs.R @@ -187,9 +187,11 @@ # fetching all the metadata and updating to upper case instruments - items_info <- rstac::items_fetch(items = items, - progress = pgr_fetch, - matched_field = c("meta", "found")) + items_info <- suppressWarnings( + rstac::items_fetch(items = items, + progress = pgr_fetch, + matched_field = c("meta", "found")) + ) return(items_info) } diff --git a/R/sits_stac.R b/R/sits_stac.R index 8146a1f46..d8a5e5b1b 100644 --- a/R/sits_stac.R +++ b/R/sits_stac.R @@ -2,6 +2,7 @@ #' @title Select stac items by sits bands. #' #' @description Select bands in stac items by sits bands. +#' @keywords internal #' #' @param items a \code{STACItemcollection} object from rstac package. #' @param bands_source a \code{character} with source bands (provider bands). @@ -149,6 +150,7 @@ #' @title Creates a query to send to STAC api #' @name .stac_items_query #' @description Creates a query using rstac package to send to STAC API. +#' @keywords internal #' #' @param source Name of the STAC provider #' @param collection Collection to be searched in the data source diff --git a/R/sits_tibble.R b/R/sits_tibble.R index d064f547c..43de120e4 100644 --- a/R/sits_tibble.R +++ b/R/sits_tibble.R @@ -1,4 +1,4 @@ -#' @title Apply a function over a time series. +#' @title Apply a function on a set of time series #' @name sits_apply #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' @description Apply a 1D generic function to a time series @@ -95,10 +95,10 @@ sits_apply <- function(data, #' @examples #' \donttest{ #' # Retrieve data for time series with label samples in Mato Grosso in Brazil -#' data(samples_mt_6bands) +#' data(samples_modis_4bands) #' # Generate a new image with the SAVI (Soil-adjusted vegetation index) -#' savi.tb <- sits_mutate_bands(samples_mt_6bands, -#' SAVI = (1.5 * (NIR - RED) / (NIR + RED + 0.5))) +#' ndwi.tb <- sits_mutate_bands(samples_modis_4bands, +#' NDWI = (1.5 * (NIR - MIR) / (NIR + MIR))) #' } #' @export sits_mutate_bands <- function(data, ...) { @@ -202,7 +202,7 @@ sits_sample <- function(data, n = NULL, frac = NULL) { return(result) } -#' @title Retrieve time series for a row of a sits tibble +#' @title Get the time series for a row of a sits tibble #' @name sits_time_series #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @@ -439,12 +439,9 @@ sits_time_series <- function(data) { min = 1, msg = "Invalid number of rows" ) - names <- c("longitude", "latitude", "start_date", "end_date", - "label", "cube", "time_series") - .check_chr_contains( x = colnames(data), - contains = names, + contains = .config_get("sits_tibble_cols"), discriminator = "all_of", msg = "Data is not a valid sits tibble" ) diff --git a/R/sits_timeline.R b/R/sits_timeline.R index 4f822e523..9e724ada7 100644 --- a/R/sits_timeline.R +++ b/R/sits_timeline.R @@ -1,13 +1,13 @@ -#' @title Obtains the timeline +#' @title Get timeline of a cube or a set of time series #' #' @name sits_timeline #' #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' #' @description This function returns the timeline for a given data set, either -#' a set of time series or a data cube +#' a set of time series, a data cube, or a trained model. #' -#' @param data either a sits tibble or data cube +#' @param data either a sits tibble, a data cube, or a trained model. #' #' @export #' @@ -27,6 +27,12 @@ sits_timeline.sits <- function(data) { return(data$time_series[[1]]$Index) } +#' @export +#' +sits_timeline.sits_model <- function(data) { + return(environment(data)$data$time_series[[1]]$Index) +} + #' @export #' sits_timeline.raster_cube <- function(data) { @@ -51,21 +57,21 @@ sits_timeline.raster_cube <- function(data) { #' sits_timeline.satveg_cube <- function(data) { - # retrieve the time series - ts <- .sits_satveg_ts_from_txt(longitude = -55.50563, - latitude = -11.71557, - data) + # retrieve the time series + ts <- .sits_satveg_ts_from_txt(longitude = -55.50563, + latitude = -11.71557, + data) - # return the timeline of the cube - return(as.Date(ts$Index)) + # return the timeline of the cube + return(as.Date(ts$Index)) } #' @export #' sits_timeline.wtss_cube <- function(data) { - # return the timeline of the cube - return(data[1,]$file_info[[1]]$date[[1]]) + # return the timeline of the cube + return(data[1,]$file_info[[1]]$date[[1]]) } #' @export @@ -248,7 +254,7 @@ sits_timeline.classified_image <- function(data) { #' .sits_timeline_valid_date <- function(date, timeline) { - # is the date inside the timeline? + # is the date inside the timeline? if (date %within% lubridate::interval(timeline[1], timeline[length(timeline)])) return(TRUE) @@ -263,13 +269,13 @@ sits_timeline.classified_image <- function(data) { } # what is the difference in days between the last two days of the timeline? timeline_diff <- as.integer(timeline[length(timeline)] - - timeline[length(timeline) - 1]) + timeline[length(timeline) - 1]) # if the difference in days in the timeline is smaller than the difference # between the reference date and the last date of the timeline, then # we assume the date is valid if (abs(as.integer(date - timeline[length(timeline)])) <= timeline_diff) { - return(TRUE) + return(TRUE) } return(FALSE) @@ -316,7 +322,7 @@ sits_timeline.classified_image <- function(data) { est_start_date <- lubridate::as_date(paste0(year_st_date, "-", ref_st_month, "-", ref_st_mday) - ) + ) # find the actual starting date by searching the timeline idx_start_date <- which.min(abs(est_start_date - timeline)) start_date <- timeline[idx_start_date] @@ -479,11 +485,11 @@ sits_timeline.classified_image <- function(data) { time_index <- dates_index %>% purrr::map(function(idx) { idx_lst <- seq_len(n_bands) %>% - purrr::map(function(b) { - idx1 <- idx[1] + (b - 1) * length(timeline) - idx2 <- idx[2] + (b - 1) * length(timeline) - return(c(idx1, idx2)) - }) + purrr::map(function(b) { + idx1 <- idx[1] + (b - 1) * length(timeline) + idx2 <- idx[2] + (b - 1) * length(timeline) + return(c(idx1, idx2)) + }) index_ts <- unlist(idx_lst) return(index_ts) }) @@ -518,7 +524,7 @@ sits_timeline.classified_image <- function(data) { end_date <- timeline[length(timeline)] } valid <- timeline >= lubridate::as_date(start_date) & - timeline <= lubridate::as_date(end_date) + timeline <= lubridate::as_date(end_date) .check_that( x = any(valid), @@ -552,9 +558,9 @@ sits_timeline.classified_image <- function(data) { ) .check_chr_within( - x = c("tile", "date", "band"), - within = colnames(tile_date_band), - msg = paste("error in obtaining tile, date and band information") + x = c("tile", "date", "band"), + within = colnames(tile_date_band), + msg = paste("error in obtaining tile, date and band information") ) # convert to datetime @@ -604,10 +610,10 @@ sits_timeline.classified_image <- function(data) { #' .sits_timeline_check <- function(data) { - .sits_tibble_test(data) + .sits_tibble_test(data) - if (length(unique(lapply(data$time_series, nrow))) == 1) - return(TRUE) - else - return(FALSE) + if (length(unique(lapply(data$time_series, nrow))) == 1) + return(TRUE) + else + return(FALSE) } diff --git a/R/sits_twdtw.R b/R/sits_twdtw.R index e6498384b..a41a6390a 100644 --- a/R/sits_twdtw.R +++ b/R/sits_twdtw.R @@ -47,10 +47,10 @@ #' @examples #' \dontrun{ #' # Retrieve the set of samples for the Mato Grosso region -#' samples <- sits_select(samples_mt_6bands, bands = c("NDVI", "EVI")) +#' samples <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) #' #' # get a point and classify the point with the ml_model -#' point <- sits_select(point_mt_6bands, bands = c("NDVI", "EVI")) +#' point <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) #' #' # plot the series #' plot(point) @@ -83,7 +83,7 @@ sits_twdtw_classify <- function(samples, overlap = 0.5, .plot = TRUE) { # verifies if dtwSat package is installed - if (!requireNamespace("dtwSat", quietly = TRUE)) { + if (!(suppressWarnings(requireNamespace("dtwSat", quietly = TRUE)))) { stop("Please install package dtwSat", call. = FALSE) } @@ -180,7 +180,7 @@ sits_twdtw_classify <- function(samples, overlap = 0.5) { # verifies if dtwSat package is installed - if (!requireNamespace("dtwSat", quietly = TRUE)) { + if (!(suppressWarnings(requireNamespace("dtwSat", quietly = TRUE)))) { stop("Please install package dtwSat", call. = FALSE) } diff --git a/R/sits_validate.R b/R/sits_validate.R index f46c4e92b..3fc6866e6 100644 --- a/R/sits_validate.R +++ b/R/sits_validate.R @@ -1,4 +1,4 @@ -#' @title Cross-validate temporal patterns +#' @title Cross-validate time series samples #' @name sits_kfold_validate #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} @@ -79,7 +79,7 @@ sits_kfold_validate <- function(data, ) # create partitions different splits of the input data - data <- sits_create_folds(data, folds = folds) + data <- .sits_create_folds(data, folds = folds) # create prediction and reference vector pred_vec <- character() @@ -135,17 +135,18 @@ sits_kfold_validate <- function(data, return(assess) } #' @title Create partitions of a data set -#' @name sits_create_folds +#' @name .sits_create_folds #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' @author Alexandre Ywata, \email{alexandre.ywata@@ipea.gov.br} #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' #' @description Split a sits tibble into k groups, based on the label. #' +#' @keywords internal #' @param data A sits tibble to be partitioned. -#' @param folds Number of folds. -#' @export -sits_create_folds <- function(data, folds = 5) { +#' @param folds Number of folds +#' +.sits_create_folds <- function(data, folds = 5) { # verify if data exists .sits_tibble_test(data) diff --git a/R/sits_values.R b/R/sits_values.R index 1f9a4b105..09078b288 100644 --- a/R/sits_values.R +++ b/R/sits_values.R @@ -1,4 +1,4 @@ -#' @title Return the values of a given sits tibble as a list of matrices. +#' @title Return the values of a set of time series #' @name sits_values #' @author Rolf Simoes, \email{rolf.simoes@@inpe.br} #' @@ -14,7 +14,7 @@ #' @param format A string with either "cases_dates_bands" #' or "bands_cases_dates" or "bands_dates_cases". #' -#' @return A sits tibble with values. +#' @return A matrix with values. #' @examples #' # Retrieve a set of time series with 2 classes #' data(cerrado_2classes) diff --git a/R/sits_view.R b/R/sits_view.R index be36fe400..c8c853f6a 100644 --- a/R/sits_view.R +++ b/R/sits_view.R @@ -1,4 +1,4 @@ -#' @title Generic interface for visualization of data cube +#' @title View data cubes and samples in leaflet #' @name sits_view #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' @@ -51,7 +51,7 @@ sits_view <- function(x, ...){ sits_view.sits <- function(x, ..., legend = NULL, - palette = "default") { + palette = "Harmonic") { .check_that( requireNamespace("leaflet", quietly = TRUE), @@ -74,7 +74,9 @@ sits_view.sits <- function(x, # if colors are not specified, get them from the configuration file if (purrr::is_null(legend)) { - colors <- .config_palette_colors(labels, palette = palette) + colors <- .config_colors(labels = labels, + palette = palette, + rev = TRUE) } else { .check_chr_within( @@ -444,7 +446,9 @@ sits_view.classified_image <- function(x,..., .view_get_colors <- function(labels, legend, palette){ # if colors are not specified, get them from the configuration file if (purrr::is_null(legend)) { - colors <- .config_palette_colors(labels, palette = palette) + colors <- .config_colors(labels = labels, + palette = palette, + rev = TRUE) } else { .check_chr_within( diff --git a/R/sits_xlsx.R b/R/sits_xlsx.R index da4adf300..01241e1eb 100644 --- a/R/sits_xlsx.R +++ b/R/sits_xlsx.R @@ -1,4 +1,4 @@ -#' @title Saves the results of accuracy assessments as Excel files +#' @title Save accuracy assessments as Excel files #' @name sits_to_xlsx #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} # diff --git a/R/sits_zoo.R b/R/sits_zoo.R index c9a344b39..052f24803 100644 --- a/R/sits_zoo.R +++ b/R/sits_zoo.R @@ -1,69 +1,4 @@ -#' @title Import time series in the zoo format to a sits tibble -#' @name sits_from_zoo -#' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} -#' -#' @description Converts data from an instance of a zoo series to a sits tibble. -#' -#' @param ts_zoo Zoo time series. -#' @param longitude Longitude of the chosen location. -#' @param latitude Latitude of the chosen location. -#' @param label Label to attach to the time series (optional). -#' @param name Name of the data cube where data comes from. -#' @return Time series in sits tibble format. -#' -#' @examples -#' # Read a time series in ZOO format -#' data(ts_zoo) -#' # Convert the zoo series into a sits tibble -#' data <- sits_from_zoo(ts_zoo, -#' longitude = -54.2313, latitude = -14.0482, -#' label = "Cerrado", name = "mod13q1" -#' ) -#' -#' @export -#' -sits_from_zoo <- function(ts_zoo, longitude = 0.00, latitude = 0.00, - label = "NoClass", name = "unknown") { - - # set caller to show in errors - .check_set_caller("sits_from_zoo") - - # verifies if zoo package is installed - if (!requireNamespace("zoo", quietly = TRUE)) { - stop("Please install package zoo", call. = FALSE) - } - # preconditions - .check_that( - x = inherits(ts_zoo, "zoo"), - msg = "input is not a zoo time series" - ) - .check_that( - x = (longitude >= -180. & longitude <= 180.), - msg = "invalid longitude value" - ) - .check_that( - x = (latitude >= -90. & longitude <= 90.), - msg = "invalid latitudevalue" - ) - - # convert the data from the zoo format to a tibble used by sits - ts <- tibble::as_tibble(zoo::fortify.zoo(ts_zoo)) - - # create a tibble to store the data - data <- tibble::tibble( - longitude = longitude, - latitude = latitude, - start_date = as.Date(ts[1, ]$Index), - end_date = as.Date(ts[nrow(ts), ]$Index), - label = label, - cube = name, - time_series = list(ts) - ) - class(data) <- c("sits", class(data)) - return(data) -} - -#' @title Export data to be used to the zoo format +#' @title Export time series to zoo format #' @name sits_to_zoo #' @author Gilberto Camara, \email{gilberto.camara@@inpe.br} #' diff --git a/R/zzz.R b/R/zzz.R index 38167a9e9..51f3c0aeb 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -57,5 +57,6 @@ utils::globalVariables(c( )) #' @importFrom lubridate %within% %m+% +#' @importFrom Rcpp sourceCpp #' @useDynLib sits, .registration = TRUE NULL diff --git a/README.Rmd b/README.Rmd index f9502d5f6..5ff99e202 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,3 +1,5 @@ + + --- title: "SITS - Satellite Image Time Series Analysis for Earth Observation Data Cubes" authors: Rolf Simoes, Gilberto Camara, Felipe Souza, Lorena Santos, Pedro Andrade, Alexandre Carvalho, Gilberto Queiroz, Karine Ferreira @@ -40,6 +42,11 @@ machines. 6. Post-process the classified images. 7. Evaluate the accuracy of the classification using best practices. +```{r sits, echo = FALSE, out.width = "60%", out.height = "60%", fig.align="center", fig.cap="Conceptual view of data cubes (source: authors)"} +knitr::include_graphics("inst/extdata/markdown/figures/sits_general_view.png") +``` + + ## SITS on Kaggle Those that want to evaluate the `sits` package before installing are invited to run the examples available on [Kaggle](https://www.kaggle.com/esensing/code). These examples provide a fast-track introduction to the package. We recommend running them in the following order: @@ -74,17 +81,27 @@ library(sits) ## Building Earth Observation Data Cubes -### ARD Image Collections Accessible by SITS +### Image Collections Accessible by SITS + +The `sits` R package allows advanced data analysis on big EO data cubes available in cloud computing services. *Data cubes* are collections of remote sensing images that have been organized to have spatial cells of the same size, covering a regular area in space and time. These data cubes are built from analysis-ready image collections available in the cloud. + +```{r dcconcept, echo = FALSE, out.width = "90%", out.height = "90%", fig.align="center", fig.cap="Conceptual view of data cubes (source: authors)"} +knitr::include_graphics("inst/extdata/markdown/figures/datacube_conception.png") +``` -The `sits` package works with Earth observation data cubes. These data cubes are built from analysis-ready image collections available in the cloud. The collections accessible in version 0.15.0 are: +The image collections accessible in `sits` version 0.15.1 to build EO data cubes are: 1. AWS: Sentinel-2/2A level 2A collections, including "SENTINEL-S2-L2A-COGS" (open data) and "SENTINEL-S2-L2A" (non open data). 2. Brazil Data Cube (BDC): Open data collections of Sentinel-2, Landsat-8 and CBERS-4 images. 3. Digital Earth Africa (DEAFRICA): Open data collection of Sentinel-2/2A and Landsat-8 for Africa. -4. USGS: Landsat-4/5/7/8 collections, which are not open data. +4. Microsoft Planetary Computer (MSPC): Open data collection of Sentinel-2/2A and Landsat-8. +5. USGS: Landsat-4/5/7/8 collections, which are not open data. Open data collections do not require payment of access fees to cloud providers. Except for those in the Brazil Data Cube, these collections are not regular. Irregular collections require further processing before they can be used in `sits` for classification using machine learning methods. + +### Building an EO Data Cube from an ARD Image Collection + The following code defines an irregular data cube of Sentinel-2/2A images using AWS, using the open data collection "sentinel-s2-l2a-cogs". The geographical area of the data cube is defined by the tiles "20LKP" and "20LLKP", and the temporal extent by a start and end date. Access to other cloud services works in similar ways. ```{r, echo = TRUE} @@ -103,18 +120,9 @@ The cube can be shown in a leaflet using `sits_view()`. sits_view(s2_cube, green = "B08", blue = "B03", red = "B04") ``` -This cube is irregular. The timelines of tiles "20LKP" and "20LLKP" the resolutions of the bands of the bands are different. Sentinel-2 bands "B03", "B04", and "B08" have 10 m resolution, while bands "B8A", "B11" and the cloud band "SCL" have 20 m resolution. Irregular collections need an additional processing step to be converted to regular data cubes, as described below. - -### Transforming ARD Image Collections into Data Cubes +This cube is irregular. The timelines of tiles "20LKP" and "20LLKP" and the resolutions of the bands are different. Sentinel-2 bands "B03", "B04", and "B08" have 10 m resolution, while bands "B8A", "B11" and the cloud band "SCL" have 20 m resolution. Irregular collections need an additional processing step to be converted to regular data cubes, as described below. -SITS works best with regular *data cubes* that meet the definition proposed by [Appel and Pebesma, 2019](https://www.mdpi.com/2306-5729/4/3/92): - -1. A data cube is a four-dimensional structure with dimensions x (longitude or easting), y (latitude or northing), time, and bands. -2. Its spatial dimensions refer to a single spatial reference system (SRS). Cells of a data cube have a constant spatial size with respect to the cube’s SRS. -3. The temporal dimension is composed of a set of continuous and equally-spaced intervals. -4. For every combination of dimensions, a cell has a single value. - -Once users have defined an irregular ARD image collection from a cloud service using `sits_cube()`, they should run `sits_regularize()` to build a regular data cube. This function uses the [gdalcubes R package](https://github.com/appelmar/gdalcubes), described in [Appel and Pebesma, 2019](https://www.mdpi.com/2306-5729/4/3/92). +After defining an irregular ARD image collection from a cloud service using `sits_cube()`, users should run `sits_regularize()` to build a regular data cube. This function uses the [gdalcubes R package](https://github.com/appelmar/gdalcubes), described in [Appel and Pebesma, 2019](https://www.mdpi.com/2306-5729/4/3/92). ```{r, eval = FALSE, echo = TRUE} @@ -128,7 +136,7 @@ gc_cube <- sits_regularize(cube = s2_cube, ``` The above command builds a regular data cube with all bands interpolated to 10 meter spatial resolution and 15 days temporal resolution. Regular data cubes are the input to the `sits` functions for time series retrieval, building machine learning models, and classification of raster images and time series. -## Working with Time Series +## Working with Time Series in SITS ### Accessing Time Series in Data Cubes @@ -139,7 +147,6 @@ library(sits) # this data cube uses images from the Brazil Data Cube that have # downloaded to a local directory data_dir <- system.file("extdata/raster/mod13q1", package = "sits") - # create a cube from downloaded files raster_cube <- sits_cube( source = "BDC", @@ -148,39 +155,32 @@ raster_cube <- sits_cube( delim = "_", parse_info = c("X1", "X2", "tile", "band", "date") ) - # obtain a set of samples defined by a CSV file csv_file <- system.file("extdata/samples/samples_sinop_crop.csv", package = "sits") - # retrieve the time series associated with the samples from the data cube points <- sits_get_data(raster_cube, file = csv_file) - # show the time series points[1:3,] ``` After a time series has been obtained, it is loaded in a tibble. The first six columns contain the metadata: spatial and temporal location, label assigned to the sample, and coverage from where the data has been extracted. The spatial location is given in longitude and latitude coordinates. The first sample has been labelled “Pasture”, at location (-55.65931, -11.76267), and is considered valid for the period (2013-09-14, 2014-08-29). To display the time series, use the `plot()` function. + ```{r, eval = TRUE, echo = TRUE, fig.align="center", fig.height=2.7, fig.width=7, fig.cap="Plot of point at location (-55.65931, -11.76267) labelled as Pasture"} plot(points[1,]) ``` For a large number of samples, where the amount of individual plots would be substantial, the default visualization combines all samples together in a single temporal interval. -```{r, eval=FALSE} +```{r, fig.align="center", fig.height=3.5, fig.width=7, fig.cap="Samples for NDVI band for Cerrado class"} # select the "ndvi" band samples_ndvi <- sits_select(samples_modis_4bands, "NDVI") - # select only the samples with the cerrado label samples_cerrado <- dplyr::filter(samples_ndvi, label == "Cerrado") plot(samples_cerrado) ``` -```{r, echo=FALSE, fig.align="center", fig.height=2.7, fig.width=5, fig.cap="Samples for NDVI band for Cerrado class"} -knitr::include_graphics("./inst/extdata/markdown/figures/samples_cerrado.png") -``` - ## Time Series Clustering and Filtering ### Clustering for sample quality control @@ -190,7 +190,7 @@ remove those that might have been wrongly labeled or that have low discriminatory power. Good samples lead to good classification maps. `sits` provides support for sample quality control using Self-organizing Maps (SOM). The process of clustering with SOM is done by `sits_som_map()`, which creates a self-organizing map and assesses the quality of the samples. -```{r} +```{r, fig.align="center", fig.height=3.5, fig.width=7} # load the kohonen library library(kohonen) # create a SOM map from the samples @@ -217,7 +217,7 @@ deal with data sets that are *noisy* and *non-homogeneous*. For data filtering, `sits` supports Savitzky–Golay (`sits_sgolay()`) and Whittaker (`sits_whittaker()`) filters. As an example, we show how to apply the Whittaker smoother to a 16-year NDVI time series. -```{r, fig.align="center", fig.height=2.7, fig.width=7, fig.cap="Whitaler filter of NDVI time series"} +```{r, fig.align="center", fig.height=3.5, fig.width=7, fig.cap="Whittaker filter of NDVI time series"} # apply Whitaker filter to a time series sample for the NDVI band from 2000 to 2016 # merge with the original data # plot the original and the modified series @@ -254,20 +254,17 @@ Brazilian state, using `sits_classify()`. The results can be shown in text format using the function `sits_show_prediction()` or graphically using `plot`. -```{r, fig.align="center", fig.height=3, fig.width=6} +```{r, fig.align="center", fig.height=3.5, fig.width=7} # training data set data("samples_modis_4bands") - # point to be classified data("point_mt_6bands") - # Select the NDVI and EVI bands # Filter the band to reduce noise # Train a deep learning model tempCNN_model <- samples_modis_4bands %>% sits_select(bands = c("NDVI", "EVI")) %>% sits_train(ml_method = sits_TempCNN(verbose = FALSE)) - # Select NDVI and EVI bands of the point to be classified # Filter the point # Classify using TempCNN model @@ -282,7 +279,7 @@ The following example shows how to classify a data cube organised as a set of raster images. The result can also be visualised interactively using `sits_view()`. -```{r} +```{r, fig.align="center", fig.height=4.5, fig.width=9} # Create a data cube to be classified # Cube is composed of MOD13Q1 images from the Sinop region in Mato Grosso (Brazil) data_dir <- system.file("extdata/raster/mod13q1", package = "sits") @@ -293,7 +290,6 @@ sinop <- sits_cube( delim = "_", parse_info = c("X1", "X2", "tile", "band", "date") ) - # Classify the raster cube, generating a probability file # Filter the pixels in the cube to remove noise probs_cube <- sits_classify(sinop, @@ -304,7 +300,7 @@ bayes_cube <- sits_smooth(probs_cube) # generate a thematic map label_cube <- sits_label_classification(bayes_cube) # plot the the labelled cube -plot(label_cube, title = "Labelled image") +plot(label_cube, title = "Land use and Land cover in Sinop, MT, Brazil in 2018") ``` diff --git a/README.md b/README.md index e12831139..87918dc11 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ basic workflow in SITS is: 6. Post-process the classified images. 7. Evaluate the accuracy of the classification using best practices. +Conceptual view of data cubes (source: authors) + ## SITS on Kaggle Those that want to evaluate the `sits` package before installing are @@ -78,22 +80,31 @@ devtools::install_github("e-sensing/sits", dependencies = TRUE) ``` r # load the sits library library(sits) -#> Using configuration file: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/sits/extdata/config.yml +#> Using configuration file: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/sits/extdata/config.yml +#> Color configurations found in /Library/Frameworks/R.framework/Versions/4.1/Resources/library/sits/extdata/config_colors.yml #> To provide additional configurations, create an YAML file and inform its path to environment variable 'SITS_CONFIG_USER_FILE'. #> Using raster package: terra #> SITS - satellite image time series analysis. -#> Loaded sits v0.15.0-4. +#> Loaded sits v0.15.1. #> See ?sits for help, citation("sits") for use in publication. #> See demo(package = "sits") for examples. ``` ## Building Earth Observation Data Cubes -### ARD Image Collections Accessible by SITS +### Image Collections Accessible by SITS -The `sits` package works with Earth observation data cubes. These data +The `sits` R package allows advanced data analysis on big EO data cubes +available in cloud computing services. *Data cubes* are collections of +remote sensing images that have been organized to have spatial cells of +the same size, covering a regular area in space and time. These data cubes are built from analysis-ready image collections available in the -cloud. The collections accessible in version 0.15.0 are: +cloud. + +Conceptual view of data cubes (source: authors) + +The image collections accessible in `sits` version 0.15.1 to build EO +data cubes are: 1. AWS: Sentinel-2/2A level 2A collections, including “SENTINEL-S2-L2A-COGS” (open data) and “SENTINEL-S2-L2A” (non open @@ -102,7 +113,9 @@ cloud. The collections accessible in version 0.15.0 are: Landsat-8 and CBERS-4 images. 3. Digital Earth Africa (DEAFRICA): Open data collection of Sentinel-2/2A and Landsat-8 for Africa. -4. USGS: Landsat-4/5/7/8 collections, which are not open data. +4. Microsoft Planetary Computer (MSPC): Open data collection of + Sentinel-2/2A and Landsat-8. +5. USGS: Landsat-4/5/7/8 collections, which are not open data. Open data collections do not require payment of access fees to cloud providers. Except for those in the Brazil Data Cube, these collections @@ -110,6 +123,8 @@ are not regular. Irregular collections require further processing before they can be used in `sits` for classification using machine learning methods. +### Building an EO Data Cube from an ARD Image Collection + The following code defines an irregular data cube of Sentinel-2/2A images using AWS, using the open data collection “sentinel-s2-l2a-cogs”. The geographical area of the data cube is defined by the tiles “20LKP” @@ -133,31 +148,16 @@ The cube can be shown in a leaflet using `sits_view()`. sits_view(s2_cube, green = "B08", blue = "B03", red = "B04") ``` -This cube is irregular. The timelines of tiles “20LKP” and “20LLKP” the -resolutions of the bands of the bands are different. Sentinel-2 bands -“B03”, “B04”, and “B08” have 10 m resolution, while bands “B8A”, “B11” -and the cloud band “SCL” have 20 m resolution. Irregular collections -need an additional processing step to be converted to regular data -cubes, as described below. - -### Transforming ARD Image Collections into Data Cubes - -SITS works best with regular *data cubes* that meet the definition -proposed by [Appel and Pebesma, -2019](https://www.mdpi.com/2306-5729/4/3/92): - -1. A data cube is a four-dimensional structure with dimensions x - (longitude or easting), y (latitude or northing), time, and bands. -2. Its spatial dimensions refer to a single spatial reference system - (SRS). Cells of a data cube have a constant spatial size with - respect to the cube’s SRS. -3. The temporal dimension is composed of a set of continuous and - equally-spaced intervals. -4. For every combination of dimensions, a cell has a single value. - -Once users have defined an irregular ARD image collection from a cloud -service using `sits_cube()`, they should run `sits_regularize()` to -build a regular data cube. This function uses the [gdalcubes R +This cube is irregular. The timelines of tiles “20LKP” and “20LLKP” and +the resolutions of the bands are different. Sentinel-2 bands “B03”, +“B04”, and “B08” have 10 m resolution, while bands “B8A”, “B11” and the +cloud band “SCL” have 20 m resolution. Irregular collections need an +additional processing step to be converted to regular data cubes, as +described below. + +After defining an irregular ARD image collection from a cloud service +using `sits_cube()`, users should run `sits_regularize()` to build a +regular data cube. This function uses the [gdalcubes R package](https://github.com/appelmar/gdalcubes), described in [Appel and Pebesma, 2019](https://www.mdpi.com/2306-5729/4/3/92). @@ -177,7 +177,7 @@ data cubes are the input to the `sits` functions for time series retrieval, building machine learning models, and classification of raster images and time series. -## Working with Time Series +## Working with Time Series in SITS ### Accessing Time Series in Data Cubes @@ -193,7 +193,6 @@ library(sits) # this data cube uses images from the Brazil Data Cube that have # downloaded to a local directory data_dir <- system.file("extdata/raster/mod13q1", package = "sits") - # create a cube from downloaded files raster_cube <- sits_cube( source = "BDC", @@ -202,15 +201,12 @@ raster_cube <- sits_cube( delim = "_", parse_info = c("X1", "X2", "tile", "band", "date") ) - # obtain a set of samples defined by a CSV file csv_file <- system.file("extdata/samples/samples_sinop_crop.csv", package = "sits") - # retrieve the time series associated with the samples from the data cube points <- sits_get_data(raster_cube, file = csv_file) #> All points have been retrieved - # show the time series points[1:3,] #> # A tibble: 3 × 7 @@ -234,14 +230,7 @@ function. plot(points[1,]) ``` -
- -Plot of point at location (-55.65931, -11.76267) labelled as Pasture -

-Plot of point at location (-55.65931, -11.76267) labelled as Pasture -

- -
+Plot of point at location (-55.65931, -11.76267) labelled as Pasture For a large number of samples, where the amount of individual plots would be substantial, the default visualization combines all samples @@ -250,21 +239,13 @@ together in a single temporal interval. ``` r # select the "ndvi" band samples_ndvi <- sits_select(samples_modis_4bands, "NDVI") - # select only the samples with the cerrado label samples_cerrado <- dplyr::filter(samples_ndvi, label == "Cerrado") plot(samples_cerrado) ``` -
- -Samples for NDVI band for Cerrado class -

-Samples for NDVI band for Cerrado class -

- -
+Samples for NDVI band for Cerrado class ## Time Series Clustering and Filtering @@ -289,7 +270,7 @@ som_map <- sits_som_map(samples_modis_4bands, plot(som_map) ``` -![](man/figures/README-unnamed-chunk-11-1.png) + This function uses the [“kohonen” R package](https://www.jstatsoft.org/article/view/v087i07) to compute a @@ -328,14 +309,7 @@ point_ndvi %>% plot() ``` -
- -Whitaler filter of NDVI time series -

-Whitaler filter of NDVI time series -

- -
+Whittaker filter of NDVI time series ## Time Series Classification @@ -367,17 +341,15 @@ the function `sits_show_prediction()` or graphically using `plot`. ``` r # training data set data("samples_modis_4bands") - # point to be classified data("point_mt_6bands") - # Select the NDVI and EVI bands # Filter the band to reduce noise # Train a deep learning model tempCNN_model <- samples_modis_4bands %>% sits_select(bands = c("NDVI", "EVI")) %>% sits_train(ml_method = sits_TempCNN(verbose = FALSE)) - +#> Loaded Tensorflow version 2.5.0 # Select NDVI and EVI bands of the point to be classified # Filter the point # Classify using TempCNN model @@ -388,7 +360,7 @@ point_mt_6bands %>% plot() ``` - + The following example shows how to classify a data cube organised as a set of raster images. The result can also be visualised interactively @@ -405,7 +377,6 @@ sinop <- sits_cube( delim = "_", parse_info = c("X1", "X2", "tile", "band", "date") ) - # Classify the raster cube, generating a probability file # Filter the pixels in the cube to remove noise probs_cube <- sits_classify(sinop, @@ -416,10 +387,10 @@ bayes_cube <- sits_smooth(probs_cube) # generate a thematic map label_cube <- sits_label_classification(bayes_cube) # plot the the labelled cube -plot(label_cube, title = "Labelled image") +plot(label_cube, title = "Land use and Land cover in Sinop, MT, Brazil in 2018") ``` -![](man/figures/README-unnamed-chunk-15-1.png) + ## Additional information diff --git a/contributing.md b/contributing.md index ee49bea14..bb5d2b751 100644 --- a/contributing.md +++ b/contributing.md @@ -2,14 +2,7 @@ This file provides guidelines for contributions to the SITS package, including issues and pull requests. ### Creating an issue -The authors welcome your remarks, points and questions. When creating an issue, please provide a minimal working example that would allow -reproducing the problem. You can also suggest improvements and pose questions about how do your work using SITS. Please write in English if possible, -since that would benefit the community. If you are insecure in writing in English, you can write in French, Spanish, Portuguese, Italian or -German. +The authors welcome your remarks, points and questions. When creating an issue, please provide a minimal working example that would allow reproducing the problem. You can also suggest improvements and pose questions about how do your work using SITS. Please write in English if possible, since that would benefit the community. If you are insecure in writing in English, you can write in French, Spanish, Portuguese, Italian or German. ### Developing a new machine learning function -We welcome contributors that would like to include their machine learning algorithms to be used together with SITS. To write a new algorithm, -please look carefully at how function such as `sits_rfor` and `sits_deeplearning` work. All ML functions take a trained data set organised as -a sits tibble, and their should be provide a `predict` function as an R closure. An R closure is a function written by another function. -A closure can access its own arguments, and variables defined in its parent. See the explanation by Hadley Wickham -at http://adv-r.had.co.nz/Functional-programming.html. +We welcome contributors that would like to include their machine learning algorithms to be used together with SITS. To write a new algorithm, please look carefully at how function such as `sits_rfor` and `sits_mlp` work. All ML functions take a trained data set organised as a sits tibble, and their should be provide a `predict` function as an R closure. An R closure is a function written by another function. A closure can access its own arguments, and variables defined in its parent. See the explanation by Hadley Wickham at http://adv-r.had.co.nz/Functional-programming.html. diff --git a/data/cerrado_2classes.rda b/data/cerrado_2classes.rda index c73109df8..f1046e8ce 100644 Binary files a/data/cerrado_2classes.rda and b/data/cerrado_2classes.rda differ diff --git a/data/samples_modis_4bands.rda b/data/samples_modis_4bands.rda index 8703a53c9..ebcee93ca 100644 Binary files a/data/samples_modis_4bands.rda and b/data/samples_modis_4bands.rda differ diff --git a/data/samples_mt_6bands.rda b/data/samples_mt_6bands.rda deleted file mode 100644 index 75d1f6cea..000000000 Binary files a/data/samples_mt_6bands.rda and /dev/null differ diff --git a/data/timeline_2000_2017.rda b/data/timeline_2000_2017.rda deleted file mode 100644 index f139ffd47..000000000 Binary files a/data/timeline_2000_2017.rda and /dev/null differ diff --git a/data/timeline_2013_2014.rda b/data/timeline_2013_2014.rda deleted file mode 100644 index 5283ecd2d..000000000 Binary files a/data/timeline_2013_2014.rda and /dev/null differ diff --git a/data/ts_zoo.rda b/data/ts_zoo.rda deleted file mode 100644 index bc412ef2b..000000000 Binary files a/data/ts_zoo.rda and /dev/null differ diff --git a/demo/00Index b/demo/00Index index d3aa4a662..da4faed12 100644 --- a/demo/00Index +++ b/demo/00Index @@ -2,8 +2,7 @@ access_SATVEG Access time series using the SATVEG service classify_cbers_bdc Classify a set of CBERS AWFI images in the Brazil Data Cube classify_deeplearning Classify MODIS image using deep learning classify_raster_xgb Classify MODIS image using extreme gradient boosting -classify_raster_svm Classify MODIS image using SVM -classify_sentinel2_rfor Classify a Sentinel-2 image in AWS using random forest +classify_raster_rfor Classify MODIS image using SVM classify_ts Classify a time series using SVM classify_TWDTW Classify a time series using TWDTW evaluate_samples_Kohonen Clustering and evaluation of samples using self-organizing maps diff --git a/demo/classify_deeplearning.R b/demo/classify_deeplearning.R index fb52544ca..4d3f793d0 100644 --- a/demo/classify_deeplearning.R +++ b/demo/classify_deeplearning.R @@ -26,8 +26,6 @@ dl_model <- sits_train( ml_method = sits_mlp() ) -sits_keras_diagnostics(dl_model) - # create a data cube to be classified # Cube is composed of MOD13Q1 images from the Sinop region in Mato Grosso (Brazil) data_dir <- system.file("extdata/sinop", package = "sitsdata") diff --git a/demo/classify_raster_svm.R b/demo/classify_raster_rfor.R similarity index 95% rename from demo/classify_raster_svm.R rename to demo/classify_raster_rfor.R index 3025b6acc..7cf79f4a5 100644 --- a/demo/classify_raster_svm.R +++ b/demo/classify_raster_rfor.R @@ -30,9 +30,7 @@ svm_model <- sits_train( # Cube is composed of MOD13Q1 images from the Sinop region in Mato Grosso (Brazil) data_dir <- system.file("extdata/sinop", package = "sitsdata") sinop <- sits_cube( - source = "LOCAL", - name = "sinop-2014", - origin = "BDC", + source = "BDC", collection = "MOD13Q1-6", data_dir = data_dir, delim = "_", diff --git a/demo/classify_raster_xgb.R b/demo/classify_raster_xgb.R index e4ad90ee6..d595fe6d6 100644 --- a/demo/classify_raster_xgb.R +++ b/demo/classify_raster_xgb.R @@ -2,7 +2,6 @@ # The raster image is a MODIS data set covering the municipality of Sinop # with two bands (NDVI and EVI) using MODIS collection 5 data library(sits) -library(randomForest) # load the sitsdata library if (!requireNamespace("sitsdata", quietly = TRUE)) { @@ -32,9 +31,7 @@ xgb_model <- sits_train( # Cube is composed of MOD13Q1 images from the Sinop region in Mato Grosso (Brazil) data_dir <- system.file("extdata/sinop", package = "sitsdata") sinop <- sits_cube( - source = "LOCAL", - name = "sinop-2014", - origin = "BDC", + source = "BDC", collection = "MOD13Q1-6", data_dir = data_dir, delim = "_", @@ -57,37 +54,19 @@ sinop_bayes <- sits_smooth( output_dir = tempdir() ) -# smooth the result with a Gaussian filter -sinop_gauss <- sits_smooth( - cube = sinop_probs, - type = "gaussian", - output_dir = tempdir() -) - -# smooth the result with a bilateral filter -sinop_bilin <- sits_smooth( - cube = sinop_probs, - type = "bilateral", - output_dir = tempdir() -) - sinop_label <- sits_label_classification( cube = sinop_bayes, output_dir = tempdir() ) -# plot the classified map -plot(sinop_label) - # plot the probabilities plot(sinop_probs) # plot the smoothened images plot(sinop_bayes) -plot(sinop_gauss) - -plot(sinop_bilin) +# plot the classified map +plot(sinop_label) map_1 <- sits_view(sinop, red = "EVI", green = "NDVI", blue = "EVI", time = 23) diff --git a/demo/classify_sentinel2_rfor.R b/demo/classify_sentinel2_rfor.R deleted file mode 100644 index cbe1b9c43..000000000 --- a/demo/classify_sentinel2_rfor.R +++ /dev/null @@ -1,83 +0,0 @@ -# This is a demonstration of classification of a Sentinel-2 image -# tile T20LKP in Rondonia Brazil from data on AWS - -# Users need to provide AWS credentials using environment variables. -# Sys.setenv( -# "AWS_ACCESS_KEY_ID" = , -# "AWS_SECRET_ACCESS_KEY" = , -# "AWS_DEFAULT_REGION" = , -# "AWS_S3_ENDPOINT" = "s3.amazonaws.com", -# "AWS_REQUEST_PAYER" = "requester" -# ) - -# Sentinel-2/2A level 2A files in AWS are organized by sensor -# resolution. The AWS bands in 10m resolution are "B02", "B03", "B04", and "B08". -# The 20m bands are "B02", "B03", "B04", "B05", "B06", "BO7", B08", "B8A", "B11", and "B12". -# All 12 bands are available at 60m resolution. For creating data cubes from -# Sentinel-2/2A, users have to specify the `s2_resolution` parameter. - -library(sits) -library(profvis) -# define the cube -s2_cube <- sits_cube(source = "AWS", - name = "T20LKP_2018_2019", - collection = "sentinel-s2-l2a", - tiles = c("20LKP", "20LLP"), - bands = c("B03", "B04", "B08", "B11", "B12", "SCL"), - start_date = as.Date("2018-07-12"), - end_date = as.Date("2019-07-28"), - s2_resolution = 60 -) -# s2_regular_cube <- sits_regularize( -# cube = s2_cube, -# name = "T20LKP_2018_2019_regular", -# dir_images = "~/sentinel2/images", -# period = "P16D", -# agg_method = "median", -# cloud_mask = TRUE -# ) - - -csv_file <- system.file("/extdata/samples/samples_amazonia_sentinel2.csv", package = "sits") - -samples_S2_T20LKP_2018_2019 <- sits_get_data(s2_cube, file = csv_file, .n_pts_csv = 30) - -# plot the first date as a SWIR composite (B11, B08, B04) -# map_1 <- plot(s2_cube, red = "B11", green = "B08", blue = "B04", time = 1) - -# plot the last date as a SWIR composite (B11, B08, B04) -# map_2 <- plot(s2_cube, red = "B11", green = "B08", blue = "B04", time = 36) - -# train a random forest model -samples_s2_3bands <- sits_select(samples_S2_T20LKP_2018_2019, - bands = c("B03", "B08", "B11")) - -# train a multi-layer perceptron model -mlp_model <- sits_train(samples_s2_3bands, - ml_method = sits_mlp() -) - -# classify the cube using an rfor model -s2_probs <- sits_classify( - data = s2_cube, - ml_model = mlp_model, - memsize = 24, - multicores = 4, - output_dir = tempdir() -) - -# plot the probabilities -plot(s2_probs) - -s2_bayes <- sits_smooth( - cube = s2_probs, - output_dir = tempdir() -) - -s2_label <- sits_label_classification( - s2_bayes, - output_dir = tempdir() -) - -# plot the labelled images -plot(s2_label) diff --git a/inst/extdata/config.yml b/inst/extdata/config.yml index 4ddc6d396..c7260f36c 100644 --- a/inst/extdata/config.yml +++ b/inst/extdata/config.yml @@ -1,3 +1,5 @@ +# These are configuration parameters that can be set by users + # estimated relative growth size of R memory relative to block size processing_bloat : 5 @@ -13,23 +15,11 @@ gdal_creation_options : ["COMPRESS=LZW", "BIGTIFF=YES"] # configuration for gdalcubes chunk gdalcubes_chunk_size : [1, 2048, 2048] -# local cube config options -local_s3_class : ["local_cube", "raster_cube"] -local_file_extensions : ["tiff", "tif", "jp2", "hdf", "vrt"] - -# configuration for probability cubes -probs_cube_scale_factor : 0.0001 -probs_cube_data_type : "INT2U" - -# configuration for classified cubes -class_cube_data_type : "INT1U" - # maxbytes for leaflet (in MB) leaflet_max_Mbytes : 16 # estimated compression factor for leaflet leaflet_comp_factor : 0.75 - sources: BDC : s3_class : ["bdc_cube", "stac_cube", "raster_cube"] @@ -590,8 +580,9 @@ sources: AWS_DEFAULT_REGION : "eu-central-1" AWS_S3_ENDPOINT : "s3.amazonaws.com" AWS_REQUEST_PAYER : "requester" - open_data : true + open_data : false gdalcubes_format_col : "s2la_aws.json" + gdalcubes_type_format: "int16" SENTINEL-S2-L2A-COGS : bands : B01 : &aws_cog_msi_60m @@ -672,6 +663,7 @@ sources: open_data: true open_data_token: false gdalcubes_format_col : "s2la_aws_cogs.json" + gdalcubes_type_format: "int16" DEAFRICA : s3_class : ["deafrica_cube", "stac_cube", "raster_cube"] service : "STAC" @@ -757,6 +749,7 @@ sources: open_data: true open_data_token: false gdalcubes_format_col : "s2_l2a_deafrica.json" + gdalcubes_type_format: "int16" LS8_SR : &deafrica_l8 bands : B01 : &deafrica_oli_30m @@ -813,6 +806,7 @@ sources: open_data: true open_data_token: false gdalcubes_format_col : "ls8_sr_deafrica.json" + gdalcubes_type_format: "int16" USGS : s3_class : ["usgs_cube", "stac_cube", "raster_cube"] service : "STAC" @@ -878,78 +872,144 @@ sources: open_data_token: false tile_required: false gdalcubes_format_col : "l8c2l2_usgs.json" - -# Default palette is based on ColorBrewer -palettes: - default: - # Natural Vegetation uses "Greens" palette (9 colors) - # Forest uses "Greens" color 9 - Forest : "#00441B" - # Dense Woodlands and similar use "Greens" color 7 - Cerradao : "#238B45" - Dense_Woodland : "#238B45" - Dense_Tree_Savanna: "#238B45" - # Savanna Parkland uses "Greens" color 6 - Savanna_Parkland : "#41AB5D" - # Savanna and Cerrado use "Greens" color 5 - Savanna : "#74C476" - Cerrado : "#74C476" - # Campo Cerrado uses "Greens" color 4 - Campo_Cerrado : "#A1D99B" - # Cerrado Rupestre and Rocky Savanna use "Greens" color 4 - Cerrado_Rupestre : "#C7E9C0" - Rocky_Savanna : "#C7E9C0" - NatNonVegetated : "D9F0A3" - # Silviculture and Planted Forest use color 4 of "BuGn" 9-color palette - Silviculture : "#66C2A4" - Planted Forest : "#66C2A4" - # Shrublands are a mix of savanna and pasture without trees - # use color 4 of the 9-color "YlGn" palette - Shrublands : "#ADDD8E" - # Non forest uses the same color as shrublands - NonForest : "#ADDD8E" - # Grasslands are a mix of savanna and pasture - # In the tropics, they area associated to human actions - # use color 3 of the 9-color "YlGn" palette - Grasslands : "#D9F0A3" - # Pasture results from human actions - # use color 2 of the 9-color "YlGn" palette - Pasture : "#F7FCB9" - # Araguaia and Wetlands use color 5 of the "GnBu" 9-color palette - Araguaia : "#7BCCC4" - Wetlands : "#7BCCC4" - # Water uses color 7 of the "GnBu" 9-color palette - Water : "#2B8CBE" - # Dunes use color 1 of the "YlGn" palette - Dunas : "#FFFFE5" - Dunes : "#FFFFE5" - # Cropland uses class 6 of the "YlOrRd" pallette - Cropland : "#FC4E2A" - # Cotton uses colors 4-5 of the "YlOrRd" pallette - Cotton : "#FD8D3C" - Fallow_Cotton : "#FD8D3C" - Millet_Cotton : "#FEB24C" - # Beans, Corn and Sugarcane use colors 4-6 of the "OrRd" palette - Beans : "#FDBB84" - Corn : "#FC8D59" - Sugarcane : "#EF6548" - # Variations of Soy use the 9-color "Oranges" palette - # Soy_Corn uses color 7 of the "Oranges" palette - Soy_Corn : "#D94801" - # Soy_Millet uses color 6 of the "Oranges" palette - Soy_Millet : "#F16913" - # Soy_Sorghum uses color 6 of the "Oranges" palette - Soy_Sorghum : "#F16913" - # Soy_Cotton uses color 5 of the "Oranges" palette - Soy_Cotton : "#FD8D3C" - # Soy_Sunflower uses color 4 of the "Oranges" palette - Soy_Sunflower : "#FDAE6B" - # Soy_Fallow uses color 3 of the "Oranges" palette - Soy_Fallow : "#FDD0A2" - # Deforestation uses color 4 of the "PuRd" palette - Deforestation : "#C994C7" - # Urban Areas uses color 4 of the "Purple" palette - Urban_Area : "#BCBDDDC" - # No Class uses color 4 of the "Greys" palette - No_Class : "#F0F0F0" - + gdalcubes_type_format: "int16" + MSPC : + s3_class : ["mspc_cube", "stac_cube", "raster_cube"] + service : "STAC" + rstac_version : "1.0.0" + url : "https://planetarycomputer.microsoft.com/api/stac/v1" + collections : + LANDSAT-8-C2-L2 : &mspc_oli + bands : + B01 : &mspc_oli_30m + missing_value : 0 + minimum_value : 7273 + maximum_value : 43636 + scale_factor : 0.0000275 + offset_value : -0.2 + resampling : "bilinear" + resolution : 30 + band_name : "SR_B1" + B02 : + <<: *mspc_oli_30m + band_name : "SR_B2" + B03 : + <<: *mspc_oli_30m + band_name : "SR_B3" + B04 : + <<: *mspc_oli_30m + band_name : "SR_B4" + B05 : + <<: *mspc_oli_30m + band_name : "SR_B5" + B06 : + <<: *mspc_oli_30m + band_name : "SR_B6" + B07 : + <<: *mspc_oli_30m + band_name : "SR_B7" + CLOUD : + bit_mask : TRUE + band_name : "QA_PIXEL" + values : + 0 : "missing_data" + 1 : "Dilated Cloud" + 2 : "High confidence cirrus" + 3 : "High confidence cloud" + 4 : "High confidence cloud shadow" + 5 : "High confidence snow cover" + 6 : "Clear" + 7 : "Water" + 9 : "High confidence of cloud" + 11 : "High confidence of cloud shadow" + 13 : "High confidence of snow" + 15 : "High confidence of cirrus" + interp_values : [0, 1, 2, 3, 4, 5] + resampling : "near" + resolution : 30 + satellite : "LANDSAT-8" + sensor : "OLI" + collection_name: "landsat-8-c2-l2" + open_data: true + open_data_token: false + tile_required: false + gdalcubes_format_col : "landsat_8_c2_l2_mspc.json" + gdalcubes_type_format: "int16" + SENTINEL-2-L2A : &mspc_msi + bands : + B01 : &mspc_msi_60m + missing_value : -9999 + minimum_value : 0 + maximum_value : 10000 + scale_factor : 0.0001 + offset_value : 0 + resolution : 60 + band_name : "B01" + B02 : &mspc_msi_10m + missing_value : -9999 + minimum_value : 0 + maximum_value : 10000 + scale_factor : 0.0001 + offset_value : 0 + resolution : 10 + band_name : "B02" + B03 : + <<: *mspc_msi_10m + band_name : "B03" + B04 : + <<: *mspc_msi_10m + band_name : "B04" + B05 : &mspc_msi_20m + missing_value : -9999 + minimum_value : 0 + maximum_value : 10000 + scale_factor : 0.0001 + offset_value : 0 + resolution : 20 + band_name : "B05" + B06 : + <<: *mspc_msi_20m + band_name : "B06" + B07 : + <<: *mspc_msi_20m + band_name : "B07" + B08 : + <<: *mspc_msi_10m + band_name : "B08" + B8A : + <<: *mspc_msi_20m + band_name : "B8A" + B09 : + <<: *mspc_msi_60m + band_name : "B09" + B11 : + <<: *mspc_msi_20m + band_name : "B11" + B12 : + <<: *mspc_msi_20m + band_name : "B12" + CLOUD : + bit_mask : FALSE + band_name : "SCL" + values : + 0 : "missing_data" + 1 : "defective pixel" + 2 : "shadows" + 3 : "cloud shadows" + 4 : "vegetation" + 5 : "non-vegetated" + 6 : "water" + 7 : "unclassified" + 8 : "cloud medium" + 9 : "cloud high" + 10 : "thin cirrus" + 11 : "snow or ice" + interp_values : [0, 1, 2, 3, 8, 9, 10, 11] + resolution : 20 + satellite : "SENTINEL-2" + sensor : "MSI" + collection_name: "sentinel-2-l2a" + open_data: true + open_data_token: false + gdalcubes_format_col : "sentinel_2_l2a_mspc.json" + gdalcubes_type_format: "int16" diff --git a/inst/extdata/config_colors.yml b/inst/extdata/config_colors.yml new file mode 100644 index 000000000..7b64488a7 --- /dev/null +++ b/inst/extdata/config_colors.yml @@ -0,0 +1,275 @@ +# Default Palette includes: +# Most classes of the "Brazilian Vegetation Manual" (IBGE,2001) +# IPCC AFOLU, TerraClass project, IGBP Discover, Copernicus Global Land Cover + +# Basic palette for Amazonia and Cerrado natural veg is based on "Greens" palette expanded to 18 colors +# colors_nat_18 <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "Greens"))(18) + +# Palette for Caatinga is based on "BuGn" palette expanded to 15 colors +# colors_caatinga <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9,"BuGn"))(15) + +# Planted Forest (Silviculture) and Pasture are represented by shades of mixed "BuGn" +# colors_mixed <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "BuGn"))(18) + +# Palette for temporary crops is ColorBrewer "YlOrBr" expanded to 18 colors +# colors_agro <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "YlOrBr"))(18) + +# Palette for permanent crops is low end of ColorBrewer "Reds" expanded to 18 colors +# colors_perm_agric <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "Reds"))(18) + +# Palette for deforestation and degradation is "RdPu" expanded to 18 colors +# colors_def_deg <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "RdPu"))(18) + +# Palette for wetlands and similar is "YlGnBu" expanded to 18 colors +# colors_water <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "YlGnBu"))(18) + +colors: + # Natural Vegetation ------------------ + # Boreal Forest : color 17 of "Greens-18" + Evergreen_Needleleaf_Forest : "#005723" + # Forest: color 14 of "Greens-18" + Forest : "#1E8742" + Floresta : "#1E8742" + Formacao_Florestal : "#1E8742" + Floresta_Ombrofila_Densa : "#1E8742" + Floresta_Tropical_Fluvial : "#1E8742" + Floresta_Ombrofila_Mista : "#1E8742" + Evergreen_Broadleaf_Forest : "#1E8742" + Closed_Forests : "#1E8742" + # Dense Woodlands and similar: color 12 of "Greens-18" + Cerradao : "#3BA558" + Savana_Florestada : "#3BA558" + Dense_Woodland : "#3BA558" + Dense_Tree_Savanna : "#3BA558" + Formacao_Savanica : "#3BA558" + Woody_Savannas : "#3BA558" + Floresta_Ombrofila_Aberta : "#3BA558" + Mata_Araucaria : "#3BA558" + Floresta_Estacional : "#3BA558" + Campinarana_Florestada : "#3BA558" + Campinarana_Arborizada : "#3BA558" + # Mixed Forest - color 10 of "Greens-18" + Mixed_Forest : "#68BE70" + # Savanna and Cerrado: color 9 of "Greens-18" + Savanna : "#7EC87E" + Savannas : "#7EC87E" + Cerrado : "#7EC87E" + Savana_Arborizada : "#7EC87E" + Cerrado_Strictu_Sensu : "#7EC87E" + Cerrado_Tipico : "#7EC87E" + # Savana Parque and similar: color 6 of "Greens-18" + Savanna_Parkland : "#B9E3B2" + Savana_Parque : "#B9E3B2" + Campo_Cerrado : "#B9E3B2" + Formacao_Campestre : "#B9E3B2" + Araguaia : "#B9E3B2" + NatNonForested : "#B9E3B2" + Natual_Nao_Florestado : "#B9E3B2" + Natural_Non_Forested : "#B9E3B2" + NonForest : "#B9E3B2" + NaoFloresta : "#B9E3B2" + Non_Forest : "#B9E3B2" + Nao_Floresta : "#B9E3B2" + Campinarana_Arbustiva : "#B9E3B2" + Closed_Shrublands : "#B9E3B2" + Formacoes_Nao_Florestais : "#B9E3B2" + # Grasslands: color 5 of "Greens-18" + Grasslands : "#CAEAC3" + Grass : "#CAEAC3" + Estepe : "#CAEAC3" + Steppe : "#CAEAC3" + Herbaceous_Vegetation : "#CAEAC3" + # Cerrado Rupestre and Rocky Savanna: color 4 of "Greens-18" + # Also Natural Non Vegetated + Savana_Gramineo_Lenhosa : "#E6F5E1" + Campinarana_Gramineo_Lenhosa : "#E6F5E1" + Cerrado_Rupestre : "#E6F5E1" + Rocky_Savanna : "#E6F5E1" + Shrublands : "#E6F5E1" + Scrublands : "#E6F5E1" + Shrubland : "#E6F5E1" + Scrubland : "#E6F5E1" + Open_Shrublands : "#E6F5E1" + # Barren or Sparsely Vegetated: color 2 of "Greens-18" + NatNonVegetated : "#EEF8EB" + Natural_Sem_Vegetacao : "#EEF8EB" + NatNaoVegetado : "#EEF8EB" + Natural_Nao_Vegetado : "#EEF8EB" + Barren : "#EEF8EB" + Sparsely_Vegetated : "#EEF8EB" + Bare_Sparse_Vegetation : "#EEF8EB" + Afloramento_Rochoso : "#EEF8EB" + + # Savana Estépica (Caatinga) classes uses "BuGn-15" + # Savana Estepica Florestada : class 8 of "BuGn-15" + Savana_Estepica_Florestada : "#66C2A4" + Deciduous_Needleleaf_Forest : "#66C2A4" + # Savana Estepica Arborizada : class 6 of "BuGn-15" + Caatinga : "#A0DACD" + Savana_Estepica_Arborizada : "#A0DACD" + Deciduous_Broadleaf_Forest : "#66C2A4" + Deciduous_Forest : "#66C2A4" + # Savana Estepica Parque : class 5 of "BuGn-15" + Savana_Estepica_Parque : "#BDE6DD" + # Savana Estepica Gramineo_Lenhosa : class 4 of "BuGn-15" + Savana_Estepica_Gramineo_Lenhosa : "#D3EEEB" + + # Mixed Classes - Secondary Vegetaton, Pasture and Silviculture + # Use a mixture of Green and Blue to indicate human action + # Secondary Vegetation : class 12 of "BuGn-18" + Secondary_Vegetation : "#3BA76D" + Vegetacao_Secundaria : "#3BA76D" + Veg_Sec : "#3BA76D" + # Silviculture and Planted Forest: color 9 of "BuGn-18" + Silviculture : "#72C7AC" + Planted_Forest : "#72C7AC" + Silvicultura : "#72C7AC" + Floresta_Plantada : "#72C7AC" + Eucalyptus : "#72C7AC" + # Pasture: color 5 of "BuGn-18" + Pasture : "#CEEDE8" + Pastagem : "#CEEDE8" + # Pastagem Cultivada Arbustiva - color 6 + Pastagem_Cultivada_Arbustiva: "#BAE4DB" + # Pastagem Cultivada Herbacea - color 3 + Pastagem_Cultivada_Herbacea: "#E6F5F9" + + + # Cropland Pasture mixture: color 4 of "YlOrBr-18" + Mosaico_Agricultura_Pastagem: "#FEEEAA" + + # Temporary Agricuture uses "YlOrBr-18" palette + # Cropland: color 10 + Cropland : "#F98F24" + Agricultura : "#F98F24" + Agricultura_Temporaria : "#F98F24" + Lavoura_Temporaria : "#F98F24" + Agri_Temp : "#F98F24" + Agricultura_Anual : "#F98F24" + Temp_Crop : "#F98F24" + Temporary_Crop : "#F98F24" + # Agricultura 1 ciclo uses color 6 + Agricultura_1_ciclo : "#FED879" + Agric_1_ciclo : "#FED879" + Crop_1_cycle : "#FED879" + # Agricultura_2_ciclos uses color 11 + Agric_2_ciclos : "#F17C1A" + Agricultura_2_ciclos : "#F17C1A" + + # Wheat uses color 1 of "YlOrBr-18" + Wheat : "#FFFFE5" + Trigo : "#FFFFE5" + # Hay uses color 2 of "YlOrBr-18" + Hay : "#FFFBD1" + Feno : "#FFFBD1" + # Soy_Fallow uses color 4 + Soy_Fallow : "#FEEEAA" + Soy : "#FEEEAA" + Soybean : "#FEEEAA" + Soybeans : "#FEEEAA" + Soja : "#FEEEAA" + Soja_Pousio : "#FEEEAA" + # Soy_Sunflower uses color 6 + Soy_Sunflower : "#FED879" + Soja_Girassol : "#FED879" + # Soy_Millet uses color 7 + Soy_Millet : "#FEC95A" + Soja_Milheto : "#FEC95A" + # Soy_Sorghum uses color 7 + Soy_Sorghum : "#FEC95A" + Soja_Sorgo : "#FEC95A" + # Soy_Corn uses color 10 + Soy_Corn : "#F98F24" + Soja_Milho : "#F98F24" + # Soy_Cotton uses color 12 + Soy_Cotton : "#E66910" + Soja_Algodao : "#E66910" + # Cotton: color 13 of "YlOrBr-18" + Cotton : "#D75808" + Fallow_Cotton : "#D75808" + Millet_Cotton : "#D75808" + Algodao : "#D75808" + Pousio_Algodao : "#D75808" + # Sorghum and Millet use color 14 of "YlOrBr-18" + Sorghum : "#C64902" + Sorgo : "#C64902" + Millet : "#C64902" + Milheto : "#C64902" + # Corn uses color 15 of "YlOrBr-18" + Corn : "#AE3D03" + Milho : "#AE3D03" + Maize : "#AE3D03" + # Beans uses color 17 of "YlOrBr-18" + Beans : "#7E2C05" + Feijao : "#7E2C05" + + # Permanent Agriculture classes: low end of "Reds-18" + # Permanent Agriculture proper: color 8 of "Reds-18" + Permanent_Agriculture : "#FB8666" + Agricultura_Permanente : "#FB8666" + Agricultura_Perene : "#FB8666" + Lavoura_Perene : "#FB8666" + Cultura_Agricola_Perene : "#FB8666" + # Coffee uses color 8 of "YlOrBr-18" + Coffee : "#FB8666" + Cafe : "#FB8666" + # Semi-perenial crops + # Sugarcane uses color 5 of "Reds-18" + Semi_Perenial_Crop : "#FCBFA6" + Cultura_Agricola_Semiperene : "#FCBFA6" + Sugarcane : "#FCBFA6" + Cana : "#FCBFA6" + Cana_de_Acucar : "#FCBFA6" + + # Deforestation, Degradation, Mining use "RdPu-18" + # Deforestation uses color 13 of "RdPu-18" palette + Deforestation : "#BE1386" + Desmatamento : "#BE1386" + # Degradation uses color 9 of "RdPu-18" palette + Degradation : "#F774A5" + Degradacao : "#F774A5" + # Mining uses color 5 of "RdPu-18" palette + Mining : "#FCC8C3" + Mineracao : "#FCC8C3" + + # Water related classes use "YlGnBu-18" + # Mangue (Mangroves) use class 5 + Mangue : "#CBEAB3" + Mangrove : "#CBEAB3" + Apicum : "#CBEAB3" + # Restinga = use class 7 + Restinga_Arborizada : "#8BD1B9" + # Wetlands: color 9 of "YlGnBu-18" + Wetlands : "#4FBBC1" + Permanent_Wetlands : "#4FBBC1" + Herbacious_Wetland : "#4FBBC1" + Campo_Alagado : "#4FBBC1" + Area_Pantanosa : "#4FBBC1" + # Water: color 12 of the "YlGnBu-18" + Water : "#1D87BB" + + # Mosaic classes use color 2 of "YlGn-9" Brewer palette + Mosaico_Ocupacoes : "#F7FCB9" + Cropland_Natural_Vegetation_Mosaic : "#F7FCB9" + + # Urban Areas use color 9 of the "RdGy-11" palette + Urban_Area : "#878787" + Urbano : "#878787" + Area_Urbana : "#878787" + Urban : "#878787" + Area_Urbanizada : "#878787" + Urban_And_Built-Up : "#878787" + # Dunes: color 7 of the "PRGn-11" + Dunas : "#F7F7F7" + Dunes : "#F7F7F7" + # No Class uses color 2 of the "Greys-9" palette + No_Class : "#F0F0F0" + Nao_Classificado : "#F0F0F0" + Unclassified : "#F0F0F0" + Sem_Classe : "#F0F0F0" + Uncultivated : "#F0F0F0" + Uncultivated_Soil : "#F0F0F0" + Conversion_Area : "#F0F0F0" + No_Samples : "#F0F0F0" + Area_Nao_Observada : "#F0F0F0" + Nao_Observado : "#F0F0F0" diff --git a/inst/extdata/config_internals.yml b/inst/extdata/config_internals.yml new file mode 100644 index 000000000..96087ab4c --- /dev/null +++ b/inst/extdata/config_internals.yml @@ -0,0 +1,58 @@ +# Internal configuration parameters - relevant only to sits developers +# s3 classes known to sits +sits_s3_classes : ["sits", "patterns", "predicted", "sits_model", + "sits_cube", "raster_cube", "probs_cube", + "classified_image", + "wtss_cube", "satveg_cube", + "stac_cube", "bdc_cube", "aws_cube", + "usgs_cube", "deafrica_cube"] + +# mandatory columns in data cube description +sits_cube_cols : ["source", "collection", "satellite", "sensor", + "tile", "bands", "xmin", "xmax", "ymin", "ymax", + "crs", "labels"] + +# mandatory columns in tibble description +sits_tibble_cols : ["longitude", "latitude", "start_date", + "end_date", "label", "cube", + "time_series"] + +# mandatory columns in predicted time series classification +ts_predicted_cols: ["from", "to", "class", "probs"] + +# supported user sample file formats +sample_file_formats : ["csv", "shp"] + +# mandatory columns in CSV input files +csv_sample_columns : ["longitude", "latitude", "start_date", "end_date", "label"] + +# possible som evaluations +som_outcomes : ["clean", "analyze", "remove"] + +# supported shp types +sf_geom_types_supported : ["POINT", "POLYGON", "MULTIPOLYGON"] + +# local cube config options +local_s3_class : ["local_cube", "raster_cube"] +local_file_extensions : ["tiff", "tif", "jp2", "hdf", "vrt"] + +# configuration for probability cubes +probs_cube_scale_factor : 0.0001 +probs_cube_data_type : "INT2U" + +# configuration for classified cubes +class_cube_data_type : "INT1U" + +# valid aggregation methods for gdalcubes +gdalcubes_aggreg_methods : ["min", "max", "mean", "median", "first"] + +# valid resampling methods for gdalcubes +gdalcubes_resampling_methods : ["near", "bilinear", "bicubic", "cubicspline", + "lanczos"] + +# valid raster data types +valid_raster_data_types : ["INT1U", "INT2U", "INT2S", "INT4U", + "INT4S", "FLT4S", "FLT8S"] + +# deep learning activation methods +dl_activation_methods : ["relu", "elu", "selu", "sigmoid"] diff --git a/inst/extdata/config_user_example.yml b/inst/extdata/config_user_example.yml index 494b5f1e6..7055d4ee8 100644 --- a/inst/extdata/config_user_example.yml +++ b/inst/extdata/config_user_example.yml @@ -4,10 +4,9 @@ rstac_pagination_limit : 999 gdal_creation_options : ["COMPRESS=LZW", "BIGTIFF=YES"] -palettes: - my_project: - Cropland: "khaki" - Deforestation: "sienna" - Forest : "darkgreen" - Grassland : "lightgreen" - NonForest: "lightsteelblue1" +colors: + Cropland: "khaki" + Deforestation: "sienna" + Forest : "darkgreen" + Grassland : "lightgreen" + NonForest: "lightsteelblue1" diff --git a/inst/extdata/gdalcubes/l8c2l2_usgs.json b/inst/extdata/gdalcubes/l8c2l2_usgs.json index 4942faa22..7afef67ce 100644 --- a/inst/extdata/gdalcubes/l8c2l2_usgs.json +++ b/inst/extdata/gdalcubes/l8c2l2_usgs.json @@ -13,38 +13,24 @@ }, "bands" : { "B01" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B1\\.TIF" }, "B02" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B2\\.TIF" }, "B03" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B3\\.TIF" }, "B04" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B4\\.TIF" }, "B05" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B5\\.TIF" }, "B06" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B6\\.TIF" }, "B07" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B7\\.TIF" }, "CLOUD" : { diff --git a/inst/extdata/gdalcubes/landsat_8_c2_l2_mspc.json b/inst/extdata/gdalcubes/landsat_8_c2_l2_mspc.json new file mode 100644 index 000000000..d78528cab --- /dev/null +++ b/inst/extdata/gdalcubes/landsat_8_c2_l2_mspc.json @@ -0,0 +1,40 @@ +{ + "description": "Image collection format for Landsat 8 Collection 2 Level 2 in Microsoft", + "references": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-8-c2-l2", + "example": "/vsicurl/https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2018/208/074/LC08_L2SR_208074_20180801_20201016_02_T1/LC08_L2SR_208074_20180801_20201016_02_T1_SR_B3.TIF", + "tags": ["Sentinel", "MSPC", "STAC"], + "pattern": ".+.TIF.*", + "images": { + "pattern": ".*oli-tirs((?:/[A-Za-z0-9_]+){4})/.*" + }, + "datetime": { + "pattern": ".*LC08_L2S[R|P](?:_[A-Za-z0-9]+){1}_([A-Za-z0-9]+).*", + "format": "%Y%m%d" + }, + "bands": { + "B01": { + "pattern": ".+_SR_B1.TIF.*" + }, + "B02": { + "pattern": ".+_SR_B2.TIF.*" + }, + "B03": { + "pattern": ".+_SR_B3.TIF.*" + }, + "B04": { + "pattern": ".+_SR_B4.TIF.*" + }, + "B05": { + "pattern": ".+_SR_B5.TIF.*" + }, + "B06": { + "pattern": ".+_SR_B6.TIF.*" + }, + "B07": { + "pattern": ".+_SR_B7.TIF.*" + }, + "CLOUD": { + "pattern": ".+_QA_PIXEL.TIF.*" + } + } +} diff --git a/inst/extdata/gdalcubes/ls8_sr_deafrica.json b/inst/extdata/gdalcubes/ls8_sr_deafrica.json index a79dba6c1..adaa0d544 100644 --- a/inst/extdata/gdalcubes/ls8_sr_deafrica.json +++ b/inst/extdata/gdalcubes/ls8_sr_deafrica.json @@ -13,38 +13,24 @@ }, "bands" : { "B01" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B1\\.TIF" }, "B02" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B2\\.TIF" }, "B03" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B3\\.TIF" }, "B04" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B4.TIF" }, "B05" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B5\\.TIF" }, "B06" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B6\\.TIF" }, "B07" : { - "nodata" : 0, - "scale" : 0.0000275, "pattern" : ".+SR_B7\\.TIF" }, "CLOUD" : { diff --git a/inst/extdata/gdalcubes/s2_l2a_deafrica.json b/inst/extdata/gdalcubes/s2_l2a_deafrica.json index 0cb469f85..38f4a0dfb 100644 --- a/inst/extdata/gdalcubes/s2_l2a_deafrica.json +++ b/inst/extdata/gdalcubes/s2_l2a_deafrica.json @@ -13,68 +13,42 @@ }, "bands" : { "B01" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B01\\.tif" }, "B02" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B02\\.tif" }, "B03" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B03\\.tif" }, "B04" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B04\\.tif" }, "B05" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B05\\.tif" }, "B06" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B06\\.tif" }, "B07" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B07\\.tif" }, "B08" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B08\\.tif" }, "B8A" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B8A\\.tif" }, "B09" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B09\\.tif" }, "B10" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B10\\.tif" }, "B11" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B11\\.tif" }, "B12" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B12\\.tif" }, "CLOUD" : { diff --git a/inst/extdata/gdalcubes/s2la_aws.json b/inst/extdata/gdalcubes/s2la_aws.json index 00562d11d..8ced15621 100644 --- a/inst/extdata/gdalcubes/s2la_aws.json +++ b/inst/extdata/gdalcubes/s2la_aws.json @@ -13,68 +13,42 @@ }, "bands" : { "B01" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B01\\.jp2" }, "B02" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B02\\.jp2" }, "B03" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B03\\.jp2" }, "B04" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B04\\.jp2" }, "B05" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B05\\.jp2" }, "B06" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B06\\.jp2" }, "B07" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B07\\.jp2" }, "B08" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B08\\.jp2" }, "B8A" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B8A\\.jp2" }, "B09" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B09\\.jp2" }, "B10" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B10\\.jp2" }, "B11" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B11\\.jp2" }, "B12" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B12\\.jp2" }, "CLOUD" : { diff --git a/inst/extdata/gdalcubes/s2la_aws_cogs.json b/inst/extdata/gdalcubes/s2la_aws_cogs.json index e72e8c21d..453fe5821 100644 --- a/inst/extdata/gdalcubes/s2la_aws_cogs.json +++ b/inst/extdata/gdalcubes/s2la_aws_cogs.json @@ -13,68 +13,42 @@ }, "bands" : { "B01" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B01\\.tif" }, "B02" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B02\\.tif" }, "B03" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B03\\.tif" }, "B04" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B04\\.tif" }, "B05" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B05\\.tif" }, "B06" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B06\\.tif" }, "B07" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B07\\.tif" }, "B08" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B08\\.tif" }, "B8A" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B8A\\.tif" }, "B09" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B09\\.tif" }, "B10" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B10\\.tif" }, "B11" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B11\\.tif" }, "B12" : { - "nodata" : 0, - "scale" : 0.0001, "pattern" : ".+B12\\.tif" }, "CLOUD" : { diff --git a/inst/extdata/gdalcubes/sentinel_2_l2a_mspc.json b/inst/extdata/gdalcubes/sentinel_2_l2a_mspc.json new file mode 100644 index 000000000..62ef93d43 --- /dev/null +++ b/inst/extdata/gdalcubes/sentinel_2_l2a_mspc.json @@ -0,0 +1,55 @@ +{ + "description" : "Image collection format for Sentinel 2 Level 2A Open Data in Microsoft Planetary Computer", + "references" : "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a", + "example" : "/vsicurl/https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/20/L/KP/2018/07/18/S2B_MSIL2A_20180718T143749_N0212_R096_T20LKP_20201011T172038.SAFE/GRANULE/L2A_T20LKP_A007129_20180718T143744/IMG_DATA/R10m/T20LKP_20180718T143749_B03_10m.tif", + "tags" : ["Sentinel", "MSPC", "STAC"], + "pattern" : ".+.tif.*", + "images" : { + "pattern" : ".*sentinel2-l2((?:/[A-Za-z0-9_.]+){10})/.*" + }, + "datetime" : { + "pattern" : ".*T\\d{2}\\w{3}_([A-Za-z0-9]+).*", + "format" : "%Y%m%dT%H%M%S" + }, + "bands" : { + "B01" : { + "pattern" : ".+_B01_60m.tif.*" + }, + "B02" : { + "pattern" : ".+_B02_10m.tif.*" + }, + "B03" : { + "pattern" : ".+_B03_10m.tif.*" + }, + "B04" : { + "pattern" : ".+_B04_10m.tif.*" + }, + "B05" : { + "pattern" : ".+_B05_20m.tif.*" + }, + "B06" : { + "pattern" : ".+_B06_20m.tif.*" + }, + "B07" : { + "pattern" : ".+B07\\.tif.*" + }, + "B08" : { + "pattern" : ".+_B08_10m.tif.*" + }, + "B8A" : { + "pattern" : ".+_B8A_20m.tif.*" + }, + "B09" : { + "pattern" : ".+_B09_60m.tif.*" + }, + "B11" : { + "pattern" : ".+_B11_20m.tif.*" + }, + "B12" : { + "pattern" : ".+_B12_20m.tif.*" + }, + "CLOUD" : { + "pattern" : ".+_SCL_20m.tif.*" + } + } +} diff --git a/inst/extdata/markdown/figures/datacube_conception.png b/inst/extdata/markdown/figures/datacube_conception.png new file mode 100644 index 000000000..9810c5352 Binary files /dev/null and b/inst/extdata/markdown/figures/datacube_conception.png differ diff --git a/inst/extdata/markdown/figures/patterns_mt.png b/inst/extdata/markdown/figures/patterns_mt.png deleted file mode 100644 index d4c99c292..000000000 Binary files a/inst/extdata/markdown/figures/patterns_mt.png and /dev/null differ diff --git a/inst/extdata/markdown/figures/plot_image_classification.png b/inst/extdata/markdown/figures/plot_image_classification.png deleted file mode 100644 index dc410d2d0..000000000 Binary files a/inst/extdata/markdown/figures/plot_image_classification.png and /dev/null differ diff --git a/inst/extdata/markdown/figures/samples_cerrado.png b/inst/extdata/markdown/figures/samples_cerrado.png deleted file mode 100644 index 27efee8ac..000000000 Binary files a/inst/extdata/markdown/figures/samples_cerrado.png and /dev/null differ diff --git a/inst/extdata/markdown/figures/sits_general_view.png b/inst/extdata/markdown/figures/sits_general_view.png new file mode 100644 index 000000000..1015afbe7 Binary files /dev/null and b/inst/extdata/markdown/figures/sits_general_view.png differ diff --git a/man/check_functions.Rd b/man/check_functions.Rd index 837642732..ff7c2f3f0 100644 --- a/man/check_functions.Rd +++ b/man/check_functions.Rd @@ -397,3 +397,4 @@ Contextual check and error conversion functions: } } } +\keyword{internal} diff --git a/man/config_colors_file.Rd b/man/config_colors_file.Rd new file mode 100644 index 000000000..c8592ac06 --- /dev/null +++ b/man/config_colors_file.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{config_colors_file} +\alias{config_colors_file} +\alias{.config_colors_file} +\title{Return the default configuration file for colors} +\usage{ +.config_colors_file() +} +\value{ +default configuration file +} +\description{ +Return the default configuration file for colors +} +\keyword{internal} diff --git a/man/config_file.Rd b/man/config_file.Rd new file mode 100644 index 000000000..c1f29c89b --- /dev/null +++ b/man/config_file.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{config_file} +\alias{config_file} +\alias{.config_file} +\title{Return the default configuration file} +\usage{ +.config_file() +} +\value{ +default configuration file +} +\description{ +Return the default configuration file +} +\keyword{internal} diff --git a/man/config_functions.Rd b/man/config_functions.Rd deleted file mode 100644 index 630b175df..000000000 --- a/man/config_functions.Rd +++ /dev/null @@ -1,68 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_config.R -\name{config_functions} -\alias{config_functions} -\alias{.config_file} -\alias{.config_user_file} -\alias{.config_get} -\alias{.config_gtiff_default_options} -\alias{.config_local_file_extensions} -\alias{.config_local_s3_class} -\alias{.config_names} -\alias{.config_palettes} -\alias{.config_palette_colors} -\alias{.config_processing_bloat} -\alias{.config_rstac_limit} -\alias{.config_raster_pkg} -\title{Get values from config file} -\usage{ -.config_file() - -.config_user_file() - -.config_get(key, default = NULL) - -.config_gtiff_default_options() - -.config_local_file_extensions() - -.config_local_s3_class() - -.config_names(key) - -.config_palettes() - -.config_palette_colors(labels, ..., palette = "default") - -.config_processing_bloat() - -.config_rstac_limit() - -.config_raster_pkg() -} -\arguments{ -\item{labels}{Vector with labels.} - -\item{...}{Additional parameters.} - -\item{collection}{Collection to be searched in the data source.} - -\item{data}{A sits data cube.} - -\item{pallete}{The palette that should be chosen based on the -configuration file.} - -\item{simplify}{A logical value that specifies whether the return should be -in vector form, if true, or list form, if false. Default value is FALSE.} - -\item{source}{Source of data cube} -} -\value{ -Functions that search for values from a key or collection - return atomic values. Check functions return invisible null values or give - an error. -} -\description{ -Functions that get values from config file. -} -\keyword{internal} diff --git a/man/config_internals_file.Rd b/man/config_internals_file.Rd new file mode 100644 index 000000000..3f89ca595 --- /dev/null +++ b/man/config_internals_file.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{config_internals_file} +\alias{config_internals_file} +\alias{.config_internals_file} +\title{Return the internal configuration file (only for developers)} +\usage{ +.config_internals_file() +} +\value{ +default configuration file +} +\description{ +Return the internal configuration file (only for developers) +} +\keyword{internal} diff --git a/man/dot-config_check_bands.Rd b/man/dot-config_check_bands.Rd index baa4e8af4..99085cd35 100644 --- a/man/dot-config_check_bands.Rd +++ b/man/dot-config_check_bands.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_config.R \name{.config_check_bands} \alias{.config_check_bands} -\title{Check cube collection} +\title{Check band availability} \usage{ .config_check_bands(source, collection, bands) } @@ -17,5 +17,6 @@ An invisible null } \description{ -A suite of check to verify collection in cube. +Checks if the requested bands are available in the collection } +\keyword{internal} diff --git a/man/dot-config_colors.Rd b/man/dot-config_colors.Rd new file mode 100644 index 000000000..e096f212b --- /dev/null +++ b/man/dot-config_colors.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_colors} +\alias{.config_colors} +\title{Get colors associated to the labels} +\usage{ +.config_colors(labels, palette = "Harmonic", rev = TRUE) +} +\arguments{ +\item{labels}{labels associated to the training classes} + +\item{palette}{palette from `grDevices::hcl.pals()` +replaces default colors +when labels are not included in the config palette} + +\item{rev}{revert the order of colors?} +} +\value{ +colors required to display the labels +} +\description{ +Get colors associated to the labels +} +\keyword{internal} diff --git a/man/dot-config_data_meta_type.Rd b/man/dot-config_data_meta_type.Rd index 4145d9d9e..a12a674d4 100644 --- a/man/dot-config_data_meta_type.Rd +++ b/man/dot-config_data_meta_type.Rd @@ -2,20 +2,17 @@ % Please edit documentation in R/sits_config.R \name{.config_data_meta_type} \alias{.config_data_meta_type} -\title{meta-type for data} +\title{Check metatype associated to the data} \usage{ .config_data_meta_type(data) } \arguments{ -\item{data}{tibble (time series or cube)} +\item{data}{time series or cube} } \value{ -file path to the appended to data_dir +an error if the meta data type is wrong } \description{ -meta-type for data -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} +associates a valid SITS class to the data } \keyword{internal} diff --git a/man/dot-config_get.Rd b/man/dot-config_get.Rd new file mode 100644 index 000000000..8dc8d369c --- /dev/null +++ b/man/dot-config_get.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_get} +\alias{.config_get} +\title{Given a key, get config values} +\usage{ +.config_get(key, default = NULL) +} +\value{ +config values associated to a key +} +\description{ +Given a key, get config values +} +\keyword{internal} diff --git a/man/dot-config_gtiff_default_options.Rd b/man/dot-config_gtiff_default_options.Rd new file mode 100644 index 000000000..d84f219c6 --- /dev/null +++ b/man/dot-config_gtiff_default_options.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_gtiff_default_options} +\alias{.config_gtiff_default_options} +\title{Check GEOTIFF creation options} +\usage{ +.config_gtiff_default_options() +} +\value{ +the creation options associated to the configuration +} +\description{ +Check GEOTIFF creation options +} +\keyword{internal} diff --git a/man/dot-config_local_file_extension.Rd b/man/dot-config_local_file_extension.Rd new file mode 100644 index 000000000..34db2e2a3 --- /dev/null +++ b/man/dot-config_local_file_extension.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_local_file_extension} +\alias{.config_local_file_extension} +\alias{.config_local_file_extensions} +\title{Get local file extensions} +\usage{ +.config_local_file_extensions() +} +\value{ +local file extensions known to sits +} +\description{ +Get local file extensions +} +\keyword{internal} diff --git a/man/dot-config_local_s3_class.Rd b/man/dot-config_local_s3_class.Rd new file mode 100644 index 000000000..9d1c5f7f7 --- /dev/null +++ b/man/dot-config_local_s3_class.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_local_s3_class} +\alias{.config_local_s3_class} +\title{Get local S3 class} +\usage{ +.config_local_s3_class() +} +\value{ +classes associated to local cubes +} +\description{ +Get local S3 class +} +\keyword{internal} diff --git a/man/dot-config_names.Rd b/man/dot-config_names.Rd new file mode 100644 index 000000000..7cf951dab --- /dev/null +++ b/man/dot-config_names.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_names} +\alias{.config_names} +\title{Get names associated to a configuration key} +\usage{ +.config_names(key) +} +\arguments{ +\item{key}{key combination to access config information} +} +\value{ +names associated to the chosen access key +} +\description{ +Get names associated to a configuration key +} +\keyword{internal} diff --git a/man/dot-config_new_band.Rd b/man/dot-config_new_band.Rd new file mode 100644 index 000000000..8bdd8652d --- /dev/null +++ b/man/dot-config_new_band.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_new_band} +\alias{.config_new_band} +\title{Include a new band in the configuration} +\usage{ +.config_new_band( + missing_value, + minimum_value, + maximum_value, + scale_factor, + offset_value, + band_name, + resolution, + ... +) +} +\arguments{ +\item{missing_value}{missing value} + +\item{minimum_value}{minimum value} + +\item{maximum_value}{maximum_value} + +\item{scale_factor}{scale_factor associated with the data} + +\item{offset_value}{offset_value for the band} + +\item{band_name}{name of the band} + +\item{resolution}{spatial resolution (in meters)} + +\item{...}{other relevant parameters} +} +\value{ +list with the configuration associated to the new band +} +\description{ +creates a description associated to a new band +} +\keyword{internal} diff --git a/man/dot-config_new_cloud_band.Rd b/man/dot-config_new_cloud_band.Rd new file mode 100644 index 000000000..30e1627b1 --- /dev/null +++ b/man/dot-config_new_cloud_band.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_new_cloud_band} +\alias{.config_new_cloud_band} +\title{Include a new cloud band in the configuration} +\usage{ +.config_new_cloud_band( + bit_mask, + values, + interp_values, + resolution, + band_name, + ... +) +} +\arguments{ +\item{bit_mask}{bit mask to describe clouds (if applicable)} + +\item{interp_values}{pixel values that need to be replaced by interpolation} + +\item{resolution}{spatial resolution (in meters)} + +\item{band_name}{name of the band} + +\item{...}{other relevant parameters} + +\item{value}{values of the cloud band} +} +\value{ +list with the configuration associated to the new band +} +\description{ +creates a description associated to a new cloud band +} +\keyword{internal} diff --git a/man/dot-config_new_collection.Rd b/man/dot-config_new_collection.Rd new file mode 100644 index 000000000..84c6faa37 --- /dev/null +++ b/man/dot-config_new_collection.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_new_collection} +\alias{.config_new_collection} +\title{Include a new collection in the configuration} +\usage{ +.config_new_collection(bands, ..., satellite = NULL, sensor = NULL) +} +\arguments{ +\item{bands}{bands associated to the collection} + +\item{...}{other relevant parameters} + +\item{satellite}{satellite associated to the collection} + +\item{sensor}{sensor associated to the collection} +} +\value{ +list with the configuration associated to the new collection +} +\description{ +creates a new collection associated to a source +} +\keyword{internal} diff --git a/man/dot-config_new_source.Rd b/man/dot-config_new_source.Rd new file mode 100644 index 000000000..8d5fe1620 --- /dev/null +++ b/man/dot-config_new_source.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_new_source} +\alias{.config_new_source} +\title{Include a new source in the configuration} +\usage{ +.config_new_source(s3_class, collections, ..., service = NULL, url = NULL) +} +\arguments{ +\item{s3_class}{s3 class associated to the source} + +\item{collections}{collections associated to the source} + +\item{...}{other parameters associated to the new source} + +\item{service}{protocol associated to the source (e.g., "STAC")} + +\item{url}{url associated to the endpoint of the service} +} +\value{ +list with the configuration associated to the new source +} +\description{ +creates a new data source in the config file +} +\keyword{internal} diff --git a/man/dot-config_processing_bloat.Rd b/man/dot-config_processing_bloat.Rd new file mode 100644 index 000000000..715d382aa --- /dev/null +++ b/man/dot-config_processing_bloat.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_processing_bloat} +\alias{.config_processing_bloat} +\title{Retrieve the processing bloat} +\usage{ +.config_processing_bloat() +} +\value{ +estimated processing bloat +} +\description{ +Retrieve the processing bloat +} +\keyword{internal} diff --git a/man/dot-config_raster_pkg.Rd b/man/dot-config_raster_pkg.Rd new file mode 100644 index 000000000..4f7b393bf --- /dev/null +++ b/man/dot-config_raster_pkg.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_raster_pkg} +\alias{.config_raster_pkg} +\title{Retrieve the raster package to be used} +\usage{ +.config_raster_pkg() +} +\value{ +the raster package used to process raster data +} +\description{ +Retrieve the raster package to be used +} +\keyword{internal} diff --git a/man/dot-config_rstac_limit.Rd b/man/dot-config_rstac_limit.Rd new file mode 100644 index 000000000..9b54269d3 --- /dev/null +++ b/man/dot-config_rstac_limit.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_rstac_limit} +\alias{.config_rstac_limit} +\title{Retrieve the rstac pagination limit} +\usage{ +.config_rstac_limit() +} +\value{ +pagination limit to rstac output +} +\description{ +Retrieve the rstac pagination limit +} +\keyword{internal} diff --git a/man/dot-config_user_file.Rd b/man/dot-config_user_file.Rd new file mode 100644 index 000000000..9cca004c1 --- /dev/null +++ b/man/dot-config_user_file.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_config.R +\name{.config_user_file} +\alias{.config_user_file} +\title{Return the user configuration file} +\usage{ +.config_user_file() +} +\value{ +user configuration file +} +\description{ +Return the user configuration file +} +\keyword{internal} diff --git a/man/dot-sits_MASS_ginv.Rd b/man/dot-sits_MASS_ginv.Rd index a100d554b..368a920ec 100644 --- a/man/dot-sits_MASS_ginv.Rd +++ b/man/dot-sits_MASS_ginv.Rd @@ -21,3 +21,4 @@ Calculates the Moore-Penrose generalized inverse of a matrix X. Venables, W. N. and Ripley, B. D. (1999) Modern Applied Statistics with S-PLUS. } +\keyword{internal} diff --git a/man/dot-sits_brewer_color_name.Rd b/man/dot-sits_brewer_color_name.Rd deleted file mode 100644 index e3c5e8b17..000000000 --- a/man/dot-sits_brewer_color_name.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_brewer.R -\name{.sits_brewer_color_name} -\alias{.sits_brewer_color_name} -\title{Brewer color schemes} -\usage{ -.sits_brewer_color_name(name = NULL) -} -\arguments{ -\item{name}{name of the brewer color set.} -} -\value{ -A string with the common color set name. -} -\description{ -Brewer color schemes names -} -\keyword{internal} diff --git a/man/dot-sits_brewer_max_colors.Rd b/man/dot-sits_brewer_max_colors.Rd deleted file mode 100644 index f7efa7f2a..000000000 --- a/man/dot-sits_brewer_max_colors.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_brewer.R -\name{.sits_brewer_max_colors} -\alias{.sits_brewer_max_colors} -\title{Brewer color schemes} -\usage{ -.sits_brewer_max_colors(brewer = NULL) -} -\arguments{ -\item{brewer}{name of the brewer color set.} -} -\value{ -The number of available colors. -} -\description{ -Number of colors available in brewer color schemes. -} -\keyword{internal} diff --git a/man/sits_create_folds.Rd b/man/dot-sits_create_folds.Rd similarity index 75% rename from man/sits_create_folds.Rd rename to man/dot-sits_create_folds.Rd index 5b608b62b..c0bbdbf6f 100644 --- a/man/sits_create_folds.Rd +++ b/man/dot-sits_create_folds.Rd @@ -1,15 +1,15 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/sits_validate.R -\name{sits_create_folds} -\alias{sits_create_folds} +\name{.sits_create_folds} +\alias{.sits_create_folds} \title{Create partitions of a data set} \usage{ -sits_create_folds(data, folds = 5) +.sits_create_folds(data, folds = 5) } \arguments{ \item{data}{A sits tibble to be partitioned.} -\item{folds}{Number of folds.} +\item{folds}{Number of folds} } \description{ Split a sits tibble into k groups, based on the label. @@ -21,3 +21,4 @@ Alexandre Ywata, \email{alexandre.ywata@ipea.gov.br} Gilberto Camara, \email{gilberto.camara@inpe.br} } +\keyword{internal} diff --git a/man/dot-sits_plot_allyears.Rd b/man/dot-sits_plot_allyears.Rd index a99039848..fddc2dbf8 100644 --- a/man/dot-sits_plot_allyears.Rd +++ b/man/dot-sits_plot_allyears.Rd @@ -4,12 +4,10 @@ \alias{.sits_plot_allyears} \title{Plot all intervals of one time series for the same lat/long together} \usage{ -.sits_plot_allyears(data, colors) +.sits_plot_allyears(data) } \arguments{ \item{data}{One or more time series (stored in a sits tibble).} - -\item{colors}{The color palette to be used (default is "Set2").} } \description{ For each lat/long location in the data, join temporal diff --git a/man/dot-sits_plot_classified_image.Rd b/man/dot-sits_plot_classified_image.Rd index b34e586d3..7c39fecce 100644 --- a/man/dot-sits_plot_classified_image.Rd +++ b/man/dot-sits_plot_classified_image.Rd @@ -4,18 +4,20 @@ \alias{.sits_plot_classified_image} \title{Plot a raster classified image} \usage{ -.sits_plot_classified_image(cube, time, title, legend, palette) +.sits_plot_classified_image(cube, time, title, legend, palette, rev) } \arguments{ -\item{cube}{A tibble with the metadata for a labelled data cube.} +\item{cube}{metadata for a labelled data cube.} -\item{time}{Temporal reference for plot.} +\item{time}{temporal reference for plot.} -\item{title}{Title of the plot} +\item{title}{title of the plot} \item{legend}{named vector that associates labels to colors.} -\item{palette}{palette provided in the configuration file} +\item{palette}{palette (one of grDevices::hcl.pals())} + +\item{rev}{revert the order of hcl palette (TRUE/FALSE)} } \description{ plots a raster using ggplot. This function is used diff --git a/man/dot-sits_plot_dendrogram.Rd b/man/dot-sits_plot_dendrogram.Rd index e47abd480..f19497c50 100644 --- a/man/dot-sits_plot_dendrogram.Rd +++ b/man/dot-sits_plot_dendrogram.Rd @@ -4,22 +4,17 @@ \alias{.sits_plot_dendrogram} \title{Plot a dendrogram} \usage{ -.sits_plot_dendrogram( - data, - cluster_obj, - cutree_height = NULL, - colors = "RdYlGn" -) +.sits_plot_dendrogram(data, cluster, cutree_height, palette) } \arguments{ \item{data}{sits tibble with data used to extract the dendrogram.} -\item{cluster_obj}{cluster object produced by `sits_cluster` function.} +\item{cluster}{cluster object produced by `sits_cluster` function.} \item{cutree_height}{dashed horizontal line to be drawn indicating the height of dendrogram cutting.} -\item{colors}{color scheme as per .sits_brewer_color_name` function.} +\item{palette}{hcl color palette} } \value{ The plot itself. diff --git a/man/dot-sits_plot_ggplot_series.Rd b/man/dot-sits_plot_ggplot_series.Rd index 5e2eb0152..c12cb9960 100644 --- a/man/dot-sits_plot_ggplot_series.Rd +++ b/man/dot-sits_plot_ggplot_series.Rd @@ -4,12 +4,10 @@ \alias{.sits_plot_ggplot_series} \title{Plot one timeSeries using ggplot} \usage{ -.sits_plot_ggplot_series(row, colors = "Dark2") +.sits_plot_ggplot_series(row) } \arguments{ \item{row}{row of a sits tibble with the time series to be plotted.} - -\item{colors}{brewer colors to be used for plotting.} } \value{ The plot itself. diff --git a/man/dot-sits_plot_ggplot_series_na.Rd b/man/dot-sits_plot_ggplot_series_na.Rd index 808beccf5..c462f9adb 100644 --- a/man/dot-sits_plot_ggplot_series_na.Rd +++ b/man/dot-sits_plot_ggplot_series_na.Rd @@ -4,12 +4,10 @@ \alias{.sits_plot_ggplot_series_na} \title{Plot one timeSeries wih NAs using ggplot} \usage{ -.sits_plot_ggplot_series_na(row, colors = "Dark2") +.sits_plot_ggplot_series_na(row) } \arguments{ \item{row}{row of a sits tibble with the time series to be plotted.} - -\item{colors}{brewer colors to be used for plotting.} } \value{ The plot itself. diff --git a/man/dot-sits_plot_ggplot_series_no_na.Rd b/man/dot-sits_plot_ggplot_series_no_na.Rd index ecba2e627..71a93f498 100644 --- a/man/dot-sits_plot_ggplot_series_no_na.Rd +++ b/man/dot-sits_plot_ggplot_series_no_na.Rd @@ -4,12 +4,10 @@ \alias{.sits_plot_ggplot_series_no_na} \title{Plot one timeSeries using ggplot (no NAs present)} \usage{ -.sits_plot_ggplot_series_no_na(row, colors = "Dark2") +.sits_plot_ggplot_series_no_na(row) } \arguments{ \item{row}{row of a sits tibble with the time series to be plotted.} - -\item{colors}{brewer colors to be used for plotting.} } \value{ The plot itself. diff --git a/man/dot-sits_plot_classification.Rd b/man/dot-sits_plot_predicted_ts.Rd similarity index 67% rename from man/dot-sits_plot_classification.Rd rename to man/dot-sits_plot_predicted_ts.Rd index 2480283c5..76f7b1ff7 100644 --- a/man/dot-sits_plot_classification.Rd +++ b/man/dot-sits_plot_predicted_ts.Rd @@ -1,15 +1,17 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/sits_plot.R -\name{.sits_plot_classification} -\alias{.sits_plot_classification} -\title{Plot classification results} +\name{.sits_plot_predicted_ts} +\alias{.sits_plot_predicted_ts} +\title{Plot time series classification results} \usage{ -.sits_plot_classification(data, bands = NULL) +.sits_plot_predicted_ts(data, bands, palette) } \arguments{ \item{data}{sits tibble with classified time series.} \item{bands}{band for plotting the classification.} + +\item{palette}{hcl palette used for visualisation} } \value{ The plot itself. diff --git a/man/dot-sits_plot_som_evaluate_cluster.Rd b/man/dot-sits_plot_som_evaluate_cluster.Rd index 25714e1ac..7302857e6 100644 --- a/man/dot-sits_plot_som_evaluate_cluster.Rd +++ b/man/dot-sits_plot_som_evaluate_cluster.Rd @@ -13,9 +13,9 @@ \arguments{ \item{data}{Percentage of mixture between the clusters} -\item{title}{Title of plot.} +\item{cluster_name}{Choose the cluster to plot} -\item{name_cluster}{Choose the cluster to plot} +\item{title}{Title of plot.} } \value{ ggplot2 object diff --git a/man/dot-sits_plot_som_map.Rd b/man/dot-sits_plot_som_map.Rd index 57e10067b..adc8ad003 100644 --- a/man/dot-sits_plot_som_map.Rd +++ b/man/dot-sits_plot_som_map.Rd @@ -4,14 +4,14 @@ \alias{.sits_plot_som_map} \title{Plot the SOM grid with neurons labeled} \usage{ -.sits_plot_som_map(koh, type = "codes", whatmap = 1) +.sits_plot_som_map(koh, type = "codes", band = 1) } \arguments{ \item{koh}{SOM map produced by "sits_som_map" function} \item{type}{Type of plot ("codes" or "mapping")} -\item{whatmap}{What data layer will be plotted.} +\item{band}{What band will be plotted} } \description{ Given a kohonen object with a set of time neurons, plot them. diff --git a/man/dot-sits_plot_together.Rd b/man/dot-sits_plot_together.Rd index 1925f7395..5c4d3cc78 100644 --- a/man/dot-sits_plot_together.Rd +++ b/man/dot-sits_plot_together.Rd @@ -4,12 +4,10 @@ \alias{.sits_plot_together} \title{Plot a set of time series for the same spatio-temporal reference} \usage{ -.sits_plot_together(data, colors) +.sits_plot_together(data) } \arguments{ \item{data}{A sits tibble with the list of time series to be plotted.} - -\item{colors}{The color palette to be used (default is "Set1").} } \value{ The plot itself. diff --git a/man/dot-sits_signal_sgolay.Rd b/man/dot-sits_signal_sgolay.Rd new file mode 100644 index 000000000..7b1dc37ff --- /dev/null +++ b/man/dot-sits_signal_sgolay.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_signal.R +\name{.sits_signal_sgolay} +\alias{.sits_signal_sgolay} +\title{Savitsky-Golay smoothing filter coefficients} +\usage{ +.sits_signal_sgolay(p, n, m = 0, ts = 1) +} +\arguments{ +\item{p}{Filter order (integer).} + +\item{n}{Filter length (must be odd)} + +\item{m}{Derivative to calculate (default = 0)} + +\item{ts}{Time scaling (integer).} +} +\value{ +filter coefficients +} +\description{ +Computes the filter coefficients for all Savitzky-Golay smoothing +filters of order p for length n (odd). m can be used in order to +get directly the mth derivative. In this case, ts is a scaling factor. + +The early rows of F smooth based on future values and later rows +smooth based on past values, with the middle row using half future +and half past. In particular, you can use row i to estimate x(k) +based on the i-1 preceding values and the n-i following values of x +values as y(k) = F(i,:) * x(k-i+1:k+n-i). +} +\keyword{internal} diff --git a/man/dot-sits_signal_sgolayfilt.Rd b/man/dot-sits_signal_sgolayfilt.Rd index c76bc25d7..03a7552e2 100644 --- a/man/dot-sits_signal_sgolayfilt.Rd +++ b/man/dot-sits_signal_sgolayfilt.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/sits_signal.R \name{.sits_signal_sgolayfilt} \alias{.sits_signal_sgolayfilt} -\alias{.sits_signal_sgolay} \title{Savitsky-Golay smoothing filter} \usage{ .sits_signal_sgolayfilt(x, p = 3, n = p + 3 - p\%\%2, m = 0, ts = 1) - -.sits_signal_sgolay(p, n, m = 0, ts = 1) } \arguments{ \item{x}{Time series vector.} @@ -22,8 +19,6 @@ } \value{ A time series with filtered values. - -filter coefficients } \description{ Smooth the data in x with a Savitsky-Golay smoothing filter of @@ -31,19 +26,5 @@ Smooth the data in x with a Savitsky-Golay smoothing filter of and n=p+2 or n=p+3 if p is even. This filters is particularly good at preserving lineshape while removing high frequency squiggles - -Computes the filter coefficients for all Savitzky-Golay smoothing -filters of order p for length n (odd). m can be used in order to -get directly the mth derivative. In this case, ts is a scaling factor. - -The early rows of F smooth based on future values and later rows -smooth based on past values, with the middle row using half future -and half past. In particular, you can use row i to estimate x(k) -based on the i-1 preceding values and the n-i following values of x -values as y(k) = F(i,:) * x(k-i+1:k+n-i). -} -\author{ -Gilberto Camara - -Gilberto Camara } +\keyword{internal} diff --git a/man/dot-stac_bands_select.Rd b/man/dot-stac_bands_select.Rd index 6aa40b18f..6cf00d760 100644 --- a/man/dot-stac_bands_select.Rd +++ b/man/dot-stac_bands_select.Rd @@ -19,3 +19,4 @@ a \code{STACItemcollection} object with selected items by bands. \description{ Select bands in stac items by sits bands. } +\keyword{internal} diff --git a/man/dot-stac_items_query.Rd b/man/dot-stac_items_query.Rd index fda3a2478..5c8bd24ee 100644 --- a/man/dot-stac_items_query.Rd +++ b/man/dot-stac_items_query.Rd @@ -35,3 +35,4 @@ an \code{RSTACQuery} object. \description{ Creates a query using rstac package to send to STAC API. } +\keyword{internal} diff --git a/man/figures/README-unnamed-chunk-10-1.png b/man/figures/README-unnamed-chunk-10-1.png index 891786680..54b04d608 100644 Binary files a/man/figures/README-unnamed-chunk-10-1.png and b/man/figures/README-unnamed-chunk-10-1.png differ diff --git a/man/figures/README-unnamed-chunk-11-1.png b/man/figures/README-unnamed-chunk-11-1.png index 5e81515da..aa06e8ac0 100644 Binary files a/man/figures/README-unnamed-chunk-11-1.png and b/man/figures/README-unnamed-chunk-11-1.png differ diff --git a/man/figures/README-unnamed-chunk-12-1.png b/man/figures/README-unnamed-chunk-12-1.png index 9926363af..0922b95a4 100644 Binary files a/man/figures/README-unnamed-chunk-12-1.png and b/man/figures/README-unnamed-chunk-12-1.png differ diff --git a/man/figures/README-unnamed-chunk-13-1.png b/man/figures/README-unnamed-chunk-13-1.png index 9926363af..a9fc70b10 100644 Binary files a/man/figures/README-unnamed-chunk-13-1.png and b/man/figures/README-unnamed-chunk-13-1.png differ diff --git a/man/figures/README-unnamed-chunk-14-1.png b/man/figures/README-unnamed-chunk-14-1.png index 9fa8ee619..9516858e4 100644 Binary files a/man/figures/README-unnamed-chunk-14-1.png and b/man/figures/README-unnamed-chunk-14-1.png differ diff --git a/man/figures/README-unnamed-chunk-15-1.png b/man/figures/README-unnamed-chunk-15-1.png index 42012c5bc..bb6d97bad 100644 Binary files a/man/figures/README-unnamed-chunk-15-1.png and b/man/figures/README-unnamed-chunk-15-1.png differ diff --git a/man/figures/README-unnamed-chunk-8-1.png b/man/figures/README-unnamed-chunk-8-1.png index 949bb7a56..dfc1f55d0 100644 Binary files a/man/figures/README-unnamed-chunk-8-1.png and b/man/figures/README-unnamed-chunk-8-1.png differ diff --git a/man/figures/README-unnamed-chunk-9-1.png b/man/figures/README-unnamed-chunk-9-1.png index 9926363af..14c626e2f 100644 Binary files a/man/figures/README-unnamed-chunk-9-1.png and b/man/figures/README-unnamed-chunk-9-1.png differ diff --git a/man/plot.Rd b/man/plot.Rd index 6fe9f8ef5..8cf006ca7 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -3,9 +3,9 @@ \name{plot} \alias{plot} \alias{plot.sits} -\title{Generic interface for ploting time series} +\title{Plot time series} \usage{ -\method{plot}{sits}(x, y, ..., colors = "Dark2") +\method{plot}{sits}(x, y, ...) } \arguments{ \item{x}{object of class "sits"} @@ -13,9 +13,6 @@ \item{y}{ignored} \item{...}{further specifications for \link{plot}.} - -\item{colors}{Color palette to be used (based on Color Brewer -- default is "Dark2").} } \value{ The plot itself. diff --git a/man/plot.classified_image.Rd b/man/plot.classified_image.Rd index 245b0b8cc..c1480993c 100644 --- a/man/plot.classified_image.Rd +++ b/man/plot.classified_image.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_plot.R \name{plot.classified_image} \alias{plot.classified_image} -\title{Generic interface for ploting classified images} +\title{Plot classified images} \usage{ \method{plot}{classified_image}( x, @@ -11,7 +11,8 @@ time = 1, title = "Classified Image", legend = NULL, - palette = "default" + palette = "Spectral", + rev = TRUE ) } \arguments{ @@ -23,11 +24,13 @@ \item{time}{temporal reference for plot.} -\item{title}{Title of the plot} +\item{title}{title of the plot} \item{legend}{named vector that associates labels to colors} -\item{palette}{palette provided in the configuration file} +\item{palette}{alternative palette that uses grDevices::hcl.pals()} + +\item{rev}{invert the order of hcl palette (TRUE/FALSE)} } \description{ plots a classified raster using ggplot. diff --git a/man/plot.keras_model.Rd b/man/plot.keras_model.Rd index c55e11cd2..19735adbe 100644 --- a/man/plot.keras_model.Rd +++ b/man/plot.keras_model.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_plot.R \name{plot.keras_model} \alias{plot.keras_model} -\title{Generic interface for plotting a Keras model} +\title{Plot Keras (deep learning) model} \usage{ \method{plot}{keras_model}(x, y, ...) } @@ -20,7 +20,7 @@ The plot itself. plots a deep learning model developed using keras } \examples{ -\donttest{ +\dontrun{ # Get a set of samples samples_ndvi_evi <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) diff --git a/man/plot.patterns.Rd b/man/plot.patterns.Rd index d0ba02b32..a6d8721d7 100644 --- a/man/plot.patterns.Rd +++ b/man/plot.patterns.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_plot.R \name{plot.patterns} \alias{plot.patterns} -\title{Generic interface for ploting patterns} +\title{Plot patterns that describe classes} \usage{ \method{plot}{patterns}(x, y, ...) } diff --git a/man/plot.predicted.Rd b/man/plot.predicted.Rd index c8083f7fe..8ed3d89ab 100644 --- a/man/plot.predicted.Rd +++ b/man/plot.predicted.Rd @@ -2,9 +2,9 @@ % Please edit documentation in R/sits_plot.R \name{plot.predicted} \alias{plot.predicted} -\title{Generic interface for ploting time series predictions} +\title{Plot time series predictions} \usage{ -\method{plot}{predicted}(x, y, ..., bands = "NDVI") +\method{plot}{predicted}(x, y, ..., bands = "NDVI", palette = "Harmonic") } \arguments{ \item{x}{object of class "predicted"} @@ -14,6 +14,9 @@ \item{...}{further specifications for \link{plot}.} \item{bands}{bands used for visualisation} + +\item{palette}{hcl palette used for visualisation +(in case classes are not in the default sits palette)} } \value{ The plot itself. diff --git a/man/plot.probs_cube.Rd b/man/plot.probs_cube.Rd index 363aba433..84c6123f3 100644 --- a/man/plot.probs_cube.Rd +++ b/man/plot.probs_cube.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_plot.R \name{plot.probs_cube} \alias{plot.probs_cube} -\title{Generic interface for plotting probability cubes} +\title{Plot probability cubes} \usage{ \method{plot}{probs_cube}( x, @@ -10,10 +10,8 @@ ..., time = 1, title = "Probabilities for Classes", - breaks = "kmeans", - colors = "YlGnBu", - n_colors = 10, - labels = NULL + labels = NULL, + palette = "Terrain" ) } \arguments{ @@ -27,13 +25,9 @@ \item{title}{string.} -\item{breaks}{type of breaks} - -\item{colors}{color palette.} - -\item{n_colors}{number of colors.} - \item{labels}{labels to plot (optional)} + +\item{palette}{hcl palette used for visualisation} } \value{ The plot itself. diff --git a/man/plot.raster_cube.Rd b/man/plot.raster_cube.Rd index 1f34d60a8..cf403ff65 100644 --- a/man/plot.raster_cube.Rd +++ b/man/plot.raster_cube.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_plot.R \name{plot.raster_cube} \alias{plot.raster_cube} -\title{Generic interface for RGB plotting of data cube} +\title{Plot RGB data cubes} \usage{ \method{plot}{raster_cube}(x, ..., band = NULL, red, green, blue, tile = 1, time = 1, roi = NULL) } diff --git a/man/plot.som_evaluate_cluster.Rd b/man/plot.som_evaluate_cluster.Rd index 4a028fea2..0ca4197ea 100644 --- a/man/plot.som_evaluate_cluster.Rd +++ b/man/plot.som_evaluate_cluster.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_plot.R \name{plot.som_evaluate_cluster} \alias{plot.som_evaluate_cluster} -\title{Plot information about confusion between clusters} +\title{Plot confusion between clusters} \usage{ \method{plot}{som_evaluate_cluster}(x, y, ..., name_cluster = NULL, title = "Confusion by cluster") } @@ -28,7 +28,7 @@ The percentage of mixture between the clusters. \dontrun{ # Produce a cluster map -samples_mt_2bands <- sits_select(samples_mt_6bands, bands = c("NDVI", "EVI")) +samples_mt_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) som_map <- sits_som_map(samples_mt_2bands) # Evaluate the clusters cluster_overall <- sits_som_evaluate_cluster(som_map) diff --git a/man/plot.som_map.Rd b/man/plot.som_map.Rd index 349df161f..4a3ad709d 100644 --- a/man/plot.som_map.Rd +++ b/man/plot.som_map.Rd @@ -2,9 +2,9 @@ % Please edit documentation in R/sits_plot.R \name{plot.som_map} \alias{plot.som_map} -\title{Generic interface for plotting a SOM map} +\title{Plot a SOM map} \usage{ -\method{plot}{som_map}(x, y, ..., type = "codes", whatmap = 1) +\method{plot}{som_map}(x, y, ..., type = "codes", band = 1) } \arguments{ \item{x}{Object of class "som_map"} @@ -16,7 +16,7 @@ \item{type}{Type of plot: "codes" for neuron weight (time series) and "mapping" for the number of samples allocated in a neuron.} -\item{whatmap}{What data layer will be plotted.} +\item{band}{What band will be plotted.} } \value{ The plot itself. @@ -32,7 +32,7 @@ The plot function produces different plots based on the input data: \examples{ \dontrun{ # Produce a cluster map -samples_mt_2bands <- sits_select(samples_mt_6bands, bands = c("NDVI", "EVI")) +samples_mt_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) som_map <- sits_som_map(samples_mt_2bands) # Plot the clusters plot(som_map, type = "codes") diff --git a/man/samples_mt_6bands.Rd b/man/samples_mt_6bands.Rd deleted file mode 100644 index 98fd70a13..000000000 --- a/man/samples_mt_6bands.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{samples_mt_6bands} -\alias{samples_mt_6bands} -\title{Samples of nine classes for the state of Mato Grosso} -\format{ -A tibble with 425 rows and 7 variables: - longitude: East-west coordinate of the time series sample (WGS 84), - latitude (North-south coordinate of the time series sample in WGS 84), - start_date (initial date of the time series), - end_date (final date of the time series), - label (the class label associated to the sample), - cube (the name of the cube associated with the data), - time_series (list containing a tibble with the values of the time series). -} -\usage{ -data(samples_mt_6bands) -} -\description{ -A dataset containing a tibble with time series samples - for the Mato Grosso state in Brasil. - The time series come from MOD13Q1 collection 6 images. - The data set has the following classes: - Cerrado, Fallow_Cotton, Forest, Pasture, - Soy_Corn, Soy_Cotton, Soy_Fallow, - Soy_Millet, and Soy_Sunflower. -} -\keyword{datasets} diff --git a/man/sits-package.Rd b/man/sits-package.Rd index 845014be9..936e478c0 100644 --- a/man/sits-package.Rd +++ b/man/sits-package.Rd @@ -10,7 +10,7 @@ Satellite Image Time Series Analysis for Earth Observation Data Cubes } -\section{SITS API}{ +\section{Purpose}{ The SITS package provides a set of tools for analysis, diff --git a/man/sits_ResNet.Rd b/man/sits_ResNet.Rd index 53ec14c2f..195a6dad4 100644 --- a/man/sits_ResNet.Rd +++ b/man/sits_ResNet.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_ResNet.R \name{sits_ResNet} \alias{sits_ResNet} -\title{Train a model using the ResNet model} +\title{Train ResNet classification models} \usage{ sits_ResNet( samples = NULL, diff --git a/man/sits_TempCNN.Rd b/man/sits_TempCNN.Rd index 168ca59e6..39af3baea 100644 --- a/man/sits_TempCNN.Rd +++ b/man/sits_TempCNN.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_TempCNN.R \name{sits_TempCNN} \alias{sits_TempCNN} -\title{Train a model using the Temporal Convolutional Neural Network} +\title{Train temporal convolutional neural network models} \usage{ sits_TempCNN( samples = NULL, diff --git a/man/sits_accuracy.Rd b/man/sits_accuracy.Rd index d36d3e75c..e480b2431 100644 --- a/man/sits_accuracy.Rd +++ b/man/sits_accuracy.Rd @@ -4,7 +4,7 @@ \alias{sits_accuracy} \alias{sits_accuracy.sits} \alias{sits_accuracy.classified_image} -\title{Area-weighted classification accuracy assessment} +\title{Assess classification accuracy (area-weighted method)} \usage{ sits_accuracy(data, ...) diff --git a/man/sits_apply.Rd b/man/sits_apply.Rd index 69d8da31c..7ce4b975c 100644 --- a/man/sits_apply.Rd +++ b/man/sits_apply.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_tibble.R \name{sits_apply} \alias{sits_apply} -\title{Apply a function over a time series.} +\title{Apply a function on a set of time series} \usage{ sits_apply( data, diff --git a/man/sits_bands.Rd b/man/sits_bands.Rd index a7ee5dc92..3f3ac4fd6 100644 --- a/man/sits_bands.Rd +++ b/man/sits_bands.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_bands.R \name{sits_bands} \alias{sits_bands} -\title{Informs the names of the bands} +\title{Get the names of the bands} \usage{ sits_bands(x) } @@ -13,14 +13,14 @@ sits_bands(x) A string vector with the names of the bands. } \description{ -Finds/replaces the names of the bands of +Finds the names of the bands of a set of time series or of a data cube } \examples{ { # Retrieve the set of samples for Mato Grosso (provided by EMBRAPA) # show the bands -sits_bands(samples_mt_6bands) +sits_bands(samples_modis_4bands) } } diff --git a/man/sits_classify.Rd b/man/sits_classify.Rd index 9ce506830..ef9d5bc20 100644 --- a/man/sits_classify.Rd +++ b/man/sits_classify.Rd @@ -4,7 +4,7 @@ \alias{sits_classify} \alias{sits_classify.sits} \alias{sits_classify.raster_cube} -\title{Classify time series or data cube using machine learning models} +\title{Classify time series or data cubes} \usage{ sits_classify(data, ml_model, ...) @@ -109,7 +109,7 @@ xgb_model <- sits_train(samples_2bands, ml_method = sits_xgboost(verbose = FALSE) ) # classify the point -point_2bands <- sits_select(samples_mt_6bands, +point_2bands <- sits_select(point_mt_6bands, bands = c("NDVI", "EVI")) point_class <- sits_classify(point_2bands, xgb_model) plot(point_class) diff --git a/man/sits_cluster_clean.Rd b/man/sits_cluster_clean.Rd deleted file mode 100644 index aaf0e4288..000000000 --- a/man/sits_cluster_clean.Rd +++ /dev/null @@ -1,38 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_cluster.R -\name{sits_cluster_clean} -\alias{sits_cluster_clean} -\title{Cluster cleaner} -\usage{ -sits_cluster_clean(samples) -} -\arguments{ -\item{samples}{Tibble with `cluster` column.} -} -\value{ -A tibble with all selected samples. -} -\description{ -Removes labels that are minority in each cluster. -} -\examples{ -\dontrun{ -# Load the "dtwclust" package -# library(dtwclust) -# calculate the dendrogram and the best clusters -clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) -# show clusters samples frequency -sits_cluster_frequency(clusters) -# remove cluster 3 from the samples -clusters_new <- dplyr::filter(clusters, cluster != 3) -# show clusters samples frequency -sits_cluster_frequency(clusters_new) -# clean all remaining clusters -cleaned <- sits_cluster_clean(clusters_new) -# show clusters samples frequency -sits_cluster_frequency(cleaned) -} -} -\author{ -Rolf Simoes, \email{rolf.simoes@inpe.br} -} diff --git a/man/sits_cluster_dendro.Rd b/man/sits_cluster_dendro.Rd deleted file mode 100644 index 311128808..000000000 --- a/man/sits_cluster_dendro.Rd +++ /dev/null @@ -1,65 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_cluster.R -\name{sits_cluster_dendro} -\alias{sits_cluster_dendro} -\title{Clusters a set of time series - using aglomerative hierarchical clustering} -\usage{ -sits_cluster_dendro( - samples = NULL, - bands = NULL, - dist_method = "dtw_basic", - linkage = "ward.D2", - k = NULL, - colors = "RdYlGn", - .plot = TRUE, - ... -) -} -\arguments{ -\item{samples}{A tibble with input set of time series} - -\item{bands}{Bands to be used in the clustering} - -\item{dist_method}{String with one of the supported distances.} - -\item{linkage}{String with agglomeration method to be used. -Can be any `hclust` method (see `hclust`). -Default is 'ward.D2'.} - -\item{k}{Desired number of clusters (overrides default value)} - -\item{colors}{Color scheme as per .sits_brewer_color_name` function.} - -\item{.plot}{Plot the dendrogram?} - -\item{...}{Additional parameters to be passed -to dtwclust::tsclust() function.} -} -\value{ -A tibble with the clusters or clusters' members. -} -\description{ -Takes a SITS tibble and produces a sits tibble -with an added "cluster" column. -This is done in several steps: -1. Calculation of the dendrogram; -2. Get validity index for best cluster using the adjusted Rand Index; -3. Cut the dendrogram using the chosen validity index. -} -\examples{ -\dontrun{ -# Load the "dtwclust" package -# library(dtwclust) -# load a simple data set with two classes -data(cerrado_2classes) -# calculate the dendrogram and the best clusters -clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) -} -} -\references{ -"dtwclust" package (https://CRAN.R-project.org/package=dtwclust) -} -\author{ -Rolf Simoes, \email{rolf.simoes@inpe.br} -} diff --git a/man/sits_cluster_frequency.Rd b/man/sits_cluster_frequency.Rd deleted file mode 100644 index 2deb26442..000000000 --- a/man/sits_cluster_frequency.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_cluster.R -\name{sits_cluster_frequency} -\alias{sits_cluster_frequency} -\title{Cluster contigency table} -\usage{ -sits_cluster_frequency(samples) -} -\arguments{ -\item{samples}{A tibble with `cluster` column.} -} -\value{ -A matrix containing all frequencies of labels in clusters. -} -\description{ -Computes the contingency table between labels and clusters. -This function needs as input a sits tibble with `cluster` column. -} -\examples{ -\dontrun{ -# Load the "dtwclust" package -# library(dtwclust) -# create clusters by cutting a dendrogram -clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) -# show clusters samples frequency -sits_cluster_frequency(clusters) -} -} -\author{ -Rolf Simoes, \email{rolf.simoes@inpe.br} -} diff --git a/man/sits_clustering.Rd b/man/sits_clustering.Rd new file mode 100644 index 000000000..936d3088e --- /dev/null +++ b/man/sits_clustering.Rd @@ -0,0 +1,97 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_cluster.R +\name{sits_clustering} +\alias{sits_clustering} +\alias{sits_cluster_dendro} +\alias{sits_cluster_frequency} +\alias{sits_cluster_clean} +\title{Find clusters in time series samples} +\usage{ +sits_cluster_dendro( + samples = NULL, + bands = NULL, + dist_method = "dtw_basic", + linkage = "ward.D2", + k = NULL, + palette = "RdYlGn", + .plot = TRUE, + ... +) + +sits_cluster_frequency(samples) + +sits_cluster_clean(samples) +} +\arguments{ +\item{samples}{A tibble with input set of time series} + +\item{bands}{Bands to be used in the clustering} + +\item{dist_method}{String with one of the supported distances.} + +\item{linkage}{String with agglomeration method to be used. +Can be any `hclust` method (see `hclust`). +Default is 'ward.D2'.} + +\item{k}{Desired number of clusters (overrides default value)} + +\item{palette}{Color palette as per `grDevices::hcl.pals()` function.} + +\item{.plot}{Plot the dendrogram?} + +\item{...}{Additional parameters to be passed +to dtwclust::tsclust() function.} +} +\value{ +\code{sits_cluster_dendro()} takes a tibble containing time series and produces +a sits tibble with an added "cluster" column. + +\code{sits_cluster_frequency()} returns a matrix containing +all frequencies of labels in clusters. + +\code{sits_cluster_clean()} takes a tibble with time series +that has an additional `cluster` produced by \code{sits_cluster_dendro()} +and removes labels that are minority in each cluster. +} +\description{ +These functions support hierarchical agglomerative clustering in sits. +They provide support from creating a dendrogram and using it for cleaning samples. + +\code{sits_cluster_dendro()} takes a tibble containing time series and produces +a sits tibble with an added "cluster" column. The function first calculates a dendrogram and +obtains a validity index for best clustering using the adjusted Rand Index. +After cutting the dendrogram using the chosen validity index, it assigns a +cluster to each sample. + +\code{sits_cluster_frequency()} computes the contingency table between labels and clusters +and produces a matrix +It needs as input a tibble produced by \code{sits_cluster_dendro()}. + +\code{sits_cluster_clean()} takes a tibble with time series +that has an additional `cluster` produced by \code{sits_cluster_dendro()} +and removes labels that are minority in each cluster. +} +\examples{ +\dontrun{ +# load a simple data set with two classes +data(cerrado_2classes) +# calculate the dendrogram and the best clusters +clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI")) +# show clusters samples frequency +sits_cluster_frequency(clusters) +# remove cluster 3 from the samples +clusters_new <- dplyr::filter(clusters, cluster != 3) +# show clusters samples frequency of the new data set +sits_cluster_frequency(clusters_new) +# clean all remaining clusters +cleaned <- sits_cluster_clean(clusters_new) +# show clusters samples frequency +sits_cluster_frequency(cleaned) +} +} +\references{ +"dtwclust" package (https://CRAN.R-project.org/package=dtwclust) +} +\author{ +Rolf Simoes, \email{rolf.simoes@inpe.br} +} diff --git a/man/sits_configuration.Rd b/man/sits_configuration.Rd index 02c099e4d..1d9a8e53e 100644 --- a/man/sits_configuration.Rd +++ b/man/sits_configuration.Rd @@ -5,7 +5,7 @@ \alias{sits_config} \alias{sits_config_show} \alias{sits_list_collections} -\title{sits configuration} +\title{Configure parameters for sits package} \usage{ sits_config( processing_bloat = NULL, @@ -18,7 +18,7 @@ sits_config( reset = FALSE ) -sits_config_show(source = NULL, collection = NULL, palette = NULL) +sits_config_show(source = NULL, collection = NULL, colors = FALSE) sits_list_collections(source = NULL) } @@ -55,8 +55,8 @@ key entry to be shown in detail.} with \code{source} parameter to indicate a collection key entry to be shown in detail.} -\item{palette}{A \code{character} value indicating a palette -to be shown in detail.} +\item{colors}{A \code{logical} value indicating if colors +will to be shown in detail.} } \value{ \code{sits_config()} returns a \code{list} containing the final @@ -71,6 +71,10 @@ each cloud service supported by sits. \description{ These functions load and show sits configurations. +The `sits` package uses a configuration file +that contains information on parameters required by different functions. +This includes information about the image collections handled by `sits`. + \code{sits_config()} loads the default configuration file and the user provided configuration file. The final configuration is obtained by overriding the options by the values provided in diff --git a/man/sits_cube.Rd b/man/sits_cube.Rd index 2f455cc19..a2c236b8d 100644 --- a/man/sits_cube.Rd +++ b/man/sits_cube.Rd @@ -6,7 +6,7 @@ \alias{sits_cube.stac_cube} \alias{sits_cube.local_cube} \alias{sits_cube.satveg_cube} -\title{Defines a data cube} +\title{Create data cubes from image collections} \usage{ sits_cube(source, ..., collection, data_dir = NULL) @@ -139,8 +139,8 @@ to provide AWS credentials to access open data collections. For requester-pays data, users need to provide their access codes as environment variables, as follows: Sys.setenv( -"AWS_ACCESS_KEY_ID" = , -"AWS_SECRET_ACCESS_KEY" = + AWS_ACCESS_KEY_ID = , + AWS_SECRET_ACCESS_KEY = ) Sentinel-2/2A level 2A files in AWS are organized by sensor @@ -160,12 +160,12 @@ covering datasets from Landsat-4 to Landsat-8. This collection is open data. All BDC collections have been regularized. BDC users need to provide their credentials using environment variables. To create your credentials, please see - "https://brazildatacube.dpi.inpe.br/portal/explore". There is no - cost for accessing data in the BDC. - After obtaining the BDC access key, please include it as - an environment variable. +"https://brazildatacube.dpi.inpe.br/portal/explore". There is no +cost for accessing data in the BDC. +After obtaining the BDC access key, please include it as +an environment variable, as follows: Sys.setenv( -"BDC_ACCESS_KEY" = + BDC_ACCESS_KEY = ) To create a cube from local files, the user needs to inform: @@ -204,9 +204,9 @@ want to extract the data. # --- Access to the Brazil Data Cube # Provide your BDC credentials as environment variables -Sys.setenv( - "BDC_ACCESS_KEY" = -) +bdc_access_key <- Sys.getenv("BDC_ACCESS_KEY") +if (nchar(bdc_access_key) == 0) + stop("No BDC_ACCESS_KEY defined in environment.") # create a raster cube file based on the information in the BDC cbers_tile <- sits_cube( @@ -220,22 +220,22 @@ cbers_tile <- sits_cube( # --- Create a WTSS cube from BDC cubes # Provide your BDC credentials as environment variables -Sys.setenv( - "BDC_ACCESS_KEY" = -) +bdc_access_key <- Sys.getenv("BDC_ACCESS_KEY") +if (nchar(bdc_access_key) == 0) + stop("No BDC_ACCESS_KEY defined in environment.") -cube_wtss <- sits::sits_cube(source = "WTSS", - collection = "MOD13Q1-6") +cube_wtss <- sits_cube(source = "WTSS", + collection = "MOD13Q1-6") # --- Access to Digital Earth Africa # create a raster cube file based on the information about the files cube_dea <- sits_cube(source = "DEAFRICA", collection = "s2_l2a", bands = c("B04", "B08"), - bbox = c("xmin" = 17.379, - "ymin" = 1.1573, - "xmax" = 17.410, - "ymax" = 1.1910), + roi = c("lat_min" = 17.379, + "lon_min" = 1.1573, + "lat_max" = 17.410, + "lon_max" = 1.1910), start_date = "2019-01-01", end_date = "2019-10-28" ) @@ -244,9 +244,9 @@ cube_dea <- sits_cube(source = "DEAFRICA", s2_cube <- sits_cube(source = "AWS", collection = "sentinel-s2-l2a-cogs", tiles = c("20LKP","20LLP"), - bands = c("B03", "B04", "B08"), + bands = c("B04", "B08", "B11"), start_date = as.Date("2018-07-18"), - end_date = as.Date("2018-07-23") + end_date = as.Date("2019-07-23") ) # --- Create a cube based on a local MODIS data diff --git a/man/sits_data_to_csv.Rd b/man/sits_data_to_csv.Rd deleted file mode 100644 index 5610b0f30..000000000 --- a/man/sits_data_to_csv.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_csv.R -\name{sits_data_to_csv} -\alias{sits_data_to_csv} -\title{Export a sits tibble data to the CSV format} -\usage{ -sits_data_to_csv(data, file) -} -\arguments{ -\item{data}{A tibble with time series data and metadata.} - -\item{file}{Name of the exported CSV file.} -} -\value{ -Status of the operation. -} -\description{ -Converts time series data from a sits tibble to a CSV file. - The CSV file will not contain the metadata, - but only the actual time series, with a reference value. - This function is useful to export the data to external apps. -} -\examples{ -# read a tibble with 400 samples of Cerrado and 346 samples of Pasture -data(cerrado_2classes) -# export a time series -csv_file <- paste0(tempdir(), "/cerrado_2classes.csv") -sits_data_to_csv(cerrado_2classes, file = csv_file) - -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} -} diff --git a/man/sits_envelope.Rd b/man/sits_envelope.Rd deleted file mode 100644 index 73829d43d..000000000 --- a/man/sits_envelope.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_filters.R -\name{sits_envelope} -\alias{sits_envelope} -\title{Envelope filter} -\usage{ -sits_envelope(data = NULL, operations = "UULL", bands_suffix = "env") -} -\arguments{ -\item{data}{A tibble with time series data and metadata.} - -\item{operations}{A character sequence for the sequence operations. -("U" for upper filter, "L" for lower filter).} - -\item{bands_suffix}{Suffix of the resulting data.} -} -\value{ -A tibble with filtered time series values. -} -\description{ -This function computes the envelope of a time series using the -streaming algorithm proposed by Lemire (2009). -This functions calls `dtwclust::compute_envelope` function. -} -\examples{ -# Select the NDVI band of a point in Mato Grosso -point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") -# Apply the envelope filter -point_env <- sits_envelope(point_ndvi) -# Merge the filtered with the raw data -point2 <- sits_merge(point_ndvi, point_env) -# Plot the result -plot(point2) -} -\author{ -Rolf Simoes, \email{rolf.simoes@inpe.br} -} diff --git a/man/sits_filter.Rd b/man/sits_filter.Rd index 5064fad7e..76ee489c0 100644 --- a/man/sits_filter.Rd +++ b/man/sits_filter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_filters.R \name{sits_filter} \alias{sits_filter} -\title{General function for filtering} +\title{Filter time series and data cubes} \usage{ sits_filter(data, filter = sits_whittaker()) } @@ -21,7 +21,6 @@ the available filtering algorithms: \itemize{ \item{Whittaker smoother - see \code{\link{sits_whittaker}}} \item{Savitsky-Golay filter - see \code{\link{sits_sgolay}}} - \item{Envelope filter - see \code{\link{sits_envelope}}} \item{Interpolation filter - see \code{\link{sits_interp}}} } } diff --git a/man/sits_from_zoo.Rd b/man/sits_from_zoo.Rd deleted file mode 100644 index 21ac7580a..000000000 --- a/man/sits_from_zoo.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_zoo.R -\name{sits_from_zoo} -\alias{sits_from_zoo} -\title{Import time series in the zoo format to a sits tibble} -\usage{ -sits_from_zoo( - ts_zoo, - longitude = 0, - latitude = 0, - label = "NoClass", - name = "unknown" -) -} -\arguments{ -\item{ts_zoo}{Zoo time series.} - -\item{longitude}{Longitude of the chosen location.} - -\item{latitude}{Latitude of the chosen location.} - -\item{label}{Label to attach to the time series (optional).} - -\item{name}{Name of the data cube where data comes from.} -} -\value{ -Time series in sits tibble format. -} -\description{ -Converts data from an instance of a zoo series to a sits tibble. -} -\examples{ -# Read a time series in ZOO format -data(ts_zoo) -# Convert the zoo series into a sits tibble -data <- sits_from_zoo(ts_zoo, - longitude = -54.2313, latitude = -14.0482, - label = "Cerrado", name = "mod13q1" -) - -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} -} diff --git a/man/sits_get_data.Rd b/man/sits_get_data.Rd index e59c5de79..d6f2eb695 100644 --- a/man/sits_get_data.Rd +++ b/man/sits_get_data.Rd @@ -11,7 +11,7 @@ \alias{sits_get_data.raster_cube} \alias{sits_get_data.csv_raster_cube} \alias{sits_get_data.shp_raster_cube} -\title{Obtain time series from different sources} +\title{Get time series from data cubes and cloud services} \usage{ sits_get_data(cube, file = NULL, ..., multicores = 1) @@ -143,14 +143,13 @@ A tibble with the metadata and data for each time series } \description{ Retrieve a set of time series from a data cube or from -a time series service. Data cubes - and puts it in a "sits tibble". +a time series service. Data cubes and puts it in a "sits tibble". Sits tibbles are the main structures of sits package. They contain both the satellite image time series and their metadata. A sits tibble is a tibble with pre-defined columns that has the metadata and data for each time series. The columns are . -There are many ways of retrieving time series: +There are three ways of retrieving time series: (a) \itemize{ \item{SATVEG:}{Retrieve data from SATVEG service using a lat/long point (see S3 method for class 'satveg_cube'), diff --git a/man/sits_impute_linear.Rd b/man/sits_impute_linear.Rd index ddc4beb8d..c05c4401e 100644 --- a/man/sits_impute_linear.Rd +++ b/man/sits_impute_linear.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_imputation.R \name{sits_impute_linear} \alias{sits_impute_linear} -\title{Linear imputation of NA values using C++ implementation} +\title{Replace NA values with linear interpolation} \usage{ sits_impute_linear(data = NULL) } diff --git a/man/sits_interp.Rd b/man/sits_interp.Rd index fa3177a19..921afdcd1 100644 --- a/man/sits_interp.Rd +++ b/man/sits_interp.Rd @@ -2,35 +2,37 @@ % Please edit documentation in R/sits_filters.R \name{sits_interp} \alias{sits_interp} -\title{Interpolation function of the time series of a sits_tibble} +\title{Interpolate values in time series} \usage{ -sits_interp(data = NULL, fun = stats::approx, n = base::length, ...) +sits_interp( + data, + fun = stats::approx, + n = 2 * length(sits_timeline(data)), + ... +) } \arguments{ \item{data}{A tibble with time series data and metadata.} -\item{fun}{Interpolation function.} +\item{fun}{Interpolation function (by default, stats::approx())} \item{n}{Number of time series elements to be created -between start date and end date. -When a class function is passed to `n`, -it is evaluated with each band time series as -an argument, e.g. n(band) (default: `length` function).} +between start date and end date.} \item{...}{Additional parameters to be used by the fun function.} } \value{ -A tibble with same samples and the new bands. +A tibble with interpolated samples. } \description{ -Computes the linearly interpolated bands - using the R base function approx. +Computes the interpolated bands using a user-defined +function (by default the R base function approx) } \examples{ # Retrieve a time series with values of NDVI point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") # find out how many time instances are there -n_times <- nrow(sits_time_series(point_ndvi)) +n_times <- length(sits_timeline(point_ndvi)) # interpolate three times more points point_int.tb <- sits_interp(point_ndvi, fun = stats::spline, n = 3 * n_times) # plot the result diff --git a/man/sits_keras_diagnostics.Rd b/man/sits_keras_diagnostics.Rd deleted file mode 100644 index f40ee209e..000000000 --- a/man/sits_keras_diagnostics.Rd +++ /dev/null @@ -1,38 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_keras.R -\name{sits_keras_diagnostics} -\alias{sits_keras_diagnostics} -\title{Diagnostic information about a Keras deep learning model} -\usage{ -sits_keras_diagnostics(dl_model) -} -\arguments{ -\item{dl_model}{A valid keras model.} -} -\value{ -This function returns NULL. It only prints the model diagnostics. -} -\description{ -After the Keras deeplearning model is compiled and fit, this - function provides access to the history plot - and the evaluation results. -} -\examples{ -\dontrun{ -# Retrieve the set of samples for the Mato Grosso (provided by EMBRAPA) -data(cerrado_2classes) -# obtain a DL model -dl_model <- sits_train( - cerrado_2classes, - sits_deeplearning( - layers = c(512, 512), dropout_rates = c(0.45, 0.25), - epochs = 100 - ) -) -# run the keras diagnostics -sits_keras_diagnostics(dl_model) -} -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} -} diff --git a/man/sits_kfold_validate.Rd b/man/sits_kfold_validate.Rd index b99265037..7495959c9 100644 --- a/man/sits_kfold_validate.Rd +++ b/man/sits_kfold_validate.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_validate.R \name{sits_kfold_validate} \alias{sits_kfold_validate} -\title{Cross-validate temporal patterns} +\title{Cross-validate time series samples} \usage{ sits_kfold_validate( data, diff --git a/man/sits_label_classification.Rd b/man/sits_label_classification.Rd index e92dc1fa1..b7b4da43c 100644 --- a/man/sits_label_classification.Rd +++ b/man/sits_label_classification.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_label_classification.R \name{sits_label_classification} \alias{sits_label_classification} -\title{Post-process a classified data raster probs to obtain a labelled image} +\title{Build a labelled image from a probability cube} \usage{ sits_label_classification( cube, diff --git a/man/sits_labels.Rd b/man/sits_labels.Rd index 0411ebb21..9c5522ffe 100644 --- a/man/sits_labels.Rd +++ b/man/sits_labels.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_labels.R \name{sits_labels} \alias{sits_labels} -\title{Returns the information about labels of a data set (tibble or cube)} +\title{Get labels associated to a data set} \usage{ sits_labels(data) } diff --git a/man/sits_labels_summary.Rd b/man/sits_labels_summary.Rd index 06196ca4f..4ef92a1a2 100644 --- a/man/sits_labels_summary.Rd +++ b/man/sits_labels_summary.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_labels_summary.R +% Please edit documentation in R/sits_labels.R \name{sits_labels_summary} \alias{sits_labels_summary} -\title{Returns the information about labels of a tibble data set} +\title{Inform label distribution of a set of time series} \usage{ sits_labels_summary(data) } @@ -13,7 +13,7 @@ sits_labels_summary(data) A tibble with labels frequency. } \description{ -Finds labels in a sits tibble +Describes labels in a sits tibble } \examples{ # read a tibble with 400 samples of Cerrado and 346 samples of Pasture diff --git a/man/sits_linear_interp.Rd b/man/sits_linear_interp.Rd deleted file mode 100644 index 813b842e4..000000000 --- a/man/sits_linear_interp.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_filters.R -\name{sits_linear_interp} -\alias{sits_linear_interp} -\title{Interpolation function of the time series in a sits tibble} -\usage{ -sits_linear_interp(data = NULL, n = 23) -} -\arguments{ -\item{data}{A tibble with time series data and metadata.} - -\item{n}{Number of time series elements to be created -between start date and end date.} -} -\value{ -A sits tibble with same samples and the new bands. -} -\description{ -Computes the linearly interpolated bands for a given resolution - using the R base function approx. -} -\examples{ -# Retrieve a time series with values of NDVI -point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") -# find out how many time instances are there -n_times <- nrow(sits_time_series(point_ndvi)) -# interpolate three times more points -point_int.tb <- sits_linear_interp(point_ndvi, n = 3 * n_times) -# plot the result -plot(point_int.tb) -} -\author{ -Rolf Simoes, \email{rolf.simoes@inpe.br} -} diff --git a/man/sits_missing_values.Rd b/man/sits_missing_values.Rd deleted file mode 100644 index 7f4e03435..000000000 --- a/man/sits_missing_values.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_filters.R -\name{sits_missing_values} -\alias{sits_missing_values} -\title{Remove missing values} -\usage{ -sits_missing_values(data, miss_value) -} -\arguments{ -\item{data}{A tibble with time series data and metadata.} - -\item{miss_value}{Number indicating missing values in a time series.} -} -\value{ -Time series data and metadata (missing values removed). -} -\description{ -This function removes the missing values from - an image time series by substituting them by NA. -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} -} diff --git a/man/sits_mlp.Rd b/man/sits_mlp.Rd index 1e83ffc91..a77606887 100644 --- a/man/sits_mlp.Rd +++ b/man/sits_mlp.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_mlp.R \name{sits_mlp} \alias{sits_mlp} -\title{Train a deep learning model using multi-layer perceptron} +\title{Train multi-layer perceptron models} \usage{ sits_mlp( samples = NULL, diff --git a/man/sits_mlr.Rd b/man/sits_mlr.Rd index e90c25897..319768a01 100644 --- a/man/sits_mlr.Rd +++ b/man/sits_mlr.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_machine_learning.R \name{sits_mlr} \alias{sits_mlr} -\title{Train a sits classification model using multinomial log-linear} +\title{Train multinomial log-linear models} \usage{ sits_mlr( data = NULL, diff --git a/man/sits_mutate_bands.Rd b/man/sits_mutate_bands.Rd index d60657b21..d6222d9b5 100644 --- a/man/sits_mutate_bands.Rd +++ b/man/sits_mutate_bands.Rd @@ -22,10 +22,10 @@ Adds new bands and preserves existing in the time series \examples{ \donttest{ # Retrieve data for time series with label samples in Mato Grosso in Brazil -data(samples_mt_6bands) +data(samples_modis_4bands) # Generate a new image with the SAVI (Soil-adjusted vegetation index) -savi.tb <- sits_mutate_bands(samples_mt_6bands, - SAVI = (1.5 * (NIR - RED) / (NIR + RED + 0.5))) +ndwi.tb <- sits_mutate_bands(samples_modis_4bands, + NDWI = (1.5 * (NIR - MIR) / (NIR + MIR))) } } \author{ diff --git a/man/sits_ndwi.Rd b/man/sits_ndwi.Rd deleted file mode 100644 index 73c31ef73..000000000 --- a/man/sits_ndwi.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_indexes.R -\name{sits_ndwi} -\alias{sits_ndwi} -\title{Builds normalized difference water index} -\usage{ -sits_ndwi(data) -} -\arguments{ -\item{data}{A valid sits tibble.} -} -\value{ -A sits tibble with the SAVI index. -} -\description{ -Adds new tasseled cap bands. -} -\examples{ - -# Retrieve data for time series with label samples in Mato Grosso in Brazil -data(samples_mt_6bands) -# Generate a new image with the tasseled cap -ndwi.tb <- sits_ndwi(samples_mt_6bands) -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} -} diff --git a/man/sits_patterns.Rd b/man/sits_patterns.Rd index fa8893941..61c0292b9 100644 --- a/man/sits_patterns.Rd +++ b/man/sits_patterns.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_patterns.R \name{sits_patterns} \alias{sits_patterns} -\title{Create temporal patterns using a generalised additive model (gam)} +\title{Find temporal patterns associated to a set of time series} \usage{ sits_patterns(data = NULL, freq = 8, formula = y ~ s(x), ...) } @@ -29,8 +29,7 @@ approximation that fits the assumptions of the statistical model, based on a smooth function. This method is based on the "createPatterns" method of the dtwSat package, -which is also -described in the reference paper. +which is also described in the reference paper. } \examples{ \dontrun{ diff --git a/man/sits_regularize.Rd b/man/sits_regularize.Rd index 50a884b26..210be9c42 100644 --- a/man/sits_regularize.Rd +++ b/man/sits_regularize.Rd @@ -2,18 +2,18 @@ % Please edit documentation in R/sits_regularize.R \name{sits_regularize} \alias{sits_regularize} -\title{Creates a regularized data cube from an irregular one} +\title{Build a regular data cube from an irregular one} \usage{ sits_regularize( cube, output_dir, - period = NULL, + period, res = NULL, roi = NULL, agg_method = "median", resampling = "bilinear", cloud_mask = TRUE, - multicores = 1 + multicores = 2 ) } \arguments{ @@ -35,9 +35,8 @@ will be aggregated.} See above} \item{agg_method}{A \code{character} with method that will be applied by -\code{gdalcubes} for aggregation. -Options: \code{min}, \code{max}, \code{mean}, \code{median} and -\code{first}.} +\code{gdalcubes} for aggregation. Options: \code{min}, \code{max}, +\code{mean}, \code{median} and \code{first}. Default is \code{median}.} \item{resampling}{A \code{character} with method to be used by \code{gdalcubes} for resampling in mosaic operation. @@ -71,15 +70,9 @@ The "roi" parameter defines a region of interest. It can be \dontrun{ # --- Access to the AWS STAC -# Provide your AWS credentials as environment variables -Sys.setenv( - "AWS_ACCESS_KEY_ID" = , - "AWS_SECRET_ACCESS_KEY" = -) # define an AWS data cube s2_cube <- sits_cube(source = "AWS", - name = "T20LKP_2018_2019", collection = "sentinel-s2-l2a-cogs", bands = c("B08", "SCL"), tiles = c("20LKP"), @@ -96,6 +89,7 @@ gc_cube <- sits_regularize(cube = s2_cube, period = "P1M", agg_method = "median", resampling = "bilinear", + res = 60, cloud_mask = TRUE) } } diff --git a/man/sits_rfor.Rd b/man/sits_rfor.Rd index 5084a9632..e52ca69a9 100644 --- a/man/sits_rfor.Rd +++ b/man/sits_rfor.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_machine_learning.R \name{sits_rfor} \alias{sits_rfor} -\title{Train a SITS classifiction model using random forest algorithm} +\title{Train random forest models} \usage{ sits_rfor(data = NULL, num_trees = 200, nodesize = 1, ...) } diff --git a/man/sits_savi.Rd b/man/sits_savi.Rd deleted file mode 100644 index 8b42b0b82..000000000 --- a/man/sits_savi.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_indexes.R -\name{sits_savi} -\alias{sits_savi} -\title{Builds soil-adjusted vegetation index} -\usage{ -sits_savi(data) -} -\arguments{ -\item{data}{Valid sits tibble.} -} -\value{ -A sits tibble with the SAVI index. -} -\description{ -Adds new tasseled cap bands. -} -\examples{ -# Retrieve data for time series with label samples in Mato Grosso in Brazil -data(samples_mt_6bands) -# Generate a new image with the tasseled cap -savi.tb <- sits_savi(samples_mt_6bands) -} -\author{ -Gilberto Camara, \email{gilberto.camara@inpe.br} -} diff --git a/man/sits_sgolay.Rd b/man/sits_sgolay.Rd index c144c7c71..8a85c0d0e 100644 --- a/man/sits_sgolay.Rd +++ b/man/sits_sgolay.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_filters.R \name{sits_sgolay} \alias{sits_sgolay} -\title{Smooth the time series using Savitsky-Golay filter} +\title{Filter time series using Savitsky-Golay method} \usage{ sits_sgolay( data = NULL, diff --git a/man/sits_smooth.Rd b/man/sits_smooth.Rd index 2b9b1aee4..9ce87a8da 100644 --- a/man/sits_smooth.Rd +++ b/man/sits_smooth.Rd @@ -5,7 +5,7 @@ \alias{sits_smooth.bayes} \alias{sits_smooth.gaussian} \alias{sits_smooth.bilateral} -\title{Post-process a classified data raster probs using smoothing} +\title{Smooth probability cubes with spatial predictors} \usage{ sits_smooth(cube, type = "bayes", ...) diff --git a/man/sits_som.Rd b/man/sits_som.Rd new file mode 100644 index 000000000..de96b4842 --- /dev/null +++ b/man/sits_som.Rd @@ -0,0 +1,134 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sits_som.R +\name{sits_som} +\alias{sits_som} +\alias{sits_som_map} +\alias{sits_som_clean_samples} +\alias{sits_som_evaluate_cluster} +\title{Use SOM for quality analysis of time series samples} +\usage{ +sits_som_map( + data, + grid_xdim = 10, + grid_ydim = 10, + alpha = 1, + rlen = 100, + distance = "euclidean", + som_radius = 2, + mode = "online" +) + +sits_som_clean_samples( + som_map, + prior_threshold = 0.6, + posterior_threshold = 0.6, + keep = c("clean", "analyze") +) + +sits_som_evaluate_cluster(som_map) +} +\arguments{ +\item{data}{A tibble with samples to be clustered.} + +\item{grid_xdim}{X dimension of the SOM grid (default = 25).} + +\item{grid_ydim}{Y dimension of the SOM grid.} + +\item{alpha}{Starting learning rate +(decreases according to number of iterations).} + +\item{rlen}{Number of iterations to produce the SOM.} + +\item{distance}{The type of similarity measure (distance).} + +\item{som_radius}{Radius of SOM neighborhood} + +\item{mode}{Type of learning algorithm (default = "online")} + +\item{som_map}{An object returned by \code{\link[sits]{sits_som_map}}} + +\item{prior_threshold}{Threshold of conditional probability +(frequency of samples assigned to the same SOM neuron)} + +\item{posterior_threshold}{Threshold of posterior probability +(influenced by the SOM neighborhood)} + +\item{keep}{Which types of evaluation to be maintained in the data} +} +\value{ +\code{sits_som_map()} prodices a list with three members: +(1) the samples tibble, with one additional column indicating +to which neuron each sample has been mapped; +(2) the Kohonen map, used for plotting and cluster quality measures; +(3) a tibble with the labelled neurons, +where each class of each neuron is associated to two values: +(a) the prior probability that this class belongs to a cluster +based on the frequency of samples of this class allocated to the neuron; +(b) the posterior probability that this class belongs to a cluster, +using data for the neighbours on the SOM map. + +\code{sits_som_clean_samples()} produces +a sits tibble with an two additional columns.The first indicates if +each sample is clean, should be analyzed or +should be removed. The second indicates +the posterior probability of the sample + +\code{sits_som_evaluate_cluster()} produces a tibble with the clusters +found by the SOM map. For each cluster, ir provides the percentage +of classes inside it. +} +\description{ +These function use self-organized maps to perform +quality analysis in satellite image time series + +\code{sits_som_map()} creates a SOM map, where high-dimensional data +is mapped into a two dimensional map, keeping the topological relations +between data patterns. Each sample is assigned to a neuron, +and neurons are placed in the grid based on similarity. + +\code{sits_som_evaluate_cluster()} analyses the neurons of the SOM map, +and builds clusters based on them. Each cluster is a neuron +or a set of neuron categorized with same label. +It produces a tibble with the percentage of mixture of classes +in each cluster. + +\code{sits_som_clean_samples()} evaluates the quality of the samples +based on the results of the SOM map. The algorithm identifies noisy samples, +using `prior_threshold` for the prior probability +and `posterior_threshold` for the posterior probability. +Each sample receives an evaluation tag, according to the following rule: +(a) If the prior probability is < `prior_threshold`, the sample is tagged as "remove"; +(b) If the prior probability is >= `prior_threshold` and the posterior probability +is >=`posterior_threshold`, the sample is tagged as "clean"; +(c) If the prior probability is >= `posterior_threshold` and +the posterior probability is < `posterior_threshold`, the sample is tagged as "analyze" for further inspection. +The user can define which tagged samples will be returned using the "keep" +parameter, with the following options: "clean", "analyze", "remove". +} +\examples{ +\dontrun{ +# Produce a cluster map +som_map <- sits_som_map(samples_modis_4bands) +# plot the som map +plot(som_map) +# calculate the mixture inside clusters +eval <- sits_som_evaluate_cluster(som_map) +# plot the cluster evaluation +plot(eval) +# Clean the samples to get better quality ones +clean_samples <- sits_som_clean_samples(som_map) +} + + +} +\references{ +Lorena Santos, Karine Ferreira, Gilberto Camara, Michelle Picoli, +Rolf Simoes, “Quality control and class noise reduction of satellite +image time series”. ISPRS Journal of Photogrammetry and Remote Sensing, +vol. 177, pp 75-88, 2021. https://doi.org/10.1016/j.isprsjprs.2021.04.014. +} +\author{ +Lorena Alves, \email{lorena.santos@inpe.br} + +Karine Ferreira. \email{karine.ferreira@inpe.br} +} diff --git a/man/sits_som_clean_samples.Rd b/man/sits_som_clean_samples.Rd deleted file mode 100644 index c60250294..000000000 --- a/man/sits_som_clean_samples.Rd +++ /dev/null @@ -1,68 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_som.R -\name{sits_som_clean_samples} -\alias{sits_som_clean_samples} -\title{Clean samples} -\usage{ -sits_som_clean_samples( - som_map, - prior_threshold = 0.6, - posterior_threshold = 0.6, - keep = c("clean", "analyze") -) -} -\arguments{ -\item{som_map}{An object returned -by \code{\link[sits]{sits_som_map}}} - -\item{prior_threshold}{Threshold of conditional probability -(frequency of samples assigned to the same SOM neuron)} - -\item{posterior_threshold}{Threshold of posterior probability -(influenced by the SOM neighborhood)} - -\item{keep}{Samples evaluation to be maintained in the data} -} -\value{ -List with two sits tibbles. - The first tibble has clean samples - The second has samples that need to be analysed. -} -\description{ -This function evaluate the quality of the samples -based on the results of the SOM map. It produces -a sits tibble with an evaluation column indicating if -each sample is clean, should be analyzed or -should be removed, and with a new column indicating -the posterior probability of the sample -} -\note{ -The algorithm identifies noisy samples, using `prior_threshold` for - the prior probability and `posterior_threshold` for the posterior probability. - Each sample receives an evaluation tag, according to the following rule: - (a) If the prior probability is < `prior_threshold`, the sample is tagged as "remove"; - (b) If the prior probability is >= `prior_threshold` and the posterior probability - is >=`posterior_threshold`, the sample is tagged as "clean"; - (c) If the prior probability is >= `posterior_threshold` and - the posterior probability is < `posterior_threshold`, - the sample is tagged as "analyze" for further inspection. - - The user can define which tagged samples will be returned using the "keep" - parameter, with the following options: "clean", "analyze", "remove". -} -\examples{ -\dontrun{ -# Read a set of samples -# Get a new subset of samples evaluated by clustering methods -som_map <- sits_som_map(samples_modis_4bands, - grid_xdim = 10, grid_ydim = 10, - distance = "euclidean" -) -new_samples <- sits_som_clean_samples(som_map) -} -} -\author{ -Lorena Santos, \email{lorena.santos@inpe.br} - -Karine Ferreira. \email{karine.ferreira@inpe.br} -} diff --git a/man/sits_som_cluster.Rd b/man/sits_som_cluster.Rd deleted file mode 100644 index d352f300f..000000000 --- a/man/sits_som_cluster.Rd +++ /dev/null @@ -1,72 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_som.R -\name{sits_som_cluster} -\alias{sits_som_cluster} -\title{Clustering a set of satellite image time series using SOM} -\usage{ -sits_som_cluster( - data, - grid_xdim = 10, - grid_ydim = 10, - alpha = 1, - distance = "euclidean", - rlen = 100, - prior_threshold = 0.6, - posterior_threshold = 0.6, - som_radius = 2 -) -} -\arguments{ -\item{data}{A tibble with samples to be clustered.} - -\item{grid_xdim}{X dimension of the SOM grid (default = 25).} - -\item{grid_ydim}{Y dimension of the SOM grid.} - -\item{alpha}{Starting learning rate, -which decreases according to number of iterations.} - -\item{distance}{The similarity measure (distance).} - -\item{rlen}{How many times dataset will be presented to the SOM.} - -\item{prior_threshold}{Threshold of priot probability -(frequency of samples assigned to a same SOM neuron)} - -\item{posterior_threshold}{Threshold of posterior probability -(influenced by the SOM neighborhood)} - -\item{som_radius}{Radius of neighborhood on the SOM map -(controls the size of the neighbourhood)} -} -\value{ -A sits tibble with an evaluation column indicating if - each samples is clean, should be analyzed or - should be removed, and with a new column indicating - the posterior probability of the sample -} -\description{ -This function uses self-organized maps to find clusters in -satellite image time series for quality control of the samples. -Calls \code{\link[sits]{sits_som_map}} to generate the som map and -\code{\link[sits]{sits_som_clean_samples}} to produce a clean set of samples. -The parameters "grid_xdim", "grid_ydim", "rlen", "distance", "alpha", and -"iterations" are used by \code{\link[sits]{sits_som_map}} to control -how the Kohonen map is generated. -The parameters "prior_threshold" and "posterior_threshold" control -how the good quality samples are selected, based on the Kohonen map. -} -\examples{ -\dontrun{ -# Evaluate the quality of the samples using SOM clustering -new_samples <- sits_som_cluster(samples_modis_4bands) -} -} -\references{ -`kohonen` package (https://CRAN.R-project.org/package=kohonen) -} -\author{ -Lorena Alves, \email{lorena.santos@inpe.br} - -Karine Ferreira. \email{karine.ferreira@inpe.br} -} diff --git a/man/sits_som_evaluate_cluster.Rd b/man/sits_som_evaluate_cluster.Rd deleted file mode 100644 index 2acb8390e..000000000 --- a/man/sits_som_evaluate_cluster.Rd +++ /dev/null @@ -1,38 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_som.R -\name{sits_som_evaluate_cluster} -\alias{sits_som_evaluate_cluster} -\title{Evaluate cluster} -\usage{ -sits_som_evaluate_cluster(som_map) -} -\arguments{ -\item{som_map}{An object returned -by \code{\link[sits]{sits_som_map}}} -} -\value{ -A tibble with the cluster and the percentage of classes - mixtured in each cluster. -} -\description{ -This function evaluate the clusters created by -SOM. Each cluster is a neuron or a set of neuron categorized with same label. -It produces a sits tibble indicating the percentage of mixture -of classes in each cluster. -} -\examples{ -\dontrun{ -# Read a set of samples -# Get a new subset of samples evaluated by clustering methods -som_map <- sits_som_map(samples_modis_4bands, - grid_xdim = 10, grid_ydim = 10, - distance = "euclidean" -) -cluster_purity <- sits_som_evaluate_cluster(som_map) -} -} -\author{ -Lorena Santos, \email{lorena.santos@inpe.br} - -Karine Ferreira. \email{karine.ferreira@inpe.br} -} diff --git a/man/sits_som_map.Rd b/man/sits_som_map.Rd deleted file mode 100644 index 06b1c8ee4..000000000 --- a/man/sits_som_map.Rd +++ /dev/null @@ -1,73 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_som.R -\name{sits_som_map} -\alias{sits_som_map} -\title{Generate a Kohonen map for sample quality control} -\usage{ -sits_som_map( - data, - grid_xdim = 10, - grid_ydim = 10, - alpha = 1, - rlen = 100, - distance = "euclidean", - som_radius = 2, - mode = "online" -) -} -\arguments{ -\item{data}{A tibble with samples to be clustered.} - -\item{grid_xdim}{X dimension of the SOM grid (default = 25).} - -\item{grid_ydim}{Y dimension of the SOM grid.} - -\item{alpha}{Starting learning rate -(decreases according to number of iterations).} - -\item{rlen}{Number of iterations to produce the SOM.} - -\item{distance}{The type of similarity measure (distance).} - -\item{som_radius}{Radius of SOM neighborhood} - -\item{mode}{Type of learning algorithm (default = "online")} -} -\value{ -A list of tibbles containing statistics - about the samples and the neuron in each iteration. -} -\description{ -This function uses package self-organized maps -to find clusters in satellite image time series to cluster the samples. -It also evaluates the quality of each sample using SOM properties. - -The results is a list with three members: -(1) the samples tibble, with one additional column indicating -to which neuron it has been mapped; -(2) the Kohonen map, used for plotting and cluster quality measures; -(3) a tibble with the labelled neurons, -where each class of each neuron is associated to two values: -(a) the prior probability that this class belongs to a cluster -based on the frequency of samples of this class allocated to the neuron; -(b) the posterior probability that this class belongs to a cluster, -using data for the neighbours on the SOM map. -} -\examples{ -\dontrun{ -# Produce a cluster map -som_cluster <- sits_som_map(samples_modis_4bands) -# plot the som map -plot(som_cluster) -# Clean the samples to get better quality ones -clean_samples <- sits_som_clean_samples(som_cluster) -} -} -\references{ -`kohonen` package (https://CRAN.R-project.org/package=kohonen) -} -\author{ -Lorena Alves, \email{lorena.santos@inpe.br} - -Karine Ferreira. \email{karine.ferreira@inpe.br} -} diff --git a/man/sits_svm.Rd b/man/sits_svm.Rd index 4fdb75661..9a2c7a7cc 100644 --- a/man/sits_svm.Rd +++ b/man/sits_svm.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_machine_learning.R \name{sits_svm} \alias{sits_svm} -\title{Train a sits classification model using a support vector machine} +\title{Train support vector machine models} \usage{ sits_svm( data = NULL, diff --git a/man/sits_time_series.Rd b/man/sits_time_series.Rd index 6c08239a9..d52056683 100644 --- a/man/sits_time_series.Rd +++ b/man/sits_time_series.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_tibble.R \name{sits_time_series} \alias{sits_time_series} -\title{Retrieve time series for a row of a sits tibble} +\title{Get the time series for a row of a sits tibble} \usage{ sits_time_series(data) } diff --git a/man/sits_timeline.Rd b/man/sits_timeline.Rd index 6f9b41e74..b70808882 100644 --- a/man/sits_timeline.Rd +++ b/man/sits_timeline.Rd @@ -2,16 +2,16 @@ % Please edit documentation in R/sits_timeline.R \name{sits_timeline} \alias{sits_timeline} -\title{Obtains the timeline} +\title{Get timeline of a cube or a set of time series} \usage{ sits_timeline(data) } \arguments{ -\item{data}{either a sits tibble or data cube} +\item{data}{either a sits tibble, a data cube, or a trained model.} } \description{ This function returns the timeline for a given data set, either - a set of time series or a data cube + a set of time series, a data cube, or a trained model. } \author{ Gilberto Camara, \email{gilberto.camara@inpe.br} diff --git a/man/sits_to_xlsx.Rd b/man/sits_to_xlsx.Rd index c9e83ea16..2f54f99cf 100644 --- a/man/sits_to_xlsx.Rd +++ b/man/sits_to_xlsx.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_xlsx.R \name{sits_to_xlsx} \alias{sits_to_xlsx} -\title{Saves the results of accuracy assessments as Excel files} +\title{Save accuracy assessments as Excel files} \usage{ sits_to_xlsx(acc_lst, file) } diff --git a/man/sits_to_zoo.Rd b/man/sits_to_zoo.Rd index 5b6624c4f..dd45fa965 100644 --- a/man/sits_to_zoo.Rd +++ b/man/sits_to_zoo.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_zoo.R \name{sits_to_zoo} \alias{sits_to_zoo} -\title{Export data to be used to the zoo format} +\title{Export time series to zoo format} \usage{ sits_to_zoo(data, band = NULL) } diff --git a/man/sits_train.Rd b/man/sits_train.Rd index b73fd0267..7debfe9f6 100644 --- a/man/sits_train.Rd +++ b/man/sits_train.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_machine_learning.R \name{sits_train} \alias{sits_train} -\title{Train sits classification models} +\title{Train classification models} \usage{ sits_train(data, ml_method = sits_svm()) } @@ -32,7 +32,7 @@ and a deep Residual Network \code{\link[sits]{sits_ResNet}}. \examples{ # Retrieve the set of samples for Mato Grosso (provided by EMBRAPA) # fit a training model (RFOR model) -samples <- sits_select(samples_mt_6bands, bands = c("NDVI")) +samples <- sits_select(samples_modis_4bands, bands = c("NDVI")) ml_model <- sits_train(samples, sits_rfor(num_trees = 100)) # get a point and classify the point with the ml_model point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") diff --git a/man/sits_twdtw_classify.Rd b/man/sits_twdtw_classify.Rd index 01fc7dada..584c72b26 100644 --- a/man/sits_twdtw_classify.Rd +++ b/man/sits_twdtw_classify.Rd @@ -76,10 +76,10 @@ seasonal variability. \examples{ \dontrun{ # Retrieve the set of samples for the Mato Grosso region -samples <- sits_select(samples_mt_6bands, bands = c("NDVI", "EVI")) +samples <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) # get a point and classify the point with the ml_model -point <- sits_select(point_mt_6bands, bands = c("NDVI", "EVI")) +point <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) # plot the series plot(point) diff --git a/man/sits_values.Rd b/man/sits_values.Rd index 05e92cb0c..1a8e34fb5 100644 --- a/man/sits_values.Rd +++ b/man/sits_values.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_values.R \name{sits_values} \alias{sits_values} -\title{Return the values of a given sits tibble as a list of matrices.} +\title{Return the values of a set of time series} \usage{ sits_values(data, bands = NULL, format = "cases_dates_bands") } @@ -17,7 +17,7 @@ extract ALL bands.} or "bands_cases_dates" or "bands_dates_cases".} } \value{ -A sits tibble with values. +A matrix with values. } \description{ This function returns the values of a sits tibble diff --git a/man/sits_view.Rd b/man/sits_view.Rd index cf5eca00d..42efb99b2 100644 --- a/man/sits_view.Rd +++ b/man/sits_view.Rd @@ -5,11 +5,11 @@ \alias{sits_view.sits} \alias{sits_view.raster_cube} \alias{sits_view.classified_image} -\title{Generic interface for visualization of data cube} +\title{View data cubes and samples in leaflet} \usage{ sits_view(x, ...) -\method{sits_view}{sits}(x, ..., legend = NULL, palette = "default") +\method{sits_view}{sits}(x, ..., legend = NULL, palette = "Harmonic") \method{sits_view}{raster_cube}( x, diff --git a/man/sits_whittaker.Rd b/man/sits_whittaker.Rd index 01d0bbc85..4c3946bec 100644 --- a/man/sits_whittaker.Rd +++ b/man/sits_whittaker.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_filters.R \name{sits_whittaker} \alias{sits_whittaker} -\title{Filter the time series using Whittaker smoother} +\title{Filter time series using Whittaker smoother} \usage{ sits_whittaker(data = NULL, lambda = 0.5, bands_suffix = "wf") } diff --git a/man/sits_xgboost.Rd b/man/sits_xgboost.Rd index cb8fa379c..8a01d1744 100644 --- a/man/sits_xgboost.Rd +++ b/man/sits_xgboost.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/sits_machine_learning.R \name{sits_xgboost} \alias{sits_xgboost} -\title{Train a model with an extreme gradient boosting machine} +\title{Train extreme gradient boosting models} \usage{ sits_xgboost( data = NULL, diff --git a/man/source_collection.Rd b/man/source_collection.Rd index 60a1bd218..ae45f4c57 100644 --- a/man/source_collection.Rd +++ b/man/source_collection.Rd @@ -7,6 +7,7 @@ \alias{.source_collection_access_vars_set} \alias{.source_collection_check} \alias{.source_collection_gdal_config} +\alias{.source_collection_gdal_type} \alias{.source_collection_name} \alias{.source_collection_open_data} \alias{.source_collection_open_data_token} @@ -24,6 +25,8 @@ .source_collection_gdal_config(source, collection) +.source_collection_gdal_type(source, collection) + .source_collection_name(source, collection) .source_collection_open_data(source, collection) @@ -56,6 +59,8 @@ no error occurs. \code{.source_collection_gdal_config()} returns the gdal format file path. +\code{.source_collection_gdal_type()} returns the gdal type. + \code{.source_collection_name()} returns a \code{character}. \code{.source_collection_open_data()} returns a \code{logical}. @@ -83,6 +88,9 @@ is from a source. \code{.source_collection_gdal_config()} checks if a collection has a gdalcubes format description. +\code{.source_collection_gdal_type()} checks if a collection +has a gdalcubes type for writing files. + \code{.source_collection_name()} returns the name of a collection in its original source. diff --git a/man/source_functions.Rd b/man/source_functions.Rd index c81ce21f4..df009458a 100644 --- a/man/source_functions.Rd +++ b/man/source_functions.Rd @@ -14,7 +14,7 @@ .source_check(source) -.source_new(source, is_local = FALSE) +.source_new(source, collection = NULL, is_local = FALSE) .source_service(source) diff --git a/man/tick-sits_labels-set-tick.Rd b/man/tick-sits_labels-set-tick.Rd index add932d42..432a0cfb1 100644 --- a/man/tick-sits_labels-set-tick.Rd +++ b/man/tick-sits_labels-set-tick.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sits_labels_set.R +% Please edit documentation in R/sits_labels.R \name{`sits_labels<-`} \alias{`sits_labels<-`} \alias{sits_labels<-} -\title{Change labels of a sits tibble} +\title{Change the labels of a set of time series} \usage{ sits_labels(data) <- value } diff --git a/man/timeline_2000_2017.Rd b/man/timeline_2000_2017.Rd deleted file mode 100644 index 79b229878..000000000 --- a/man/timeline_2000_2017.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{timeline_2000_2017} -\alias{timeline_2000_2017} -\title{The timeline for the sequence of images for MOD13Q1 collection 6} -\format{ -A vector with 407 dates in YYYY-MM-DD format. -} -\usage{ -data(timeline_2000_2017) -} -\description{ -The timeline for the time series used in the examples - that use data from MODIS collection 6. - There are 407 instances from 2000-02-18 until 2017-10-16. -} -\keyword{datasets} diff --git a/man/timeline_2013_2014.Rd b/man/timeline_2013_2014.Rd deleted file mode 100644 index a981d1600..000000000 --- a/man/timeline_2013_2014.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{timeline_2013_2014} -\alias{timeline_2013_2014} -\title{The timeline for the sequence of images one year (2013 to 2014)} -\format{ -A vector with 23 dates in YYYY-MM-DD format. -} -\usage{ -data(timeline_2013_2014) -} -\description{ -The timeline for the time series used in the examples - that use data for one year classification. - There are 23 instances from 2013-09-14 until 2014-08-29. -} -\keyword{datasets} diff --git a/man/ts_zoo.Rd b/man/ts_zoo.Rd deleted file mode 100644 index a6c1881ab..000000000 --- a/man/ts_zoo.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{ts_zoo} -\alias{ts_zoo} -\title{A time series in the ZOO format} -\format{ -A ZOO time series with bands NDVI and EVI for a one year period -} -\usage{ -data(ts_zoo) -} -\description{ -A dataset containing a one ZOO time series samples - in the Mato Grosso state of Brazil. - The time series comes from MOD13Q1 collection 5 images. -} -\keyword{datasets} diff --git a/tests/testthat/test-classification.R b/tests/testthat/test-classification.R index 8a4b018ef..43fa6f9c8 100644 --- a/tests/testthat/test-classification.R +++ b/tests/testthat/test-classification.R @@ -44,8 +44,7 @@ test_that("Classify a set of time series with svm + filter", { test_that("Classify time series with TWDTW method", { testthat::skip_on_cran() samples_mt_ndvi <- sits_select(samples_modis_4bands, bands = "NDVI") - points_mt_6bands <- samples_mt_6bands[1:15, ] - points_mt_ndvi <- sits_select(points_mt_6bands, bands = "NDVI") + points_mt_ndvi <- samples_mt_ndvi[1:15,] patterns <- sits_patterns(samples_mt_ndvi) expect_true(all(sits_labels(patterns) %in% sits_labels(samples_mt_ndvi))) matches <- sits_twdtw_classify(points_mt_ndvi, diff --git a/tests/testthat/test-color.R b/tests/testthat/test-color.R deleted file mode 100644 index 5dd3b03dd..000000000 --- a/tests/testthat/test-color.R +++ /dev/null @@ -1,9 +0,0 @@ -test_that("Colors", { - expect_equal(sits:::.sits_brewer_color_name("BluePurple"), "BuPu") - - expect_equal(sits:::.sits_brewer_max_colors("BuPu"), 19) - - nc <- sits:::.sits_brewer_max_colors() - expect_equal(length(nc), 35) - expect_equal(nc$Spectral, 10) -}) diff --git a/tests/testthat/test-config.R b/tests/testthat/test-config.R index 9b85711b9..f8652e11a 100644 --- a/tests/testthat/test-config.R +++ b/tests/testthat/test-config.R @@ -39,11 +39,6 @@ test_that("User functions", { c("COMPRESS=LZW", "BIGTIFF=YES") ) - expect_equal( - .config_palettes(), - "default" - ) - # load default + user config expect_true( Sys.setenv("SITS_CONFIG_USER_FILE" = @@ -77,31 +72,9 @@ test_that("User functions", { ) expect_equal( - .config_palettes(), - c("default", "my_project") - ) - - expect_error( - .config_palette_check(palette = "zzz"), - "invalid 'palette' parameter" - ) + unname(.config_colors(labels = c("Cropland", "Deforestation", + "Forest", "Grassland", "NonForest"))), - expect_equal( - .config_palette_check(palette = "my_project"), - c("my_project") - ) - - expect_error( - .config_palette_colors(labels = c("Cropland", "Deforestation", - "Forest", "Grassland", "NonForest", - "Cropland", "Deforestation", - "Forest", "Grassland", "NonForest"), - palette = "my_project") - ) - expect_equal( - unname(.config_palette_colors(labels = c("Cropland", "Deforestation", - "Forest", "Grassland", "NonForest"), - palette = "my_project")), c("khaki", "sienna", "darkgreen", "lightgreen", "lightsteelblue1") ) @@ -135,11 +108,6 @@ test_that("User functions", { c("BIGTIFF=YES") ) - expect_equal( - .config_palettes(), - c("default", "my_project") - ) - config_txt <- capture.output({ sits_config_show() }) @@ -167,16 +135,7 @@ test_that("User functions", { )) ) - config_txt <- capture.output({ - sits_config_show(palette = "default") - }) - expect_true( - any(grepl( - "Forest: '#00441B'", - config_txt - )) - ) # add a new source, collection .config_set_options( @@ -304,11 +263,6 @@ test_that("Configs AWS", { "invalid names for 'zzz' key" ) - expect_equal( - .config_names(key = c("palettes")), - c("default") - ) - expect_equal( .source_collection_access_vars_set(source = "AWS", collection = "SENTINEL-S2-L2A"), diff --git a/tests/testthat/test-csv.R b/tests/testthat/test-csv.R deleted file mode 100644 index 8799038b8..000000000 --- a/tests/testthat/test-csv.R +++ /dev/null @@ -1,34 +0,0 @@ -test_that("Data to CSV", { - csv_file <- paste0(tempdir(), "/cerrado_2classes.csv") - expect_true(sits_data_to_csv(cerrado_2classes, - file = csv_file - )) - expect_true(file.remove(csv_file)) -}) - -test_that("Data to CSV - error", { - data(cerrado_2classes) - expect_error( - sits_data_to_csv( - cerrado_2classes, - file = "/non-existent-directory/cerrado_2classes.csv" - ) - ) -}) - -test_that("Metadata to CSV", { - data(cerrado_2classes) - csv_file <- paste0(tempdir(), "/cerrado_2classes.csv") - sits_metadata_to_csv(cerrado_2classes, csv_file) - - expect_true(file.remove(csv_file)) -}) - -test_that("Metadata to CSV - error", { - data(cerrado_2classes) - expect_error( - sits_metadata_to_csv(cerrado_2classes, - file = "/non-existent-directory/cerrado_2classes.csv" - ) - ) -}) diff --git a/tests/testthat/test-cube.R b/tests/testthat/test-cube.R index d8b79fa7d..cb9d004b2 100644 --- a/tests/testthat/test-cube.R +++ b/tests/testthat/test-cube.R @@ -266,13 +266,20 @@ test_that("Creating cubes from AWS", { Sys.unsetenv("AWS_REQUEST_PAYER") - s2_cube <- sits_cube(source = "AWS", + s2_cube <- tryCatch({sits_cube(source = "AWS", collection = "sentinel-s2-l2a", tiles = c("20LKP"), bands = c("B08", "SCL"), start_date = "2018-07-30", end_date = "2018-08-30" - ) + ) + }, + error = function(e) { + return(NULL) + }) + + testthat::skip_if(purrr::is_null(s2_cube), + "AWS is not accessible") expect_true(all(sits_bands(s2_cube) %in% c("B08", "CLOUD"))) @@ -288,13 +295,19 @@ test_that("Creating cubes from AWS", { test_that("Creating cubes from AWS Open Data and regularizing them", { - s2_cube_open <- sits_cube(source = "AWS", - collection = "SENTINEL-S2-L2A-COGS", - tiles = c("20LKP", "20LLP"), - bands = c("B08", "SCL"), - start_date = "2018-07-30", - end_date = "2018-08-30" - ) + s2_cube_open <- tryCatch({ + sits_cube(source = "AWS", + collection = "SENTINEL-S2-L2A-COGS", + tiles = c("20LKP", "20LLP"), + bands = c("B08", "SCL"), + start_date = "2018-07-30", + end_date = "2018-08-30" + )}, + error = function(e){ + return(NULL) + }) + testthat::skip_if(purrr::is_null(s2_cube_open), + "AWS is not accessible") expect_false(.cube_is_regular(s2_cube_open)) expect_true(all(sits_bands(s2_cube_open) %in% c("B08", "CLOUD"))) @@ -329,6 +342,106 @@ test_that("Creating cubes from AWS Open Data and regularizing them", { expect_equal(nrow(file_info2), 2) }) + +test_that("Creating cubes from USGS", { + + testthat::skip_on_cran() + + # check "AWS_ACCESS_KEY_ID" - mandatory one per user + aws_access_key_id <- Sys.getenv("AWS_ACCESS_KEY_ID") + + # check "AWS_SECRET_ACCESS_KEY" - mandatory one per user + aws_secret_access_key <- Sys.getenv("AWS_SECRET_ACCESS_KEY") + + testthat::skip_if( + nchar(aws_access_key_id) == 0, + message = "No AWS_ACCESS_KEY_ID defined in environment." + ) + + testthat::skip_if( + nchar(aws_secret_access_key) == 0, + message = "No AWS_SECRET_ACCESS_KEY defined in environment." + ) + + Sys.unsetenv("AWS_DEFAULT_REGION") + Sys.unsetenv("AWS_S3_ENDPOINT") + Sys.unsetenv("AWS_REQUEST_PAYER") + + + usgs_cube <- sits_cube(source = "USGS", + collection = "landsat-c2l2-sr", + bands = c("B04", "CLOUD"), + roi = c("lon_min" = 17.379, + "lat_min" = 1.1573, + "lon_max" = 17.410, + "lat_max" = 1.1910), + start_date = "2019-01-01", + end_date = "2019-10-28" + ) + + expect_true(all(sits_bands(usgs_cube) %in% c("B04", "CLOUD"))) + + expect_equal(class(.cube_size(usgs_cube)), "numeric") + expect_equal(class(.cube_resolution(usgs_cube)), "integer") + + file_info <- usgs_cube$file_info[[1]] + r <- sits:::.raster_open_rast(file_info$path[[1]]) + + expect_equal(usgs_cube$xmax[[1]], sits:::.raster_xmax(r), tolerance = 1) + expect_equal(usgs_cube$xmin[[1]], sits:::.raster_xmin(r), tolerance = 1) +}) + +test_that("Creating Sentinel cubes from MSPC", { + + testthat::skip_on_cran() + + s2_cube <- sits_cube(source = "MSPC", + collection = "sentinel-2-l2a", + tiles = "20LKP", + bands = c("B05", "CLOUD"), + start_date = as.Date("2018-07-18"), + end_date = as.Date("2018-08-23") + ) + + expect_true(all(sits_bands(s2_cube) %in% c("B05", "CLOUD"))) + + expect_equal(class(.cube_size(s2_cube)), "numeric") + expect_equal(class(.cube_resolution(s2_cube)), "integer") + + file_info <- s2_cube$file_info[[1]] + r <- sits:::.raster_open_rast(file_info$path[[1]]) + + expect_equal(s2_cube$xmax[[1]], sits:::.raster_xmax(r), tolerance = 1) + expect_equal(s2_cube$xmin[[1]], sits:::.raster_xmin(r), tolerance = 1) +}) + +test_that("Creating Landsat cubes from MSPC", { + + testthat::skip_on_cran() + + l8_cube <- sits_cube(source = "MSPC", + collection = "landsat-8-c2-l2", + roi = c("lon_min" = 17.379, + "lat_min" = 1.1573, + "lon_max" = 17.410, + "lat_max" = 1.1910), + bands = c("B03","CLOUD"), + start_date = as.Date("2019-07-18"), + end_date = as.Date("2019-10-23") + ) + + expect_true(all(sits_bands(l8_cube) %in% c("B03", "CLOUD"))) + + expect_equal(class(.cube_size(l8_cube)), "numeric") + expect_equal(class(.cube_resolution(l8_cube)), "integer") + + file_info <- l8_cube$file_info[[1]] + r <- sits:::.raster_open_rast(file_info$path[[1]]) + + expect_equal(l8_cube$xmax[[1]], sits:::.raster_xmax(r), tolerance = 1) + expect_equal(l8_cube$xmin[[1]], sits:::.raster_xmin(r), tolerance = 1) +}) + test_that("Creating a raster stack cube with BDC band names", { # Create a raster cube based on CBERS data data_dir <- system.file("extdata/raster/bdc", package = "sits") @@ -352,5 +465,4 @@ test_that("Creating a raster stack cube with BDC band names", { expect_true(all(sits_bands(cbers_cube_bdc) %in% c("B16"))) - }) diff --git a/tests/testthat/test-filtering.R b/tests/testthat/test-filtering.R index 39606e129..efe022ab4 100644 --- a/tests/testthat/test-filtering.R +++ b/tests/testthat/test-filtering.R @@ -2,7 +2,7 @@ test_that("Generic filter", { point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") point_ndvi_whit <- sits_filter(point_ndvi) expect_true(length(sits_timeline(point_ndvi)) - == length(sits_timeline(point_ndvi_whit))) + == length(sits_timeline(point_ndvi_whit))) }) test_that("Generic filter-error", { @@ -13,15 +13,6 @@ test_that("Generic filter-error", { ) }) -test_that("Envelope filter", { - testthat::skip_on_cran() - library(dtwclust) - point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") - point_env <- sits_envelope(point_ndvi, bands_suffix = "env") - expect_true(all(sits_time_series(point_env)$NDVI.env - >= sits_time_series(point_ndvi)$NDVI)) -}) - test_that("Whittaker filter", { # skip_on_cran() point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") @@ -38,7 +29,7 @@ test_that("Savitsky Golay filter", { length(sits_timeline(point_sg))) }) -test_that("Interpolation filter", { +test_that("Spline interpolation", { point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") n_times <- length(sits_timeline(point_ndvi)) point_int <- sits_interp(point_ndvi, fun = stats::spline, n = 3 * n_times) @@ -48,18 +39,11 @@ test_that("Interpolation filter", { sd(sits_time_series(point_int)$NDVI)) }) -test_that("Linear interpolation filter", { +test_that("Linear interpolation", { point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") - point_int <- sits_linear_interp(point_ndvi) + point_int <- sits_interp(point_ndvi) # filtered data has less sd expect_true(sd(sits_time_series(point_ndvi)$NDVI) > sd(sits_time_series(point_int)$NDVI)) }) - -test_that("Missing values", { - point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") - point_ndvi_2 <- sits_missing_values(point_ndvi, miss_value = -3000) - expect_true(length(sits_timeline(point_ndvi)) - == length(sits_timeline(point_ndvi_2))) -}) diff --git a/tests/testthat/test-indexes.R b/tests/testthat/test-indexes.R deleted file mode 100644 index dc11e69a5..000000000 --- a/tests/testthat/test-indexes.R +++ /dev/null @@ -1,12 +0,0 @@ -test_that("NDWI", { - ndwi <- sits_ndwi(samples_modis_4bands) - - expect_true("NDVI" %in% names(ndwi$time_series[[1]])) -}) - -test_that("SAVI", { - data(samples_mt_6bands) - savi <- sits_savi(samples_mt_6bands) - - expect_true("SAVI" %in% names(savi$time_series[[1]])) -}) diff --git a/tests/testthat/test-labels.R b/tests/testthat/test-labels.R index 0ca0c348b..72b6b43ef 100644 --- a/tests/testthat/test-labels.R +++ b/tests/testthat/test-labels.R @@ -1,10 +1,10 @@ test_that("Labels", { # skip_on_cran() - labels <- sits_labels_summary(samples_mt_6bands) + labels <- sits_labels_summary(samples_modis_4bands) - expect_true("Cerrado" %in% sits_labels(samples_mt_6bands)) - expect_equal(sum(labels$count), 425) + expect_true("Cerrado" %in% sits_labels(samples_modis_4bands)) + expect_equal(sum(labels$count), 1218) expect_equal(labels$label[1], "Cerrado") expect_equal(sum(labels$prop), 1) diff --git a/tests/testthat/test-ml.R b/tests/testthat/test-ml.R index e8b0a47d6..4d6e62896 100644 --- a/tests/testthat/test-ml.R +++ b/tests/testthat/test-ml.R @@ -1,3 +1,5 @@ +source("./test-utils.R") + test_that("SVM - Formula logref", { # skip_on_cran() samples_mt_ndvi <- sits_select(samples_modis_4bands, bands = "NDVI") @@ -114,13 +116,14 @@ test_that("XGBoost", { sits_labels(samples_mt_ndvi))) expect_true(nrow(sits_show_prediction(point_class)) == 17) }) + test_that("DL-MLP", { # skip_on_cran() Sys.setenv(TF_CPP_MIN_LOG_LEVEL = "1") samples_mt_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI") ) - model <- suppressMessages(suppressWarnings( + model <- suppress_keras( sits_train( samples_mt_2bands, sits_mlp( @@ -130,13 +133,15 @@ test_that("DL-MLP", { verbose = 0 ) ) - )) + ) point_2bands <- sits_select(point_mt_6bands, bands = c("NDVI", "EVI")) - point_class <- sits_classify( - data = point_2bands, - ml_model = model + point_class <- suppress_keras( + sits_classify( + data = point_2bands, + ml_model = model + ) ) expect_true(all(point_class$predicted[[1]]$class %in% @@ -149,7 +154,7 @@ test_that("DL-MLP-2classes", { samples_mt_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI") ) - model <- suppressMessages(suppressWarnings( + model <- suppress_keras( sits_train( samples_mt_2bands, sits_mlp( @@ -159,13 +164,12 @@ test_that("DL-MLP-2classes", { verbose = 0 ) ) - )) - test_eval <- suppressMessages(sits_keras_diagnostics(model)) - expect_true(test_eval["accuracy"] > 0.7) - - point_class <- sits_classify( - data = cerrado_2classes[1:60, ], - ml_model = model + ) + point_class <- suppress_keras( + sits_classify( + data = cerrado_2classes[1:60, ], + ml_model = model + ) ) expect_true(all(point_class$predicted[[1]]$class %in% @@ -176,11 +180,15 @@ test_that("DL-MLP-2classes", { test_that("ResNet", { # skip_on_cran() samples_ndvi <- sits_select(samples_modis_4bands, bands = "NDVI") - model <- sits_train(samples_ndvi, sits_ResNet(epochs = 50, verbose = 0)) + model <- suppress_keras( + sits_train(samples_ndvi, sits_ResNet(epochs = 50, verbose = 0)) + ) point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") - point_class <- sits_classify( - data = point_ndvi, - ml_model = model + point_class <- suppress_keras( + sits_classify( + data = point_ndvi, + ml_model = model + ) ) expect_true(all(point_class$predicted[[1]]$class %in% @@ -190,7 +198,7 @@ test_that("ResNet", { test_that("tempCNN model", { # skip_on_cran() samples_mt_ndvi <- sits_select(samples_modis_4bands, bands = "NDVI") - model <- suppressMessages(suppressWarnings( + model <- suppress_keras( sits_train( samples_mt_ndvi, sits_TempCNN( @@ -198,14 +206,13 @@ test_that("tempCNN model", { verbose = 0 ) ) - )) - - test_eval <- suppressMessages(sits_keras_diagnostics(model)) - expect_true(test_eval["accuracy"] > 0.7) + ) point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI") - point_class <- sits_classify( - data = point_ndvi, - ml_model = model + point_class <- suppress_keras( + sits_classify( + data = point_ndvi, + ml_model = model + ) ) expect_true(all(point_class$predicted[[1]]$class %in% diff --git a/tests/testthat/test-raster.R b/tests/testthat/test-raster.R index 64f018418..f5633e0d1 100644 --- a/tests/testthat/test-raster.R +++ b/tests/testthat/test-raster.R @@ -1,13 +1,19 @@ +source("./test-utils.R") + test_that("One-year, single core classification", { samples_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI")) - dl_model <- sits_train(samples_2bands, sits_mlp( - layers = c(256, 256, 256), - dropout_rates = c(0.5, 0.4, 0.3), - epochs = 80, - batch_size = 64, - verbose = 0 - )) + dl_model <- suppress_keras( + sits_train(samples_2bands, + sits_mlp( + layers = c(256, 256, 256), + dropout_rates = c(0.5, 0.4, 0.3), + epochs = 80, + batch_size = 64, + verbose = 0 + ) + ) + ) data_dir <- system.file("extdata/raster/mod13q1", package = "sits") sinop <- sits_cube( @@ -17,7 +23,7 @@ test_that("One-year, single core classification", { delim = "_", parse_info = c("X1", "X2", "tile", "band", "date") ) - sinop_probs <- suppressMessages( + sinop_probs <- suppress_keras( sits_classify( data = sinop, ml_model = dl_model, diff --git a/tests/testthat/test-som.R b/tests/testthat/test-som.R index b629101e6..e4e5310a2 100644 --- a/tests/testthat/test-som.R +++ b/tests/testthat/test-som.R @@ -1,17 +1,6 @@ test_that("Creating clustering using Self-organizing Maps", { # skip_on_cran() data("cerrado_2classes") - new_samples <- sits_som_cluster( - cerrado_2classes, - grid_xdim = 5, - grid_ydim = 5 - ) - - expect_true(all(new_samples$eval %in% c("clean", "analyze", "remove"))) - expect_true(new_samples[1, ]$post_prob > 0) - grid_size <- 25 - expect_true(all(new_samples$id_neuron %in% c(1:grid_size))) - set.seed(2903) som_map <- sits_som_map( samples_modis_4bands, @@ -28,6 +17,7 @@ test_that("Creating clustering using Self-organizing Maps", { cleaned_samples <- sits_som_clean_samples(som_map) expect_true("eval" %in% names(cleaned_samples)) expect_true("post_prob" %in% names(cleaned_samples)) + expect_true(all(cleaned_samples$eval %in% c("clean", "analyze", "remove"))) expect_true(cleaned_samples[1, ]$post_prob > 0) diff --git a/tests/testthat/test-tibble.R b/tests/testthat/test-tibble.R index a60edc277..2c09ac8f7 100644 --- a/tests/testthat/test-tibble.R +++ b/tests/testthat/test-tibble.R @@ -1,7 +1,6 @@ test_that("Align dates", { data("samples_modis_4bands") - data("timeline_2000_2017") - timeline <- lubridate::as_date(timeline_2000_2017) + timeline <- sits_timeline(point_mt_6bands) start_date <- lubridate::as_date("2001-08-01") end_date <- lubridate::as_date("2002-07-31") @@ -48,13 +47,11 @@ test_that("Merge", { }) test_that("Mutate", { - savi <- sits_mutate_bands(samples_mt_6bands, - SAVI = (1.5 * (NIR - RED) / (NIR + RED + 0.5)) - ) - - expect_equal(sum(sits_time_series(savi)$SAVI), - 5.980619, - tolerance = 0.001 + ndwi <- sits_mutate_bands(samples_modis_4bands, + NDWI = (1.5) * (NIR - MIR) / (NIR + MIR)) + expect_equal(sum(sits_time_series(ndwi)$NDWI), + 14.22552, + tolerance = 0.001 ) }) @@ -89,7 +86,7 @@ test_that("Select", { expect_equal(dim(samples_pasture)[1], 344) }) -test_that("Transmute", { +test_that("Sample", { data <- sits_sample(cerrado_2classes, n = 10) expect_equal(sits_labels(cerrado_2classes), sits_labels(data)) @@ -105,11 +102,9 @@ test_that("Values", { expect_equal(sum(values$NDVI[, "NDVI"]), 13.6291, tolerance = 0.001) }) -test_that("Values", { - data(samples_mt_6bands) - savi <- sits:::.sits_ops_compute(samples_mt_6bands, - SAVI = (1.5 * (NIR - RED) / (NIR + RED + 0.5)) - ) +test_that("Ops Compute", { + ndwi <- sits:::.sits_ops_compute(samples_modis_4bands, + NDWI = (1.5) * (NIR - MIR) / (NIR + MIR)) - expect_true("SAVI" %in% names(sits_time_series(savi))) + expect_true("NDWI" %in% names(sits_time_series(ndwi))) }) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R new file mode 100644 index 000000000..d73ab69d6 --- /dev/null +++ b/tests/testthat/test-utils.R @@ -0,0 +1,31 @@ +suppress_keras <- function(expression) { + tmp_dir <- gsub("^(.+/).*", "\\1", tempdir()) + + # to filter transpiled and python code in pre-exec + pre_files <- c(list.files(tmp_dir, + pattern = "tmp.*\\.py$", + full.names = TRUE), + list.files(paste0(tmp_dir, "__pycache__"), + pattern = "tmp.*\\.pyc$", + full.names = TRUE)) + + model <- suppressMessages(suppressWarnings((expression))) + + # to filter transpiled and python code in post-exec + post_files <- c(list.files(tmp_dir, + pattern = "tmp.*\\.py$", + full.names = TRUE), + list.files(paste0(tmp_dir, "__pycache__"), + pattern = "tmp.*\\.pyc$", + full.names = TRUE)) + + # delete py files + unlink(setdiff(post_files, pre_files)) + + if (length(list.files(paste0(tmp_dir, "__pycache__"), + pattern = "tmp.*\\.pyc$", + full.names = TRUE)) == 0) + unlink(paste0(tmp_dir, "__pycache__"), recursive = TRUE) + + model +} diff --git a/tests/testthat/test-zoo.R b/tests/testthat/test-zoo.R index 795b85905..9b5187fe3 100644 --- a/tests/testthat/test-zoo.R +++ b/tests/testthat/test-zoo.R @@ -6,15 +6,3 @@ test_that("Writing a zoo time series", { expect_equal(dim(zoo_lst[[1]])[1], 23) expect_equal(dim(zoo_lst[[1]])[2], 2) }) - -test_that("Reading a ZOO time series", { - # skip_on_cran() - data(ts_zoo) - data <- sits_from_zoo(ts_zoo, - longitude = -54.2313, latitude = -14.0482, - label = "Cerrado", name = "mod13q1" - ) - - expect_equal(sum(sits_time_series(data)$ndvi), 13.6291, tolerance = 1e-3) - expect_true(nrow(ts_zoo) == length(sits_timeline(data))) -})