我有两个文件,一个是data.csv,另一个是header.csv。如何使用header.csv设置从data.csv文件中读取的data.frame的列名。
这不起作用:
data = read.table(path, sep = ";", quote = "",
dec = ".", head=FALSE, fill = TRUE, comment.char = "")
header = read.table(path_header, sep = ";", quote = "",
dec = ".", head=FALSE, fill = TRUE, comment.char = "")
colnames(data) <- header
因为我有超过200列,所以不太方便使用
colnames(data) <- c("A","B",...)