tests/testthat/test-nearest_stations_ogimet.R

context("meteo_imgw")

test_that("nearest_stations_ogimet works!", {
  x <- nearest_stations_ogimet(country = "United+Kingdom", point = c(10, 50), add_map = FALSE, no_of_stations = 10)
  
  x <- nearest_stations_ogimet(country = "United+Kingdom", point = c(10, 50), add_map = TRUE, no_of_stations = 10)

  x <- nearest_stations_ogimet(country = "United+Kingdom", point = c(-10, -50), add_map = TRUE, no_of_stations = 10)
  
  x <- nearest_stations_ogimet(country = "Poland", point = c(10, 50), add_map = TRUE, no_of_stations = 10)
  
  # expected error
  testthat::expect_error(nearest_stations_ogimet(country = "Pland", point = c(10, 50), add_map = TRUE, no_of_stations = 10))
  
  x <- nearest_stations_ogimet(country = c("United+Kingdom", "Poland"), point = c(0, 0), add_map = TRUE, no_of_stations = 150)
  
})

Try the climate package in your browser

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

climate documentation built on Aug. 9, 2022, 5:08 p.m.