From f0976b6611ea736d85c79e4212e84b5eed4eed1a Mon Sep 17 00:00:00 2001 From: Nicolas Casajus Date: Wed, 6 Mar 2024 11:50:00 +0100 Subject: [PATCH] doc: edit vignettes --- vignettes/data-conversion.Rmd | 58 ++++++++++++++++- vignettes/data-visualization.Rmd | 35 +++++++++- vignettes/forcis.Rmd | 44 ++++++++++++- vignettes/select-and-filter-data.Rmd | 97 +++++++++++++++++++++++++++- 4 files changed, 229 insertions(+), 5 deletions(-) diff --git a/vignettes/data-conversion.Rmd b/vignettes/data-conversion.Rmd index a694424..92751ac 100644 --- a/vignettes/data-conversion.Rmd +++ b/vignettes/data-conversion.Rmd @@ -16,8 +16,64 @@ knitr::opts_chunk$set( ) ``` + +> **NOTE:** THIS IS A WORK IN PROGRESS. + +The package `forcis` provides [functions](https://frbcesab.github.io/forcis/reference/index.html#standardization-functions) to homogenize FORCIS data and compute abundances, concentrations, and frequencies of foraminifera. This vignette shows how to use these functions. + + +## Setup + +First, let's import the required packages. + ```{r setup} library(forcis) ``` -Work in progress... +Before going any further, we will download the latest version of the FORCIS database. + +```{r 'download-db', eval=FALSE} +# Create a data/ folder ---- +dir.create("data") + +# Download latest version of the database ---- +download_forcis_db(path = "data", version = NULL) +``` + +The vignette will use the PUMP data of the FORCIS database. Let's import the latest release of the data. + +```{r 'load-data', echo=FALSE} +file_name <- system.file(file.path("extdata", "FORCIS_pump_sample.csv"), package = "forcis") +pump_data <- vroom::vroom(file_name, delim = ";", show_col_types = FALSE) +``` + +```{r 'load-data-user', eval=FALSE} +# Import pump data ---- +pump_data <- read_pump_data(path = "data") +``` + +**NB:** In this vignette, we use a subset of the PUMP data, not the whole dataset. + + + +## `compute_abundances()` + +Add an illustration of `compute_abundances()` + +[...] + + + +## `compute_concentrations()` + +Add an illustration of `compute_concentrations()` + +[...] + + + +## `compute_frequencies()` + +Add an illustration of `compute_frequencies()` + +[...] diff --git a/vignettes/data-visualization.Rmd b/vignettes/data-visualization.Rmd index 42f8431..0d3ff36 100644 --- a/vignettes/data-visualization.Rmd +++ b/vignettes/data-visualization.Rmd @@ -58,7 +58,7 @@ pump_data <- read_pump_data(path = "data") **NB:** In this vignette, we use a subset of the PUMP data, not the whole dataset. -## World base map +## `geom_basemap()` The function `geom_basemap()` can be used to easily add World countries, oceans and bounding box to a `ggplot2` object. @@ -72,7 +72,7 @@ These layers come from the [Natural Earth](https://www.naturalearthdata.com/) we -## Map FORCIS data +## `ggmap_data()` The function `ggmap_data()` can be used to plot FORCIS data on a World map. Let's map the PUMP data. @@ -135,3 +135,34 @@ ggsave(indian_pump_data_map, scale = 1.5, bg = "white") ``` + + +## `plot_record_by_year()` + +Add an illustration of `plot_record_by_year()` + +[...] + + + +## `plot_record_by_month()` + +Add an illustration of `plot_record_by_month()` + +[...] + + + +## `plot_record_by_season()` + +Add an illustration of `plot_record_by_season()` + +[...] + + + +## `plot_record_by_depth()` + +Add an illustration of `plot_record_by_depth()` + +[...] diff --git a/vignettes/forcis.Rmd b/vignettes/forcis.Rmd index d53b8fe..92b60e8 100644 --- a/vignettes/forcis.Rmd +++ b/vignettes/forcis.Rmd @@ -16,8 +16,50 @@ knitr::opts_chunk$set( ) ``` + +> **NOTE:** THIS IS A WORK IN PROGRESS. + +Add an good introduction of the package. + + +## Setup + +First, let's import the required packages. + ```{r setup} library(forcis) ``` -Work in progress... +## Download FORCIS database + +Before going any further, we will download the latest version of the FORCIS database. + +```{r 'download-db', eval=FALSE} +# Create a data/ folder ---- +dir.create("data") + +# Download latest version of the database ---- +download_forcis_db(path = "data", version = NULL) +``` + + +## Import FORCIS data + +The vignette will use the PUMP data of the FORCIS database. Let's import the latest release of the data. + +```{r 'load-data', echo=FALSE} +file_name <- system.file(file.path("extdata", "FORCIS_pump_sample.csv"), package = "forcis") +pump_data <- vroom::vroom(file_name, delim = ";", show_col_types = FALSE) +``` + +```{r 'load-data-user', eval=FALSE} +# Import pump data ---- +pump_data <- read_pump_data(path = "data") +``` + +**NB:** In this vignette, we use a subset of the PUMP data, not the whole dataset. + + +## Another section + +[...] diff --git a/vignettes/select-and-filter-data.Rmd b/vignettes/select-and-filter-data.Rmd index 5f41119..b700022 100644 --- a/vignettes/select-and-filter-data.Rmd +++ b/vignettes/select-and-filter-data.Rmd @@ -16,8 +16,103 @@ knitr::opts_chunk$set( ) ``` +> **NOTE:** THIS IS A WORK IN PROGRESS. + +The package `forcis` provides [a lot of functions](https://frbcesab.github.io/forcis/reference/index.html#select-and-filters-tools) to filter and select FORCIS data. This vignette shows how to use these functions. + + +## Setup + +First, let's import the required packages. + ```{r setup} library(forcis) ``` -Work in progress... +Before going any further, we will download the latest version of the FORCIS database. + +```{r 'download-db', eval=FALSE} +# Create a data/ folder ---- +dir.create("data") + +# Download latest version of the database ---- +download_forcis_db(path = "data", version = NULL) +``` + +The vignette will use the PUMP data of the FORCIS database. Let's import the latest release of the data. + +```{r 'load-data', echo=FALSE} +file_name <- system.file(file.path("extdata", "FORCIS_pump_sample.csv"), package = "forcis") +pump_data <- vroom::vroom(file_name, delim = ";", show_col_types = FALSE) +``` + +```{r 'load-data-user', eval=FALSE} +# Import pump data ---- +pump_data <- read_pump_data(path = "data") +``` + +**NB:** In this vignette, we use a subset of the PUMP data, not the whole dataset. + + + +## `select_columns()` + +Add an illustration of `select_columns()` + +[...] + + + +## `select_taxonomy()` + +Add an illustration of `select_taxonomy()` + +[...] + + + +## `filter_by_species()` + +Add an illustration of `filter_by_species()` + +[...] + + + +## `filter_by_month()` + +Add an illustration of `filter_by_month()` + +[...] + + + +## `filter_by_year()` + +Add an illustration of `filter_by_year()` + +[...] + + + +## `filter_by_bbox()` + +Add an illustration of `filter_by_bbox()` + +[...] + + + +## `filter_by_ocean()` + +Add an illustration of `filter_by_ocean()` + +[...] + + + +## `filter_by_polygon()` + +Add an illustration of `filter_by_polygon()` + +[...]