Skip to content

Commit

Permalink
documenting cran corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbanSagouis committed Apr 1, 2024
1 parent 633bf2b commit 79116d7
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/install.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install.packages("dplyr","tidyr","ggplot2","maps","vegan","dggridR")
install.packages("formatR","spelling","codemetar")
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
YEAR: 2024
COPYRIGHT HOLDER: BioTIME
8 changes: 4 additions & 4 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "BioTIMEr",
"description": "The BioTIMEr package provides tools designed to interact with the 'BioTIME' database. The functions provided include the 'BioTIME' recommended methods for preparing ('gridding' and rarefaction) time series data, a selection of standard biodiversity metrics (including species richness, numerical abundance and exponential Shannon) alongside examples on how to display change over time. It also includes a sample subset of both the query and meta data, the full versions of which are freely available on the 'BioTIME' website <https://biotime.st-andrews.ac.uk/home.php>.",
"description": "The 'BioTIME' database was first published in 2018 and inspired ideas, questions, project and research article. To make it even more accessible, an R package was created. The 'BioTIMEr' package provides tools designed to interact with the 'BioTIME' database. The functions provided include the 'BioTIME' recommended methods for preparing ('gridding' and rarefaction) time series data, a selection of standard biodiversity metrics (including species richness, numerical abundance and exponential Shannon) alongside examples on how to display change over time. It also includes a sample subset of both the query and meta data, the full versions of which are freely available on the 'BioTIME' website <https://biotime.st-andrews.ac.uk/home.php>.",
"name": "BioTIMEr: Tools to Use and Explore the 'BioTIME' Database",
"codeRepository": "https://github.com/bioTIMEHub/BioTIMEr",
"issueTracker": "https://github.com/bioTIMEHub/BioTIMEr/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.2.0",
"version": "0.2.1",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"runtimePlatform": "R version 4.3.3 (2024-02-29)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -264,7 +264,7 @@
},
"SystemRequirements": null
},
"fileSize": "17926.392KB",
"fileSize": "8221.795KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
11 changes: 10 additions & 1 deletion man/BioTIME-palette.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 1 addition & 28 deletions man/BioTIME-plots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions man/getAlpha.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/getAlphaMetrics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions man/getBeta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/getBetaMetrics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/resampling.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vignettes/vignette1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ file.exists("data/BTsubset_data.RData")
- `getLinearRegressions ()`
5. Visualise the results.

Below is a detailed run through these different steps, breaking down some of the tasks and the reasoning behind our suggestions for best practice when analyzing BioTIME data.
Below is a detailed run through these different steps, breaking down some of the tasks and the reasoning behind our suggestions for best practice when analysing BioTIME data.


We use the ‘pipe’ operator `(%>%)` to make our code more efficient and streamlined, and we use ggplot2 library for most visualizations. This and other libraries required for BioTIMEr to run will be, if needed, installed at the same time BioTIMEr is installed.
Expand Down Expand Up @@ -219,7 +219,7 @@ grid_rare <- resampling(x = grid_samples, measure = "ABUNDANCE",
# grid_rare <- resampling( x= grid_samples_test, measure ="BIOMASS", resamps = 1L, conservative = FALSE)
```

The function returns a single long form data frame containing the total currency of interest (i.e. summed across all samples) for each species in each year within eachn assemblage time series. You can specify what the currency field is: Abundance, Biomass or both (BioTIME studies can include records for either or both). Note that resampling() also tests and removes any `NAs` within the selected currency field(s) before implementing the sample-based rarefaction. Thus, if you choose to use both currency fields, only observations (when `conservative = FALSE`) or full sampling events (when `conservative = TRUE`) in which BOTH Abundance and Biomass were recorded are retained and a warning is issued as follows:
The function returns a single long form data frame containing the total currency of interest (i.e. summed across all samples) for each species in each year within each assemblage time series. You can specify what the currency field is: Abundance, Biomass or both (BioTIME studies can include records for either or both). Note that resampling() also tests and removes any `NAs` within the selected currency field(s) before implementing the sample-based rarefaction. Thus, if you choose to use both currency fields, only observations (when `conservative = FALSE`) or full sampling events (when `conservative = TRUE`) in which BOTH Abundance and Biomass were recorded are retained and a warning is issued as follows:

```{r resampling_ex12, cache=TRUE, echo=TRUE, message=FALSE, tidy=TRUE, include=TRUE}
#Keep only observations with both abundance and biomass
Expand Down Expand Up @@ -314,7 +314,7 @@ beta_metrics %>% head(6) %>% kable()
# beta_metrics %>% head(6) %>% kable()
```

There are many metrics for measuring biodiversity in community ecology. Here, we focused on the more commonly used metrics when measuring temporal changes in biodiversity. getAlphaMetrics() estimates nine alpha diversity metrics: Species richness (`S`), numerical abundance (`N`), maximum numerical abundance (`maxN`), Shannon index, Simpson index, inverse Simpson, McNaughton dominance, probability of intraspecific encounter (`PIE`) and exponential Shannon. getBetaMetrics() estimates three beta diversity metrics: Jaccard dissimilarity, Bray-Curtis dissimilarity and Morisita-Horn dissimilarity, assuming the first year in the time series as the baseline. Note that `N` and `maxN` metrics return numerical abundance when `measure=ABUNDANCE`, and biomass values whem `measure=BIOMASS`.
There are many metrics for measuring biodiversity in community ecology. Here, we focused on the more commonly used metrics when measuring temporal changes in biodiversity. getAlphaMetrics() estimates nine alpha diversity metrics: Species richness (`S`), numerical abundance (`N`), maximum numerical abundance (`maxN`), Shannon index, Simpson index, inverse Simpson, McNaughton dominance, probability of intraspecific encounter (`PIE`) and exponential Shannon. getBetaMetrics() estimates three beta diversity metrics: Jaccard dissimilarity, Bray-Curtis dissimilarity and Morisita-Horn dissimilarity, assuming the first year in the time series as the baseline. Note that `N` and `maxN` metrics return numerical abundance when `measure=ABUNDANCE`, and biomass values when `measure=BIOMASS`.

### Investigating biodiversity trends
Finally, when looking to measure biodiversity change using temporal data, it is common to estimate temporal trends in alpha diversity and beta diversity by fitting a simple linear regression to the diversity estimates over the duration of the time series. The `getLinearRegressions()` function implements linear models as a function of year and is designed to run smoothly over an output of either the `getAlphaMetrics()` or `getBetaMetrics()` functions. Specifically, it provides the results of simple linear regressions (slope, p-value, significance, intercept) using lm(), and fit individually to the yearly diversity estimates of each metric within each assemblage time series in your dataset.
Expand Down Expand Up @@ -353,7 +353,7 @@ check6 <- alpha_slopes %>%
check6 %>% kable()
# We can see that only a few (<40) of the assemblage time series
# actually show a significant trend of change over time, independently of the metric used. This indicates that in most time series in the studies we analyzed alpha diversity is not really changing through time.
# actually show a significant trend of change over time, independently of the metric used. This indicates that in most time series in the studies we analysed alpha diversity is not really changing through time.
```

Expand Down

0 comments on commit 79116d7

Please sign in to comment.