Skip to contents

Extracts the `afurextent.asc` raster file from the package's `inst/extdata` directory to a specified destination.

Usage

extract_afurextent(
  dest_dir = here::here("01_data", "1b_rasters", "urban_extent"),
  overwrite = FALSE
)

Arguments

dest_dir

A character string specifying the directory to save the extracted raster file.

overwrite

Logical. Whether to overwrite an existing file in the destination directory. Default is FALSE.

Value

A character string representing the full path to the extracted raster file.

Details

This function extracts the `afurextent.asc` file from the package's `extdata` directory, where it is stored as a compressed `.zip` file. It requires the `raster` package to load the raster file.

Examples

# \donttest{
 extract_afurextent(tempdir(), overwrite = TRUE)
#>  Extracting raster file to /tmp/RtmphueFwD...
#> Warning: cannot remove file '/tmp/RtmphueFwD/__MACOSX', reason 'Directory not empty'
#> Warning: cannot remove file '/tmp/RtmphueFwD/bslib-2ce9eb5d8d7866b4f2d82a9ef19eb08f', reason 'Directory not empty'
#> Warning: cannot remove file '/tmp/RtmphueFwD/downlit', reason 'Directory not empty'
#> Warning: cannot remove file '/tmp/RtmphueFwD/test_env', reason 'Directory not empty'
#>  Raster file successfully extracted to: /tmp/RtmphueFwD/afurextent.asc
#> [1] "/tmp/RtmphueFwD/afurextent.asc"
# }