tests/testthat/test-table_addLocation.R

context("table_addLocation")

test_that("table_addLocation() works", {
  skip_on_cran()
  skip_on_travis()
  
  initializeMazamaSpatialUtils()
  locationTbl <- get(data("wa_monitors_500"))
  # Add a new record
  testTbl <- table_addLocation(locationTbl, -111.111, 44.444, 500, verbose = FALSE)
  expect_equal(nrow(locationTbl) + 1, nrow(testTbl))
  
  # Don't add it a second time
  testTbl <- table_addLocation(testTbl, -111.111, 44.444, 500, verbose = FALSE)
  expect_equal(nrow(locationTbl) + 1, nrow(testTbl))
})

Try the MazamaLocationUtils package in your browser

Any scripts or data that you put into this service are public.

MazamaLocationUtils documentation built on Sept. 11, 2024, 9:08 p.m.