Previous: Standard Ways to Load | Up: Loading Data | Next: Verifying You Loaded The |
These procedures apply to any of the above read commands:
> read.csv("mydata.csv", header = TRUE)will read the words in the first row as the variable names and the subsequent rows (each with the same number of values as the first) as observations for each of those variables. If you have additional characters on the last line of the file or fewer values in one of the rows, you need to edit the file before attempting to read the data.
> read.table("mydata.tab", header = TRUE, na.strings = "-9")Note: You must enclose your place holder values in quotes.