初学者,所以请提醒我任何格式错误或一般礼仪错误。
我正试图从大约800个网站上搜集数据,以提高我并行查看的速度。
我简化了我的代码以产生错误:
url=c("https://apps.hydroshare.org/apps/nwm-forecasts/api/GetWaterML/?config=long_range&geom=channel_rt&variable=streamflow&COMID=6251152&startDate=2018-03-12&lag=t18z&member=4",
"https://apps.hydroshare.org/apps/nwm-forecasts/api/GetWaterML/?config=long_range&geom=channel_rt&variable=streamflow&COMID=6244518&startDate=2018-03-12&lag=t18z&member=4"
cores.number=2
cluster1=makeCluster(cores.number)
clusterExport(cluster1,"url")
clusterEvalQ(cluster1,library("xml2"))
clusterEvalQ(cluster1,url)
temp=parLapply(cluster1,
url,
function(x)
read_xml(x,fill=TRUE,row.names=NULL))
stopCluster(cluster1)
我收到以下错误:
checkForRemoteErrors(val)出错: 2个节点产生错误;第一个错误:HTTP错误500。
当使用lapply而不是parLapply执行相同的功能时,我没有任何问题,当我将cores.number调整为1时,我没有任何问题。
由于