【发布时间】:2015-01-30 15:22:40
【问题描述】:
我已经找到了许多相反的解决方案,但没有这样的解决方案。我有一个矩阵列表,需要将它们作为向量。我可以获取每个元素,为其命名,然后将其放入向量中。但我相信有更好的方法!
zerooklein <- lapply(1:10, function(x){genweb(10, 5, dens=2)})
zeroomittel <- lapply(1:10, function(x){genweb(10, 20, dens=2)})
zeroogroß <- lapply(1:10, function(x){genweb(10, 80, dens=2)})
这些是我的清单。
size <- c(this should contain all the singel matrices )
sizef <- sapply(size, function(x) nested(get(x), method="ALL"))
plot(capscale(formula = scale(sizef) ~ 1))
这就是我想对他们做的事情。
【问题讨论】:
-
你的问题似乎没有意义。
nested函数将web作为参数,而不是向量。您应该提供更多上下文,以便其他人可以理解您要完成的工作。更好的是,提供中间对象应该是什么样子的示例。 -
我想在几个矩阵(zeroo)上应用几个指标(ALL)。所以
size应该是(名称?)singel矩阵的向量。这样 nested 可以获取每个矩阵并在它们上应用所有方法。然后它应该返回一个向量,其中包含每个矩阵的计算指标。