readData | R Documentation |
This function reads data from various file types such as CSV, DTA (Stata), REC (EpiInfo), RDA/RDATA, RDS, and Excel files. It provides options to factorize, convert column names to lowercase, and add labels to the data. If no filename is provided, a file dialog will be opened for the user to select a file.
readData(
filename = "",
factorise = FALSE,
lowercase = FALSE,
label = NULL,
sheet = NULL,
verbose = TRUE,
...
)
filename |
String specifying the path of the file to read. If empty, opens a file dialog. |
factorise |
Logical, if TRUE factorizes the data. |
lowercase |
Logical, if TRUE converts column names to lowercase. |
label |
Optional label to add to the data. |
sheet |
Sheet name or index for Excel files (If reading an Excel file) |
verbose |
Logical, if TRUE prints details about the loaded file. |
... |
Additional arguments passed to the underlying read functions like encoding="latin1". |
Returns a data frame of the loaded file, or an error if the file format is not supported or the file does not exist.
readData("flucases.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.