library(rconf)
library(testthat)
context("setpwd")
rscript <- system.file("extdata", "somescript.R", package="rconf")
Rscript <- system("which Rscript", intern=TRUE)
test_that("test setpwd in an rscript", {
expect_equal(system2(Rscript, rscript, stdout=TRUE)[2], getwd())
expect_equal(system2(Rscript, rscript, stdout=TRUE)[4], dirname(rscript))
expect_equal(system2(Rscript, rscript, stdout=TRUE)[6], getwd())
expect_equal(system2(Rscript, rscript, stdout=TRUE)[8], dirname(rscript))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.