How to sample evenly from a data frame having only one representative per group?
This is the data frame I am using and I am trying to subsample column V2(position) evenly (min:1130, max: 4406748) in a way that there is only one representative of column V4(lineage) in the final sample.
I am trying to sample in a way that positions are evenly distributed while ensuring that I include only 1 representative of each group in the entire sample.
slice_sample producing different samples in grouped .data
Why do the following grouping methods results in different samples. My assumption was that the grouping results to similar samples?