Skip to content

Commit

Permalink
updating wording + output_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
adelegem committed Nov 25, 2024
1 parent ab4bbc7 commit 36f7b1a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion R/create_masked_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#think about how you can make this more general for users - e.g. it requires the plot id to
# be in the file name currently - think about usability
create_masked_raster <- function(input,
output_dir,
output_dir = tempdir(),
ndvi_threshold = NULL,
nir_threshold = NULL,
ndvi_threshold_df = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/create_multiband_image.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

create_multiband_image <- function(input_dir,
desired_band_order,
output_dir,
output_dir = tempdir(),
make_plot = FALSE,
return_raster = FALSE) {
# folder list | recursive = won't pick folders within folders
Expand Down
14 changes: 6 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ library(saltbush)
[![Codecov test coverage](https://codecov.io/gh/traitecoevo/saltbush/graph/badge.svg)](https://app.codecov.io/gh/traitecoevo/saltbush)
<!-- badges: end -->

# saltbush <img src="man/figures/saltbush_hex.png" align="right" width="220"/>
# saltbush <img src="man/figures/saltbush_hex.png" align="right" width="200"/>

*saltbush* processes drone imagery to calculate spectral diversity values as part of the assessment of the 'spectral variability hypothesis' or the 'spectral-biodiversity relationship'. This was specifically implemented to connect *from-the-sky* diversity with *on-the-ground* diversity as measured in the AusPlots project. There are also functions to calculate on-the-ground diversity built on the [ausplotsR](https://github.com/ternaustralia/ausplotsR) and [vegan](https://github.com/vegandevs/vegan) packages. The statistical methods for connecting diversity sampled on the ground to diversity sampled from the sky are still developing. This package is aimed at making from-the-sky diversity methods development easier for researchers across the world.

Expand All @@ -40,7 +40,7 @@ Specifically we have used this package in a test in the Australian arid zone. T

1. **Direct the package to the input files** in this case we use a drone image from Fowlers Gap, NSW, Australia

the example data in this case is 5 bands sampled from a drone
The example data in this case is 5 bands sampled from a drone
```{r, message=FALSE, results='hide'}
create_multiband_image("inst/extdata/create_multiband_image/",
c('blue', 'green', 'red', 'red_edge', 'nir'),
Expand All @@ -49,7 +49,7 @@ create_multiband_image("inst/extdata/create_multiband_image/",
```


this can be combined with an area of interest mask:
The resulting multiband image can be combined with an area of interest shapefile:

```{r}
Expand Down Expand Up @@ -77,8 +77,7 @@ head(pixel_values)
```{r}
metrics <- calculate_spectral_metrics(pixel_values,
masked = F,
wavelengths = colnames(pixel_values[, 2:6]),
masked = F,
rarefaction = F)
head(metrics)
Expand All @@ -89,7 +88,7 @@ head(metrics)
+ spectral variance (SV)
+ convex hull volume (CHV)

For a full discussion of this metrics see the manuscript
For a full discussion of these metrics see the manuscript

4. **Download plot data** from AusPlots. The `veg.PI` part extracts the point intercept data from the AusPlots data structure. In this case we use the same AusplotID as in the drone images above. This gets us data for two on-the-ground sampling visits to one particular AusPlot where we happen to have drone imagery.

Expand All @@ -99,7 +98,6 @@ my.data$site.info$visit_date
```



5. **Calculate on-the-ground diversity** from the point intercepts using different diversity metrics. The output is a list which includes taxonomic metrics, and also community matrices for checks. Not that this takes the `PI` part of the AusPlot object which stands for point-intercept. For a general function to calculate on-the-ground diversity, see [the diversity function from the vegan package](https://rdrr.io/cran/vegan/man/diversity.html).

```{r}
Expand All @@ -109,7 +107,7 @@ field_diversity$taxonomic_diversity

2012 was wetter than 2016 and there are a number of rain ephemeral species at this site so the higher species richness makes sense.

the calculated diversity metrics are:
The calculated taxonomic diversity metrics are:

+ species richness
+ shannon's diversity index
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
coverage](https://codecov.io/gh/traitecoevo/saltbush/graph/badge.svg)](https://app.codecov.io/gh/traitecoevo/saltbush)
<!-- badges: end -->

# saltbush <img src="man/figures/saltbush_hex.png" align="right" width="220"/>
# saltbush <img src="man/figures/saltbush_hex.png" align="right" width="200"/>

*saltbush* processes drone imagery to calculate spectral diversity
values as part of the assessment of the ‘spectral variability
Expand Down Expand Up @@ -40,7 +40,7 @@ once that’s posted.*
1. **Direct the package to the input files** in this case we use a
drone image from Fowlers Gap, NSW, Australia

the example data in this case is 5 bands sampled from a drone
The example data in this case is 5 bands sampled from a drone

``` r
create_multiband_image("inst/extdata/create_multiband_image/",
Expand All @@ -51,7 +51,8 @@ create_multiband_image("inst/extdata/create_multiband_image/",

<img src="man/figures/README-unnamed-chunk-2-1.png" width="90%" />

this can be combined with an area of interest mask:
The resulting multiband image can be combined with an area of interest
shapefile:

``` r

Expand Down Expand Up @@ -98,7 +99,7 @@ head(metrics)
- spectral variance (SV)
- convex hull volume (CHV)

For a full discussion of this metrics see the manuscript
For a full discussion of these metrics see the manuscript

4. **Download plot data** from AusPlots. The `veg.PI` part extracts the
point intercept data from the AusPlots data structure. In this case
Expand Down Expand Up @@ -134,7 +135,7 @@ field_diversity$taxonomic_diversity
2012 was wetter than 2016 and there are a number of rain ephemeral
species at this site so the higher species richness makes sense.

the calculated diversity metrics are:
The calculated taxonomic diversity metrics are:

- species richness
- shannon’s diversity index
Expand Down
2 changes: 1 addition & 1 deletion man/create_masked_raster.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/create_multiband_image.Rd

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

Binary file modified man/figures/README-unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 36f7b1a

Please sign in to comment.