You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal is to give user the option to create a Quarto Based OTTR course with RStudio Project Templates.
The plan is to create a function in this repo, create_rstudio_project_template()
create_rstudio_project_template <- function(path, ...) {
# ensure path exists
dir.create(path, recursive = TRUE, showWarnings = FALSE)
# For each file in the ottr repo,
# Step 1. Collect inputs and paste together as 'Parameter: Value'
dots <- list(...)
text <- lapply(seq_along(dots), function(i) {
key <- names(dots)[[i]]
val <- dots[[i]]
paste0(key, ": ", val)
})
# Step 2. Collect into single text string
contents <- paste(
paste(header, collapse = "\n"),
paste(text, collapse = "\n"),
sep = "\n"
)
# Step 3. Write to file
writeLines(contents, con = file.path(path, "FILE_NAME_HERE"))
# Repeat Steps 1~3 for each file
}
This way, we can accept user inputs inside an GUI and automatically setup an OTTR repo without having the user open a config file and manually configure things.
The text was updated successfully, but these errors were encountered:
The goal is to give user the option to create a Quarto Based OTTR course with RStudio Project Templates.
The plan is to create a function in this repo,
create_rstudio_project_template()
This way, we can accept user inputs inside an GUI and automatically setup an OTTR repo without having the user open a config file and manually configure things.
The text was updated successfully, but these errors were encountered: