write_results: Write a data frame as a .xlsx, .xls, or .csv file

View source: R/write_results.R

write_resultsR Documentation

Write a data frame as a .xlsx, .xls, or .csv file

Description

Write a data frame to a directory with all numbers rounded to specified digits. Can write as .xls, .xlsx, or .csv file types. Writing as .xlsx or .xls uses the writexl package.

Usage

write_results(data, file_name, digits)

Arguments

data

Data frame to be written to a directory.

file_name

Character string naming the output file. Required.

digits

Integer indicating the number of decimal places or significant digits used to round flow values. Use follows that of base::round() digits argument.

Examples

## Not run: 

# Working examples:

# Example data to write
data_results <- calc_longterm_daily_stats(station_number = c("08HA002", "08HA011"),
                                          start_year = 1971, end_year = 2000)

# Write the data and round numbers to 1 decimal place
write_results(data = data_results, 
              file_name = "Cowichan River Long-term Flows (1971-2000).xlsx", 
              digits = 1)
              

## End(Not run)

fasstr documentation built on Sept. 30, 2024, 9:24 a.m.