I have a data frame with 1000 continuous observations in the format below:
Data
structure(list(Date = c("1977-01-01", "1977-01-02", "1977-01-02"
), Flow = c(39.1, 39.6, 36.8), Concentration = c(15L, 20L, 40L
)), class = "data.frame", row.names = c(NA, -3L))
Date Flow Concentration
> 1977-01-01 39.1 15
> 1977-01-02 39.6 20
> 1977-01-02 36.8 40
I created a new data frame to generate 36 random samples using the code below:
> library(dplyr)
> Subset1<-sample_n(TSS,36,replace = TRUE)
Date Flow Concentration
> 1977-01-01 39.1 15
> 1977-05-03 21.9 17
> 1977-07-02 42.8 40
I further wanted to add 10 stratified samples in above data frame based on the Flow column by including 10 maximum flow observations but i exactly don't know how to do it. I would really appreciate if someone could help me in doing this step.
Aucun commentaire:
Enregistrer un commentaire