mercredi 14 mars 2018

Sampling a vector in R

I have a vector, X, containing around 600,000 elements in r. I want to create QQ plots for the data, and use the excellent fitdist() function to investigate which distribution my data set may have been drawn from.

I can generate QQ plots for the data set, however due to the size of the data set, the resulting pdf file is quite cumbersome to load. One idea of how to solve the problem would be to create a new vector Y, taking only every 1 in 10 elements of X. Another would be to make Y a random sample of my elements in X. I was wondering if there was a way to do this in R.

I found some documentation reffering to an rthin function, here: https://www.rdocumentation.org/packages/spatstat/versions/1.55-0/topics/rthin

However my version of Rstudio could not find the rthin function.




Aucun commentaire:

Enregistrer un commentaire