context("basic extract")
library(testthat)
library(raadtools)
data(aurora)
aurora$DATE_TIME_UTC <- aurora$DATE_TIME_UTC - 720 * 24 * 3600
test_that("we get values", {
# expect_that(extract(readchla, aurora), is_a("numeric"))
#expect_equivalent(extract(readssh, aurora[c(1, 5, 10, 15), ]),
# c( 0.5424, 0.4929, -0.6060, -1.2465))
## warning about tzone
expect_that(extract(readwind, aurora[c(1, 5, 10, 15), ], magonly = TRUE), is_a("numeric"))
##expect_that(extract(readprod, aurora), is_a("numeric"))
})
d <- structure(list(X1 = c(-21.6151966875637, -21.6151966875637, -21.6151966875637,
-21.6151966875637, -21.6151966875637, -21.6151966875637, -21.6151966875637,
-21.6151966875637, -21.6151966875637, -21.6151966875637, -21.6151966875637,
-21.6151966875637, -21.6151966875637, -21.6151966875637, -21.6151966875637,
-21.6151966875637, -21.6151966875637, -21.6151966875637, -21.6151966875637,
-21.6151966875637), X2 = c(-66.0024725626897, -66.0024725626897,
-66.0024725626897, -66.0024725626897, -66.0024725626897, -66.0024725626897,
-66.0024725626897, -66.0024725626897, -66.0024725626897, -66.0024725626897,
-66.0024725626897, -66.0024725626897, -66.0024725626897, -66.0024725626897,
-66.0024725626897, -66.0024725626897, -66.0024725626897, -66.0024725626897,
-66.0024725626897, -66.0024725626897), dts = structure(c(278208000,
336186947.368421, 394165894.736842, 452144842.105263, 510123789.473684,
568102736.842105, 626081684.210526, 684060631.578947, 742039578.947369,
800018526.315789, 857997473.684211, 915976421.052632, 973955368.421053,
1031934315.78947, 1089913263.15789, 1147892210.52632, 1205871157.89474,
1263850105.26316, 1321829052.63158, 1379808000), class = c("POSIXct",
"POSIXt"))), .Names = c("X1", "X2", "dts"), row.names = c(NA,
-20L), class = "data.frame")
test_that("another example works", {
expect_that(extract(readwind, d, magonly = TRUE), is_a("numeric"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.