jeudi 6 avril 2017

Create a column with random decimal values

Just trying to create a column with random decimal points between 0.001 and 0.009 I'm using the code:

data$newrow <- sample(0.001:0.009,replace=T, nrow(data))

but seems to only produce a column with 0.001.

summary(data$newrow) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.001 0.001 0.001 0.001 0.001 0.001

Any ideas why?

Thanks!




Aucun commentaire:

Enregistrer un commentaire