diff --git a/vignettes/data-conversion.Rmd b/vignettes/data-conversion.Rmd index 3e94ff8..0f4d0e4 100644 --- a/vignettes/data-conversion.Rmd +++ b/vignettes/data-conversion.Rmd @@ -33,18 +33,18 @@ The FORCIS database includes counts of foraminifera species collected with multi ## Conversion functions -The functions detailed in this vignette allow to convert counts between the following formats **Raw abundance**, **Relative abundance** and **Number concentration**. +The functions detailed in this vignette allow users to convert counts between the following formats **Raw abundance**, **Relative abundance** and **Number concentration**. > **NOTE:** FORCIS data from *Sediment traps* and the *CPR North* are not supported by these functions. -First, let's import the required package. +First, let's attach the required package. ```{r setup} library(forcis) ``` -Before going any further, we will download the latest version of the FORCIS database. +Before proceeding, let's download the latest version of the FORCIS database. ```{r 'download-db', eval=FALSE} # Create a data/ folder ---- @@ -54,7 +54,7 @@ dir.create("data") download_forcis_db(path = "data", version = NULL) ``` -The vignette will use the plankton nets data of the FORCIS database. Let's import the latest release of the data. +The vignette will use the plankton net 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_net_sample.csv"), package = "forcis") @@ -66,7 +66,7 @@ net_data <- read.table(file_name, dec = ".", sep = ";") net_data <- read_plankton_nets_data(path = "data") ``` -**NB:** In this vignette, we use a subset of the plankton nets data, not the whole dataset. +**NB:** In this vignette, we use a subset of the plankton net data, not the whole dataset. After importing the data, the initial step involves choosing the taxonomic level for the analyses, (the different taxonomic levels are described in this [data paper](https://www.nature.com/articles/s41597-023-02264-2)). @@ -78,7 +78,7 @@ Let's use the function `select_taxonomy()` to select the **VT** taxonomy (valida net_data <- select_taxonomy(net_data, taxonomy = "VT") ``` -Once the data contains counts from the same taxonomic level, we can proceed with the conversion functions: `compute_*()`. +Once the data contain counts from the same taxonomic level, we can proceed with the conversion functions: `compute_*()`. The functions accept two arguments: the input `data` and the `aggregate` arguments. If `aggregate = TRUE`, the function will return the transformed counts of each species using the sample as the unit. If `aggregate = FALSE`, it will re-calculate the species' abundance by subsample. diff --git a/vignettes/data-visualization.Rmd b/vignettes/data-visualization.Rmd index 89fc2bb..ae1b41c 100644 --- a/vignettes/data-visualization.Rmd +++ b/vignettes/data-visualization.Rmd @@ -21,7 +21,7 @@ knitr::opts_chunk$set( ) ``` -The package `forcis` provides [a lot of functions](https://frbcesab.github.io/forcis/reference/index.html#visualization-tools) to visualize FORCIS data. This vignette shows how to use and customize these functions. +The package `forcis` provides [numerous functions](https://frbcesab.github.io/forcis/reference/index.html#visualization-tools) to visualize FORCIS data. This vignette shows how to use and customize these functions. ## Setup @@ -33,7 +33,7 @@ library(forcis) library(ggplot2) ``` -Before going any further, we will download the latest version of the FORCIS database. +Before proceeding, let's download the latest version of the FORCIS database. ```{r 'download-db', eval=FALSE} # Create a data/ folder ---- @@ -43,7 +43,7 @@ dir.create("data") download_forcis_db(path = "data", version = NULL) ``` -The vignette will use the plankton nets data of the FORCIS database. Let's import the latest release of the data. +The vignette will use the plankton net 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_net_sample.csv"), package = "forcis") @@ -55,7 +55,7 @@ net_data <- read.table(file_name, dec = ".", sep = ";") net_data <- read_plankton_nets_data(path = "data") ``` -**NB:** In this vignette, we use a subset of the plankton nets data, not the whole dataset. +**NB:** In this vignette, we use a subset of the plankton net data, not the whole dataset. ## `geom_basemap()` diff --git a/vignettes/database-versions.Rmd b/vignettes/database-versions.Rmd index 5ce11c7..b4e82b7 100644 --- a/vignettes/database-versions.Rmd +++ b/vignettes/database-versions.Rmd @@ -21,13 +21,13 @@ The [FORCIS database](https://zenodo.org/doi/10.5281/zenodo.7390791) is regularl ## Using the latest version -The package `forcis` is designed to handle the versioning of the database on Zenodo and will inform the user if a new version is available each time he/she uses one of the `read_*_data()` functions. The following message will be displayed: +The package `forcis` is designed to handle the versioning of the database on Zenodo and will inform users if a new version is available each time they use one of the `read_*_data()` functions. The following message will be displayed: ``` A newer version of the FORCIS database is available. Use 'download_forcis_db(version = NULL)' to download it. ``` -As mentioned in this message, the decision to download and use the latest version of the database is left to the user. +As mentioned in this message, users can choose whether to download the latest version of the database. A **good practice** to ensure that the user works with the latest version of the database might be to add this line at the beginning of the script: @@ -35,12 +35,12 @@ A **good practice** to ensure that the user works with the latest version of the download_forcis_db(version = NULL, ...) ``` -Note that the FORCIS database is saved in `forcis-db/version-99/`, where `99` is the label of the version. If you regularly download the new versions, the content of the folder `forcis-db/` can increase with time and it can be interesting to manually delete the folder of the previous versions. +Note that the FORCIS database is saved in `forcis-db/version-99/`, where `99` is the label of the version. If you regularly download the new versions, the content of the folder `forcis-db/` may grow over time and it can be interesting to manually delete the folder of the previous versions. ## Using a specific version -If for some reasons the user wants to freeze the version he/she uses, it is possible to disable this message by setting the argument `check_for_update` to `FALSE` in the `read_*_data()` functions. +If for some reason users want to freeze the version they use, it is possible to disable this message by setting the argument `check_for_update` to `FALSE` in the `read_*_data()` functions. It is also possible to disable this message globally for the current session: @@ -48,13 +48,13 @@ It is also possible to disable this message globally for the current session: options(check_for_update = FALSE) ``` -The package `forcis` _"knows"_ which version of the database you used last time. A hidden file `.forcis` is created/updated each time the function `download_forcis_db()` or `read_*_data()` is called. This hidden file contains one line: +The package `forcis` _"knows"_ which version of the database you used last time. A hidden file named `.forcis` is created (or updated) each time the function `download_forcis_db()` or `read_*_data()` is called. This hidden file contains one line: ``` FORCIS_VERSION=99 ``` -Note that this hidden file is used by some functions of the `forcis` package. User doesn't have to edit it by hand. +Note that this hidden file is used by some functions of the `forcis` package. Users don't need to edit it manually. If you want to be sure to use a specific version of the database, you can use the argument `version` of the `read_*_data()` functions, or use the following line: diff --git a/vignettes/select-and-filter-data.Rmd b/vignettes/select-and-filter-data.Rmd index 53ecd38..a8e5be9 100644 --- a/vignettes/select-and-filter-data.Rmd +++ b/vignettes/select-and-filter-data.Rmd @@ -30,7 +30,7 @@ First, let's import the required packages. library(forcis) ``` -Before going any further, we will download the latest version of the FORCIS database. +Before proceeding, let's download the latest version of the FORCIS database. ```{r 'download-db', eval=FALSE} # Create a data/ folder ---- @@ -71,7 +71,7 @@ net_data <- select_taxonomy(net_data, taxonomy = "VT") ## `select_columns()` -Because FORCIS data contains more than 100 columns, the function `select_columns()` can be used to lighten the `data.frame` to easily handle it and to speed up some computations. +Because FORCIS data contain more than 100 columns, the function `select_columns()` can be used to lighten the `data.frame` to easily handle it and to speed up some computations. By default, only required columns listed in `get_required_columns()` and species columns will be kept. @@ -134,7 +134,7 @@ nrow(net_data) nrow(net_data_bbox) ``` -Note that the argument `bbox` can be an object of class `bbox` (package `sf`) or a vector of four numeric values defining a square bounding box. If a vector of numeric values is provided, coordinates must be defined in the system WGS 84 (`epsg=4326`). +Note that the argument `bbox` can be either an object of class `bbox` (package `sf`) or a vector of four numeric values defining a square bounding box. If a vector of numeric values is provided, coordinates must be defined in the system WGS 84 (`epsg=4326`). @@ -189,7 +189,7 @@ nrow(net_data_poly) ## `filter_by_species()` -The function `filter_by_species()` allows to filter FORCIS data for one or more species. +The `filter_by_species()` function allows users to filter FORCIS data for one or more species. It takes a `data.frame` and a vector of species names (argument `species`). @@ -211,7 +211,7 @@ dim(glutinata_nitida) ## `reshape_data()` -The function `reshape_data()` converts FORCIS data into a long format. +The `reshape_data()` function converts FORCIS data into a long format. ```{r 'reshape-data'} # Convert to long format ----