foreach(i = c(1:13), icount()) %do% {
outfile = glue("OUTPUT/clusterId/1961_1990/8x8/HW{i}.nc")
if (!file.exists(outfile)) {
infile <- glue("OUTPUT/HW_indexes/TRS_1961_1990/HW{i}.rda")
load(infile)
print(infile)
cmd = glue("HW <- HW{i}")
eval(parse(text = cmd))
clusterId <- HW_cluster(HW, 8)
dims = ncdim_def_lonlat(lon, lat, dates)
ncwrite(list(clusterId = clusterId), outfile, dims = dims, compression = 2)
# saveRDS(clusterIds, outfile)
}
}
foreach(i = c(1:13), icount()) %do% {
outfile = glue("OUTPUT/clusterId/1961_1990/12x12/HW{i}.nc")
if (!file.exists(outfile)) {
infile <- glue("OUTPUT/HW_indexes/TRS_1961_1990/HW{i}.rda")
load(infile)
print(infile)
cmd = glue("HW <- HW{i}")
eval(parse(text = cmd))
clusterId <- HW_cluster(HW, 12)
dims = ncdim_def_lonlat(lon, lat, dates)
ncwrite(list(clusterId = clusterId), outfile, dims = dims, compression = 2)
# saveRDS(clusterIds, outfile)
}
}
foreach(i = c(1:13), icount()) %do% {
outfile = glue("OUTPUT/clusterId/1961_1990/16x16/HW{i}.nc")
if (!file.exists(outfile)) {
infile <- glue("OUTPUT/HW_indexes/TRS_1961_1990/HW{i}.rda")
load(infile)
print(infile)
cmd = glue("HW <- HW{i}")
eval(parse(text = cmd))
clusterId <- HW_cluster(HW, 16)
dims = ncdim_def_lonlat(lon, lat, dates)
ncwrite(list(clusterId = clusterId), outfile, dims = dims, compression = 2)
# saveRDS(clusterIds, outfile)
}
}
foreach(i = c(1:13), icount()) %do% {
outfile = glue("OUTPUT/clusterId/1961_1990/20x20/HW{i}.nc")
if (!file.exists(outfile)) {
infile <- glue("OUTPUT/HW_indexes/TRS_1961_1990/HW{i}.rda")
load(infile)
print(infile)
cmd = glue("HW <- HW{i}")
eval(parse(text = cmd))
clusterId <- HW_cluster(HW, 20)
dims = ncdim_def_lonlat(lon, lat, dates)
ncwrite(list(clusterId = clusterId), outfile, dims = dims, compression = 2)
# saveRDS(clusterIds, outfile)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.