[prev in list] [next in list] [prev in thread] [next in thread]
List: r-sig-geo
Subject: [R-sig-Geo] Problem in generate random samples in r
From: Lara Silva <lara.sfp.silva () gmail ! com>
Date: 2019-02-20 11:20:25
Message-ID: CALN9TETFnW5-TWzu0xL5jWnof7hFXW1Mp2Lm_+WD=JOKvnEygQ () mail ! gmail ! com
[Download RAW message or body]
Hello,
I am trying to generate random samples from the following code
### Setting random seed to always create the same
### Random set of points
set.seed(0)
absences_15000<-absences[sample(nrow(absences), 15000),]
points(absences_15000, cex=0.1)
## Subsample_10000
set.seed(0)
absences_10000<-absences_15000[sample(nrow(absences_15000), 10000),]
dim(absences_10000)
I get the following error:
Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'
Any advice?
Regards,
Lara
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic