jeudi 2 septembre 2021

Randomly selecting specific rows in R data

I'm wondering if it's possible to randomly select specific categories from rows of a excel spreadsheet in R.

E.g. here is sample data sample data

I want to randomly select only one type of the "Station" rows (e.g. only the 'LC04' rows, but have this determined randomly). Is there a way this can be done in R? I have a large dataset, and want to randomize the selection ~100 times, so then I can use each random outcome for additional analyses.

Thanks!




Aucun commentaire:

Enregistrer un commentaire