export_aggregated_data {daiquiri} | R Documentation |
Export aggregated data
Description
Export aggregated data to disk. Creates a separate file for each aggregated field in dataset.
Usage
export_aggregated_data(
aggregated_data,
save_directory,
save_file_prefix = "",
save_file_type = "csv"
)
Arguments
aggregated_data |
A |
save_directory |
String. Full or relative path for save folder |
save_file_prefix |
String. Optional prefix for the exported filenames |
save_file_type |
String. Filetype extension supported by |
Value
(invisibly) The daiquiri_aggregated_data
object that was passed in
Examples
raw_data <- read_data(
system.file("extdata", "example_prescriptions.csv", package = "daiquiri"),
delim = ",",
col_names = TRUE
)
source_data <- prepare_data(
raw_data,
field_types = field_types(
PrescriptionID = ft_uniqueidentifier(),
PrescriptionDate = ft_timepoint(),
AdmissionDate = ft_datetime(includes_time = FALSE),
Drug = ft_freetext(),
Dose = ft_numeric(),
DoseUnit = ft_categorical(),
PatientID = ft_ignore(),
Location = ft_categorical(aggregate_by_each_category = TRUE)
),
override_column_names = FALSE,
na = c("", "NULL")
)
aggregated_data <- aggregate_data(
source_data,
aggregation_timeunit = "day"
)
export_aggregated_data(
aggregated_data,
save_directory = ".",
save_file_prefix = "ex_"
)
[Package daiquiri version 1.1.1 Index]