【发布时间】:2019-08-24 02:38:15
【问题描述】:
我正在使用其他人的包裹。如您所见,函数中有一个ImportHistData 术语。我想将环境中的文件作为rainfall 名称而不是rainfall.txt 导入。当我将rainfall.txt 替换为rainfall 时,出现此错误:
read.table 中的错误(x,header = FALSE,fill = TRUE,na.strings = y): 'file' 必须是字符串或连接
那么,要导入文件而不是文本,我应该遵循哪种方式?
函数的原始形状
DisagSimul(TimeScale=1/4,BLpar=list(lambda=l,phi=f,kappa=k,
alpha=a,v=v,mx=mx,sx=NA),CellIntensityProp=list(Weibull=FALSE,
iota=NA),RepetOpt=list(DistAllowed=0.1,FacLevel1Rep=20,MinLevel1Rep=50,
TotalRepAllowed=5000),NumOfSequences=10,Statistics=list(print=TRUE,plot=FALSE),
ExportSynthData=list(exp=TRUE,FileContent=c("AllDays"),file="15min.txt"),
ImportHistData=list("rainfall.txt",na.values="NA",FileContent=c("AllDays"),
DaysPerSeason=length(rainfall$Day)),PlotHyetographs=FALSE,RandSeed=5)
函数中 ImportHistData 部分的来源
ImportHistDataFun(mode = 1, x = ImportHistData$file,
y = ImportHistData$na.values, z = ImportHistData$FileContent[1],
w = TRUE, s = ImportHistData$DaysPerSeason, timescale = 1)
【问题讨论】:
标签: r