Nothing
local_create_directory <- function(
site_url = NULL,
...,
env = parent.frame()
) {
# Generate test directory name
test_dir <- test_directory_name()
test_sharepoint <- suppressMessages(connector_sharepoint(site_url))
# Create test directory
test_sharepoint |>
create_directory_cnt(test_dir) |>
expect_no_error()
# Create connection to test directory
con <- ConnectorSharepoint$new(
site_url = test_sharepoint$site_url,
folder = test_dir,
...
)
withr::defer(
{
test_sharepoint$remove_cnt(test_dir, confirm = FALSE, by_item = TRUE)
rm(con)
},
envir = env
)
con
}
local_download_sharepoint_file <- function(
con = NULL,
file_name = NULL,
env = parent.frame()
) {
con |>
download_cnt(file_name, file_name, overwrite = TRUE)
withr::defer(unlink(file_name), envir = env)
file_name
}
test_directory_name <- function(prefix = "test_", length = 10) {
random_string <- paste0(
sample(c(letters, LETTERS, 0:9), length, replace = TRUE),
collapse = ""
)
paste0(prefix, random_string)
}
test_file_name <- function(prefix = "test_", suffix = ".csv", length = 10) {
random_string <- paste0(
sample(c(letters, LETTERS, 0:9), length, replace = TRUE),
collapse = ""
)
paste0(prefix, random_string, suffix)
}
# make iris a tbl
tbl_iris <- tibble::as_tibble(iris, rownames = NULL)
## remove factors, read and write not working with factors
tbl_iris$Species <- as.character(tbl_iris$Species)
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.