我有一个带有半小时值的大型气象数据集。我正在使用 ddply 函数来创建每日值(平均值、总和等),但是我在获取最小值和最大值时遇到了问题!对于某些值,例如气温,我想提取每日平均值、最小值和最大值,但是返回的数据框给我的最小值和最大值与平均值相同。有人可以看看我写的命令,看看他们是否发现任何错误?
HFTda <- ddply (HFT, .(Year, DOY),summarise,
Temp = mean (Temp, na.rm = F),
Tmax = max (Temp, na.rm = F),
Tmin = min (Temp, na.rm = F),
RHmax = max (RH.x, na.rm = F),
RHmin = min (RH.x, na.rm = F),
VPD = mean (VPD.x, na.rm = F),
Grad = mean (GradInc2, na.rm = F),
Gex = mean (Gex, na.rm = F),
Prec = sum (Prec, na.rm = F),
H = mean (HFill, na.rm = F),
LE = mean (LEFill, na.rm = F),
NEE = mean (co2_fluxFill, na.rm = F),
ET = mean (h2o_fluxFill, na.rm = F),
SWout = mean (YB5214h, na.rm = F))