我有8个号码
IniValue=c('3%','3.2%','3.6%','4%','4.2%','4.2%','4.5%','4.5%')
我应该如何针对每个数字生成50个数字~(0,0.1%)
并使它们成为矩阵
答案 0 :(得分:1)
这应该
IniValue=c(3,3.2,3.6,4,4.2,4.2,4.5,4.5)
random <- matrix(0, nrow = 50, ncol = length(IniValue))
for (i in 1:length(IniValue))
{
random[,i] = rnorm(50, mean = IniValue / 100, sd = 0.1/100)
}