diff --git a/DESCRIPTION b/DESCRIPTION index 6ebff18..b9cb9dc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Description: Topotoolboxr provides an R interface to TopoToolbox, a set of tools Encoding: UTF-8 LazyData: true URL: https://github.com/TopoToolbox/topotoolboxr, https://github.com/TopoToolbox -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Suggests: testthat (>= 3.1.5) Config/testthat/edition: 3 diff --git a/R/data.R b/R/data.R new file mode 100644 index 0000000..54c010f --- /dev/null +++ b/R/data.R @@ -0,0 +1,19 @@ +#' Path to 30 m SRTM elevation data for Big Tujunga catchment +#' +#' Character string containing the file path to the 30 m resolution Shuttle Radar +#' Topography Mission (SRTM) elevation data TIFF file for the Big Tujunga +#' catchment in California, located in `inst/extdata/`. +#' +#' @format ## `srtm_bigtujunga30m_utm11` +#' A single length character string giving the full path to the GEOTIFF file: +#' \describe{ +#' \item{file}{Path to `srtm_bigtujunga30m_utm11.tif` (643 rows, 1197 columns, 1 layer, WGS 84 / UTM zone 11N EPSG:32611)} +#' } +#' @usage data(srtm_bigtujunga30m_utm11) +#' @examples +#' \dontrun{ +#' data(srtm_bigtujunga30m_utm11) +#' library(topotoolboxr) +#' GRIDobj(srtm_bigtujunga30m_utm11) +#' } +"srtm_bigtujunga30m_utm11" diff --git a/data/srtm_bigtujunga30m_utm11.rda b/data/srtm_bigtujunga30m_utm11.rda new file mode 100644 index 0000000..76b1af0 Binary files /dev/null and b/data/srtm_bigtujunga30m_utm11.rda differ diff --git a/inst/extdata/srtm_bigtujunga30m_utm11.tif b/inst/extdata/srtm_bigtujunga30m_utm11.tif new file mode 100644 index 0000000..baf6b50 Binary files /dev/null and b/inst/extdata/srtm_bigtujunga30m_utm11.tif differ diff --git a/man/srtm_bigtujunga30m_utm11.Rd b/man/srtm_bigtujunga30m_utm11.Rd new file mode 100644 index 0000000..b270a0c --- /dev/null +++ b/man/srtm_bigtujunga30m_utm11.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{srtm_bigtujunga30m_utm11} +\alias{srtm_bigtujunga30m_utm11} +\title{Path to 30 m SRTM elevation data for Big Tujunga catchment} +\format{ +## `srtm_bigtujunga30m_utm11` +A single length character string giving the full path to the GEOTIFF file: +\describe{ + \item{file}{Path to `srtm_bigtujunga30m_utm11.tif` (643 rows, 1197 columns, 1 layer, WGS 84 / UTM zone 11N EPSG:32611)} +} +} +\usage{ +data(srtm_bigtujunga30m_utm11) +} +\description{ +Character string containing the file path to the 30 m resolution Shuttle Radar +Topography Mission (SRTM) elevation data TIFF file for the Big Tujunga +catchment in California, located in `inst/extdata/`. +} +\examples{ +\dontrun{ +data(srtm_bigtujunga30m_utm11) +library(topotoolboxr) +GRIDobj(srtm_bigtujunga30m_utm11) +} +} +\keyword{datasets} diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R new file mode 100644 index 0000000..6cd6e89 --- /dev/null +++ b/tests/testthat/test-data.R @@ -0,0 +1,7 @@ +test_that("Checks if data path loads correctly", { + srtm_bigtujunga30m_utm11 <- system.file("extdata", + "srtm_bigtujunga30m_utm11.tif", + package = "topotoolboxr") + dem <- GRIDobj(srtm_bigtujunga30m_utm11) + expect_s3_class(dem, "GRIDobj") +}) \ No newline at end of file