context("dbWriteTable")
test_that("options work", {
if (!mysqlHasDefault()) skip("Test database not available")
con <- dbConnect(MySQL(), dbname = "test")
on.exit(dbDisconnect(con))
expected <- data.frame(
a = c(1:3, NA),
b = c("x", "y", "z", "E"),
stringsAsFactors = FALSE
)
dbWriteTable(con, "dat", "dat-n.bin", sep="|", eol="\n", overwrite = TRUE)
expect_equal(dbReadTable(con, "dat"), expected)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.