wide2excel: Export Wide Data to Excel

Description Usage Arguments See Also Examples

View source: R/accessdb.R

Description

This function exports a wide format dataset to a column- (default) or row-oriented Excel format.

Usage

1
wide2excel(data, ..., transpose = FALSE, transpose.date.format = "%d/%m/%Y")

Arguments

data

a wide dataset from get_data or reshaped to a wide format with long2wide.

...

further arguments to write_xlsx. As a minimum a path needs to be supplied that ends with the name of the Excel file. See Examples.

transpose

logical. If TRUE, the result is returned in a row-oriented Excel format. The default is column oriented (same as the dataset in R).

transpose.date.format

argument passed to transpose_wide, setting the format of date columns when data is transposed.

See Also

transpose_wide, write_xlsx, ugatsdb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Getting macroeconomic indicators from Bank of Uganda in fiscal years
data <- get_data("BOU_MMI_FY", from = "2000/01")

# Saving to different Excel formats
wide2excel(data, "BOU_MMI_FY.xlsx")
wide2excel(data, "BOU_MMI_FY.xlsx", transpose = TRUE)

# Saving to alternative path
wide2excel(data, "C:/Users/.../BOU_MMI_FY.xlsx")

## End(Not run)

ugatsdb documentation built on Nov. 26, 2021, 1:06 a.m.