This function takes a matrix or data frame as input and randomly samples columns

random_cells(df, n)

Arguments

df

Data frame or matrix.

n

Number of cells to sample.

Value

Matrix or data frame of n randomly sampled rows

Examples

if (FALSE) {
df <- matrix(1:1000, 500, 20)
sub_df <- random_cells(
    df = df,
    n = 20
)
}