powered by
Calculates a random subset of the data based on repeated values from a specified column.
randomSubset(df, colName)
data frame. Must include a column named by the argument colName.
column name to check for duplicates
df <- data.frame(Julian = c(1,2,2,3,4,4,4,6), y = 1:8) df df_random <- randomSubset(df, "Julian") df_random
Run the code above in your browser using DataLab