Description Usage Arguments Details Value Author(s) See Also Examples
Import datasets in different formats
1 | import_data(file, text.format = "csv", ...)
|
file |
quoted string with the file name |
text.format |
rules for text files |
... |
further options for |
The function will try to select the proper filter based on the file extension. Valid file types are some of those supported by package foreign. There are rules implemented for Stata up to version 9 (*.dta), SPSS up to version 11 (confirmed) (*.sav), xBase files up to version 4 (*.dbf), Epi-Info files version 6 (*.rec). R binary files *.rda
can also be read directly by this function. Excel files (*.xls) are no longer supported. Please, save the files in the CSV
format.
Several text formats can be read 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 assume an ASCII text filter 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"
.
If file
is set to "clipboard"
the function will try to import data previously copied into the system clipboard using text data rules set in text.format
. It can render unexpected results though.
An object of class data.frame
.
Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br
1 2 3 | data(admrio)
export_data(admrio,"admrio.dta")
new.data=import_data("admrio.dta")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.