[R] Subsetting from pareto distribution
David Winsemius
dwinsemius at comcast.net
Tue Apr 28 21:49:48 CEST 2015
On Apr 28, 2015, at 12:20 PM, W Z wrote:
> I have a dataset of 20k records heavily right skewed as pareto
> distribution, I'd like to pull 1k subset of it with same distribution, any
> R package would do that?
Why not just:
subdat <- dat[sample( nrow(dat), 1000), ] # if "dataset" is a dataframe
Or:
subdat <- dat[sample( length(dat), 1000) ] # if "dataset" is a vector
>
> Thanks.
>
> [[alternative HTML version deleted]]
Do read the posting guide and the documentation for your mail client and learn how to post in plain text.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius
Alameda, CA, USA
More information about the R-help
mailing list