create a matrix of samples in R -


I have probability distribution X and I would like to make samples of 100 comments: I sample (x, size = 100) , Substituted = TRUE) I want to plot sample on 100,1000,10000 samples, so I have the matrix (sample (x, size = 100, substituted TRUE), nrow = 100, ncol = 100) but it will generate the same sample in all the columns. Any ideas about how to create a new sample for each column?

How about this? Instead of option with its sample call it will take a new sample for each column

  repeat (3, rnorm (10)) # [, 1] [, 2] [, 3] # [1] -0.439366440511456290974 0.349113310500896667499 2.10467702915785226381 # [2] 0.788892611945899879800 .572377925929974273878 .92566383997665424577 # [3] .098359807623723205516 -0.642162545019581476602 .28636140673186011307 # [4] -3.063133170307587249681 1.322694510750672014510 .66340500173312999532 # [5] 0.255018412772398617161 1.492588176987205361712 1.11444057062233659039 # [6] - 1.069621910039232570711 -1.460604130070508821504 -0.81534768620081377044 # [7] -1.036421328330551894226 1.525817374339748067058 .47070620500783272311 # [8] -0.139135286049327872027 -0.065015174557339946992 .21483758566831215320 # [9] -0.370005496738202488416 1.573987068922320986530 -1.21431499328084857581 # [10] -0.07050813 7614489943545 1.657541962601124518883 .45886687983031809734    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -