Skip to content

random sampling inside a dataset

2 messages · Gian Maria Niccolò Benucci, Berend Hasselman

#
On 13-09-2012, at 10:42, Gian Maria Niccol? Benucci wrote:

            
Use sample.
Like this for example

A <- matrix(runif(8*4), nrow=8)
A

select.row <- sample(1:nrow(A), size= nrow(A)/3, replace=FALSE)
select.row
A[select.row,]

Berend