Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tgoodbody/sgsR
https://github.com/tgoodbody/sgsR
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tgoodbody/sgsR
- Owner: tgoodbody
- License: gpl-3.0
- Created: 2021-04-08T21:20:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-03T17:57:07.000Z (10 months ago)
- Last Synced: 2024-10-29T22:31:14.977Z (2 months ago)
- Language: R
- Homepage: https://tgoodbody.github.io/sgsR/
- Size: 1.14 GB
- Stars: 44
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
- open-sustainable-technology - sgsR - A structurally guided sampling toolbox for LiDAR-based forest inventories. (Biosphere / Forest Remote Sensing)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
```# sgsR - structurally guided sampling
![license](https://img.shields.io/badge/Licence-GPL--3-blue.svg)
[![R-CMD-check](https://github.com/tgoodbody/sgsR/workflows/R-CMD-check/badge.svg)](https://github.com/tgoodbody/sgsR/actions)
[![Codecov test coverage](https://codecov.io/gh/tgoodbody/sgsR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tgoodbody/sgsR?branch=main)
[![](https://cranlogs.r-pkg.org/badges/sgsR)](https://CRAN.R-project.org/package=sgsR)## Installation :computer: {.unnumbered}
Install the stable version of [`sgsR`from CRAN](https://cran.r-project.org/package=sgsR) with:
``` r
install.packages("sgsR")
library(sgsR)
```Install the most recent development version of [`sgsR` from Github](https://github.com/tgoodbody/sgsR) with:
``` r
install.packages("devtools")
devtools::install_github("https://github.com/tgoodbody/sgsR")
library(sgsR)
```
## Citing `sgsR` in literatureOpen access publication: [sgsR: a structurally guided sampling toolbox for LiDAR-based forest inventories](https://doi.org/10.1093/forestry/cpac055)
To cite `sgsR` use `citation()` from within R with:
```{r}
print(citation("sgsR"), bibtex = TRUE)
```## Overview
`sgsR` provides a collection of stratification and sampling algorithms that use auxiliary information for allocating sample units over an areal sampling frame. ALS metrics, like those derived from the [`lidR` package](https://cran.r-project.org/package=lidR) are the intended inputs.
Other remotely sensed or auxiliary data can also be used (e.g. optical satellite imagery, climate data, drone-based products).
`sgsR` is being actively developed, so you may encounter bugs. If that happens, [please report your issue here](https://github.com/tgoodbody/sgsR/issues) by providing a reproducible example.
## Example usage :bar_chart: {.unnumbered}
``` r
#--- Load mraster files ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")#--- load the mraster using the terra package ---#
mraster <- terra::rast(r)#--- apply quantiles algorithm to mraster ---#
sraster <- strat_quantiles(mraster = mraster$zq90, # use mraster as input for stratification
nStrata = 4) # produce 4 strata
#--- apply stratified sampling ---#
existing <- sample_strat(sraster = sraster, # use sraster as input for sampling
nSamp = 200, # request 200 samples
mindist = 100, # samples must be 100 m apart
plot = TRUE) # plot output```
## Resources & Vignettes :books: {.unnumbered}
Check out [the package documentation](https://tgoodbody.github.io/sgsR/index.html) to see how you can use `sgsR` functions for your work.
`sgsR` was presented at the ForestSAT 2022 Conference in Berlin. [Slides for the presentation can be found here.](https://tgoodbody.github.io/sgsR-ForestSAT2022/)
## Collaborators :woman: :man: {.unnumbered}
We are thankful for continued collaboration with academic, private industry, and government institutions to help improve `sgsR`. Special thanks to to:
```{r,echo=FALSE, results = 'asis'}
library(knitr)
names <- c("Martin Queinnec", "Joanne C. White", "Piotr Tompalski", "Andrew T. Hudak", "Ruben Valbuena", "Antoine LeBoeuf", "Ian Sinclair", "Grant McCartney", "Jean-Francois Prieur", "Murray Woods")aff <- c("University of British Columbia", "Canadian Forest Service", "Canadian Forest Service", "United States Forest Service", "Swedish University of Agricultural Sciences", "Ministère des Forêts, de la Faune et des Parcs", "Ministry of Northern Development, Mines, Natural Resources and Forestry", "Forsite Consultants Ltd.", "Université de Sherbrooke", " (Retired) Ministry of Northern Development, Mines, Natural Resources and Forestry")
urls <- c(
"https://www.researchgate.net/profile/Martin-Queinnec",
"https://scholar.google.ca/citations?user=bqjk4skAAAAJ&hl=en/",
"https://scholar.google.ca/citations?user=RtYdz0cAAAAJ&hl=en/",
"https://www.fs.usda.gov/research/about/people/ahudak/",
"https://scholar.google.com/citations?user=Nx336TQAAAAJ&hl=en/",
"https://scholar.google.com/citations?user=wGsKOK8AAAAJ&hl=en/",
"https://ca.linkedin.com/in/ian-sinclair-984929a4/",
"https://www.signalhire.com/profiles/grant-mccartney%27s-email/99719223/",
"https://www.researchgate.net/scientific-contributions/Jean-Francois-Prieur-2142960944",
"https://www.researchgate.net/profile/Murray-Woods"
)df <- data.frame(Collaborator = names, Affiliation = aff)
df$Collaborator <- paste0("[", df$Collaborator, "](", urls, ")")
kable(df)
```## Funding :raised_hands: {.unnumbered}
Development of `sgsR` was made possible thanks to the financial support of the Canadian Wood Fibre Centre's Forest Innovation Program.