test_that("crops_equal_one", {
#fake dataset:
crop_test = sample(1:1, 500, replace = T)
dates = seq(from = 1920, to = 2010, by = 10)
locations = c("SB", "LA", "SF","SLO","SD")
ca_test <- matrix(crop_test, nrow = 10, ncol = 5,
dimnames = list(c(dates), c(locations)))
expect_that(calc_crop_harvest(ca_test, 2, 1)$harvests[1], equals(c('1920' = 1)))
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.