谢谢阅读。
我正在尝试从2个CSV文件的数据中查找一列的最大值(请参见下面的文件示例)。
不确定如何找到特定列的最大值(tp,)
答案 0 :(得分:1)
合并两个文件并查找最大值。
df1 <- read.csv("Path to the file1", header=T, sep=",")
df2 <- read.csv("Path to the file2", header=T, sep=",")
data <- rbind(df1,df2)
max(data['temp'])
如果您有很多文件,
setwd('Path of the folder that contains the files')
filenames <- list.files(full.names=TRUE)
data <- lapply(filenames,function(i){read.csv(i)})
df <- do.call(rbind.data.frame, data)
max(df['temp'])