nuomin 发表于 2014-10-16 18:37 
函数不用显式的定义了,传递的参数就是虚拟函数
not quite understand what you mean, i think he wanted sth that can be controlled by an input n, sth like
> v1=simfx(5); v1
[1] 0.5605143 1.3219990 0.5743634 0.9877892 1.6568320
> v2=simfx(10); v2
[1] 0.6671224 1.0667072 0.2414595 0.4811383 0.6274158 0.7628753 1.0127439 1.7258184 1.8567844 1.3401155
the line you provided forced n=100, also, it got an error since the x was likely undefined and not related to the runif(100). thanks.