jeudi 5 juillet 2018

Randomly sampling one or more levels of a grouping variable in R

Hello I have a data table where I have data across grouping variables like this. The groups are Site, Species and Season, and the response is Conductance. I want to randomly pick a level of species for a site and find the average conductance for the random pick of the level of species. I would like to randomly pick one, two or more levels of species from the grouping variable Species. How should I go about it? thanks in advance

Site Species Season Conductance 1 Species1 Dry 20 1 Species2 Dry 30 1 Species3 Dry 40 1 Species1 Dry 25 1 Species2 Dry 30 1 Species3 Dry 35 2 Species1 Dry 30 2 Species2 Dry 24 2 Species2 Dry 25 2 Species4 Dry 30 2 Species4 Dry 32 2 Species4 Dry 30 1 Species1 wet 26 1 Species2 wet 24 1 Species3 wet 30 2 Species1 wet 32 2 Species4 wet 30 2 Species4 wet 28




Aucun commentaire:

Enregistrer un commentaire