Skip to contents

A small set of external files included with cosTapered for examples, manual development checks, and simulation tests.

Details

The files are installed under extdata and can be located with system.file("extdata", ..., package = "cosTapered"). They include:

  • example_chm.tif: canopy height raster used as a fine-support covariate.

  • example_B.gpkg: observed-support polygons with simulated response y_B and simulated latent truth columns.

  • example_U.gpkg: areal prediction polygons.

  • example_forest.gpkg: forest boundary for plotting.

  • example_truth.rds: known simulation parameter values.

The example data are a small subset of a larger dataset. The canopy height model data were collected by Arthur Spitta arthur.spitta@students.boku.ac.at. The subset was prepared for package examples and tests.

The observed responses in example_B.gpkg were generated with cos_simulate_data using the included canopy-height raster, forest boundary, and known parameter values stored in example_truth.rds.

Author

Canopy height model data collected by Arthur Spitta arthur.spitta@students.boku.ac.at.

References

Zhang, L., Finley, A. O., Nothdurft, A., and Banerjee, S. (2024). Bayesian modeling of incompatible spatial data: A case study involving Post-Adrian storm forest damage assessment. International Journal of Applied Earth Observation and Geoinformation, 135, 104224. doi:10.1016/j.jag.2024.104224

Examples

chm_file <- system.file("extdata", "example_chm.tif", package = "cosTapered")
B_file <- system.file("extdata", "example_B.gpkg", package = "cosTapered")
truth_file <- system.file("extdata", "example_truth.rds", package = "cosTapered")

file.exists(chm_file)
#> [1] TRUE
file.exists(B_file)
#> [1] TRUE
readRDS(truth_file)
#> $beta_true
#> intercept       chm 
#>     45.00      1.25 
#> 
#> $tau_B_sq_true
#> [1] 8
#> 
#> $tau_sq_true
#> [1] 672.9198
#> 
#> $d_h_bar
#> [1] 0.01188849
#> 
#> $sigma_sq_true
#> [1] 35
#> 
#> $eff_range_true
#> [1] 250
#> 
#> $phi_true
#> [1] 0.012
#> 
#> $gamma
#> [1] 350
#> 
#> $taper_code
#> [1] 1
#> 
#> $plot_radius_m
#> [1] 15
#> 
#> $n_plot_target
#> [1] 36
#> 
#> $n_boundary_clipped
#> [1] 0
#> 
#> $design_seed
#> [1] 1
#> 
#> $sim_seed
#> [1] 1
#> 
#> $seed
#> [1] 1
#> 
#> $n_B
#> [1] 36
#> 
#> $n_A
#> [1] 3584
#> 
#> $row_sum_summary
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>       1       1       1       1       1       1 
#> 
#> $plot_spacing_m
#> [1] 125
#> 
#> $n_U
#> [1] 49
#> 

if (FALSE) { # \dontrun{
library(sf)
library(raster)
library(ggplot2)

chm <- raster(chm_file)
names(chm) <- "chm"

B_sf <- st_read(B_file, quiet = TRUE)
U_sf <- st_read(system.file("extdata", "example_U.gpkg",
                            package = "cosTapered"), quiet = TRUE)
forest_sf <- st_read(system.file("extdata", "example_forest.gpkg",
                                 package = "cosTapered"), quiet = TRUE)

chm_df <- as.data.frame(chm, xy = TRUE, na.rm = TRUE)
names(chm_df) <- c("x", "y", "chm")
tile_width <- xres(chm)
tile_height <- yres(chm)

ggplot() +
  geom_tile(data = chm_df, aes(x = x, y = y, fill = chm),
            width = tile_width, height = tile_height) +
  geom_sf(data = U_sf, fill = NA, color = "white", linewidth = 0.25) +
  geom_sf(data = forest_sf, fill = NA, color = "black", linewidth = 0.6) +
  geom_sf(data = B_sf, fill = NA, color = "#c1121f", linewidth = 0.45) +
  scale_fill_viridis_c(option = "cividis") +
  coord_sf(expand = FALSE) +
  labs(title = "Example supports", fill = "CHM", x = NULL, y = NULL) +
  theme_bw()

ggplot() +
  geom_sf(data = forest_sf, fill = "grey95", color = "grey55",
          linewidth = 0.4) +
  geom_sf(data = B_sf, aes(fill = y_B), color = "black", linewidth = 0.25) +
  scale_fill_viridis_c(option = "magma") +
  coord_sf(expand = FALSE) +
  labs(title = "Simulated observed response", fill = "y_B",
       x = NULL, y = NULL) +
  theme_bw()
} # }