export_data: Export Data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ares.r

Description

Export datasets into different formats

Usage

1
export_data(data, file, text.format = "csv", ...)

Arguments

data

a matrix or data frame

file

quoted string with the file name

text.format

rules for text files

...

further options for write.table

Details

The function will try to select the proper filter based on the file extension. Valid file types are those supported by the package foreign. There are rules implemented for Stata up to version 9 (*.dta) and xBase files up to version 4 (*.dbf). Excel files (*.xls) are no longer supported. R binary files (*.rda) can also be written directly by the function.

Several text formats can be written by setting text.format or passing options through .... If none of the above proprietary formats extension is part of the file name, the function will save the data frame in ASCII text format disregarding the extension. Available options for text.format are "csv" for comma separated values, "tab" for columns separated by a tab character and "spc" for space separated columns and, also, its variants for comma as the decimal separator, "csv2", "tab2" and "spc2".

Value

This function does not return a value.

Author(s)

Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br

See Also

attach,search

Examples

1
2
data(admrio)
export_data(amdrio,"amdrio.dta")

wjunger/ares documentation built on Dec. 23, 2021, 5:17 p.m.