View source: R/create_init_csv.r
create_init_csv | R Documentation |
init.csv
The create_init_csv()
function generates a CSV file with information
on each silo's start times, end times, and treatment times.
If parameters are left empty, generates a blank CSV with only the headers.
create_init_csv(
silo_names = character(),
start_times = character(),
end_times = character(),
treatment_times = character(),
covariates = character(),
filename = "init.csv",
filepath = tempdir()
)
silo_names |
A character vector of silo names. |
start_times |
A character vector of start times. |
end_times |
A character vector of end times. |
treatment_times |
A character vector of treatment times. |
covariates |
A character vector of covariates, or, |
filename |
A character filename for the created initializing CSV file.
Defaults to |
filepath |
Filepath to save the CSV file. Defaults to |
Ensure dates are entered consistently in the same date format.
Call undid_date_formats()
to view valid date formats. Control silos
should be marked as "control"
in the treatment_times
vector. If
covariates
is FALSE
, no covariate column will be included in the CSV.
A data frame containing the contents written to the CSV file.
The CSV file is saved in the specified directory (or in a temporary
directory by default) with the default filename init.csv
.
create_init_csv(
silo_names = c("73", "46", "54", "23", "86", "32",
"71", "58", "64", "59", "85", "57"),
start_times = "1989",
end_times = "2000",
treatment_times = c(rep("control", 6),
"1991", "1993", "1996", "1997", "1997", "1998"),
covariates = c("asian", "black", "male")
)
unlink(file.path(tempdir(), "init.csv"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.