首页 > 解决方案 > 使用 NLMR 包修复 R 中的种子

问题描述

我正在使用NLMR

# simulate polygonal landscapes
mosaicgibbs <- NLMR::nlm_mosaicgibbs(ncol = 100,
                               nrow = 100,
                               germs = 20,
                               R = 2,
                               patch_classes = 3)
# visualize the NLM
rasterVis::levelplot(mosaicgibbs, margin = FALSE, par.settings = rasterVis::viridisTheme()) 

但我想修复种子数以重现空间模式。

我试过了,set.seed(123)但它不起作用。E.

标签: rr-rasterrandom-seed

解决方案


我不确定这对你的情况是否有帮助,但我不能只发表评论。在nlm_gaussianfield()设置种子的语法中是:

nlm_gaussianfield(nrow=10, ncol= 10, user_seed = 123)

默认值为NULL. 也许这也适用nlm_mosaicgibbs()。祝你好运!


推荐阅读