I have some data files without column headings and every time I import them into the workspace R will read the first observation as variable names. Is there any way to prevent R from doing this?
In read.table
the option header=FALSE
will not read the first observation as variable name.
Example:
write.csv(iris, "temp.csv")
read.table("temp.csv", sep=",", header=FALSE)
Works for read.csv(..., header=FALSE)
too.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.