Nothing
context("Function .checkColumns")
sapply(studyPathS, function(studyPath){
opts <- setSimulationPath(studyPath)
dataList <- readAntares(areas="all", links = "all", timeStep = "annual",
select = c("LOAD", "CONG. FEE (ABS.)"), showProgress = FALSE)
dataTbl <- readAntares(areas="all", timeStep = "annual",
select = "LOAD", showProgress = FALSE)
test_that("It stops if 'x' is not an antares data object", {
expect_error(.checkColumns(1:10, "LOAD"), "antaresData")
})
test_that("It stops if some column is missing", {
expect_error(
.checkColumns(dataList, list(areas = "NUCLEAR", links = "CONG. FEE (ABS.)")),
"NUCLEAR"
)
})
test_that("It returns the original object if all columns are present", {
data2 <- .checkColumns(dataList, list(areas = "LOAD", links = "CONG. FEE (ABS.)"))
expect_identical(dataList, data2)
})
test_that("It also works with antaresDataTable objects", {
data2 <- .checkColumns(dataTbl, list(areas = "LOAD"))
expect_identical(dataTbl, data2$area)
expect_is(data2, "antaresDataList")
expect_true(names(data2) == "areas")
})
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.