crunch
Even harder with…
How do we design interfaces that work for these different audiences?
crunch
packageIdiomatic R interface to cloud service
https://github.com/Crunch-io/rcrunch/
install.packages("crunch")
devtools::install_github("Crunch-io/rcrunch/pkg")
crunch
packageFocus on interface by test-driving
with(test.authentication, {
with(test.dataset(df), {
try(ds$v3a <- ds$v3 + 5)
test_that("A derived variable is created on the server", {
expect_true("v3a" %in% names(allVariables(refresh(ds))))
})
...
})
})
Focus on interface by test-driving
setup.and.teardown <- function (setup, teardown, obj.name=".setup") {
structure(list(setup=setup, teardown=teardown, obj.name=obj.name),
class="SUTD")
}
with.SUTD <- function (data, expr, ...) {
env <- parent.frame()
on.exit(data$teardown())
assign(data$obj.name, data$setup(), envir=env)
try(eval(substitute(expr), envir=parent.frame()))
}
test.authentication <- setup.and.teardown(
function () suppressMessages(login()),
logout)