在 R 中跨多个 csv 文件查找最大列值
Find max column value across multi csv files in R
感谢您阅读本文。
我正在尝试从 2 个 CSV 文件的数据中找出一列的最大值(参见下面的文件示例)。
不确定如何找到特定列的最大值 (tp,)
合并两个文件并找到最大值。
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'])
感谢您阅读本文。
我正在尝试从 2 个 CSV 文件的数据中找出一列的最大值(参见下面的文件示例)。
不确定如何找到特定列的最大值 (tp,)
合并两个文件并找到最大值。
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'])