example1
### 1. read data
data_transform <- read.table(paste('./function_predict/', file_names[1], sep = ''), header = TRUE, sep = " ", row.names = NULL, stringsAsFactors = FALSE )
read.table提示 more columns than column names
,how to solve it?
data_transform <- read.table(paste('./function_predict/', file_names[1], sep = ''), header = TRUE,
sep = "\t"
, row.names = NULL, stringsAsFactors = FALSE )
example2
data_class1 <- aggregate(data_transform[,4:length(data_transform)],by = list(data_transform$Class1), FUN = sum, simplify = TRUE)
提示: Error in aggregate.data.frame(data_transform[, 4:length(data_transform)], : arguments must have same length
,how to solve it ?
我看了一下官方演示的例子,加了个名称,就可以了。
data_class1 <- aggregate(data_transform[,4:length(data_transform)],by =
list(Class1 = data_transform$Class1)
, FUN = sum, simplify = TRUE)
仅以此记录自己犯下的错误。