Skip to content

Commit 5df708b

Browse files
committed
possible new structure for readme
1 parent 57b67fa commit 5df708b

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

README.Rmd

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ library(saltbush)
3838

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

41+
the example data in this case is 5 bands sampled from a drone
42+
```{r, message=FALSE}
43+
create_multiband_image("inst/extdata/create_multiband_image/",c('blue', 'green', 'red', 'red_edge', 'nir'), output_dir=tempdir(),make_plot = TRUE,return_raster = TRUE)
44+
```
45+
46+
47+
this can be combined with an area of interest mask:
48+
4149
```{r}
4250
4351
raster_files <- list.files("inst/extdata/example",
@@ -46,6 +54,7 @@ raster_files <- list.files("inst/extdata/example",
4654
aoi_files <- list.files("inst/extdata/aoi",
4755
pattern = 'NSABHC0009_aoi.shp$', full.names = TRUE)
4856
57+
4958
```
5059

5160
2. **Extract pixel values** from the area of interest in the image
@@ -62,7 +71,10 @@ head(pixel_values)
6271
3. **Calculate spectral metrics**
6372
```{r}
6473
65-
metrics <- calculate_spectral_metrics(pixel_values, masked = F, wavelengths = colnames(pixel_values[, 2:6]), rarefaction = F)
74+
metrics <- calculate_spectral_metrics(pixel_values,
75+
masked = F,
76+
wavelengths = colnames(pixel_values[, 2:6]),
77+
rarefaction = F)
6678
6779
head(metrics)
6880

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,29 @@ calculate spectral + taxonomic diversity values for assessment of the
2626
1. **Direct the package to the input files** in this case we use a
2727
drone image from Fowlers Gap, NSW, Australia
2828

29+
the example data in this case is 5 bands sampled from a drone
30+
31+
``` r
32+
create_multiband_image("inst/extdata/create_multiband_image/",c('blue', 'green', 'red', 'red_edge', 'nir'), output_dir=tempdir(),make_plot = TRUE,return_raster = TRUE)
33+
```
34+
35+
<img src="man/figures/README-unnamed-chunk-2-1.png" width="100%" />
36+
37+
#> class : SpatRaster
38+
#> dimensions : 1466, 1466, 5 (nrow, ncol, nlyr)
39+
#> resolution : 0.01519, 0.01519 (x, y)
40+
#> extent : 566521.2, 566543.5, 6561293, 6561316 (xmin, xmax, ymin, ymax)
41+
#> coord. ref. : WGS 84 / UTM zone 54S (EPSG:32754)
42+
#> sources : blue.tif
43+
#> green.tif
44+
#> red_edge.tif
45+
#> ... and 2 more source(s)
46+
#> names : blue, green, red, red_edge, nir
47+
#> min values : 0.01265331, 0.01101853, 0.01276734, 0.01221969, 0.01856168
48+
#> max values : 0.23392145, 0.20722562, 0.22469597, 0.17767203, 0.21024320
49+
50+
this can be combined with an area of interest mask:
51+
2952
``` r
3053

3154
raster_files <- list.files("inst/extdata/example",
@@ -56,7 +79,10 @@ head(pixel_values)
5679

5780
``` r
5881

59-
metrics <- calculate_spectral_metrics(pixel_values, masked = F, wavelengths = colnames(pixel_values[, 2:6]), rarefaction = F)
82+
metrics <- calculate_spectral_metrics(pixel_values,
83+
masked = F,
84+
wavelengths = colnames(pixel_values[, 2:6]),
85+
rarefaction = F)
6086

6187
head(metrics)
6288
#> site aoi_id CV SV CHV image_type
369 KB
Loading

0 commit comments

Comments
 (0)