繁体   English   中英

使用 R 的自动化任务

[英]An Automating task Using R

我正在使用 RStudio 寻求自动化任务的帮助。 我想使用 LPM(应用于水文系列的线性参数模型)package 来估计使用 IDFcurve2 function 的不同持续时间的最大年降雨量系列的强度持续时间频率曲线。 我感兴趣的 output 集是 a(Tr)、m 和 b 的值。 我有 excel 格式(xlsx)的表格。 总共630张桌子。 意味着我需要运行代码 630*3 = 1890 次。 换句话说,接收 1890 (a(Tr), m, and b) 集合。

我写的代码是

files <- list.files(path="D:/PhD/biass_corrected_netCDF/Calculate max Annual Prepicitation/test", pattern="*.xlsx", full.names=TRUE, recursive=FALSE)
pr <- function (files){
data <- data.frame(files)
IDFcurve2(data, 10, stvalue1 = 1, stvalue2 = 1,t=c(3, 6, 9, 12, 15, 18, 21, 24), Tr = 200, MP=T)
}

lapply( x= data, FUN = pr)

can you please correct the code to read the excel sheet convert it to a data frame use datagram as an input to the IDFcurve2 function (the first input (data) and the other arguments for the function are constant as it's stated already), then finally编写(a(Tr),m,和b)参数的结果集和一个真正的txt文件。

先感谢您

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM