column_by_other.Rd
A function that takes two columns in a data frame and reports the unique values of one column associated with the unique values of the other column.
column_by_other(dtf, col1, col2)
A data frame.
The first column (non-standard evaluation possible).
The second column (non-standard evaluation possible).
A data frame with the unique values of the first column associated with the unique values of the second.
# Define a data frame
dtf <- data.frame(
A = c( 1, 1, 2, 2, 3, 3 ),
B = c( 'A', 'A', 'B', 'B', 'C', 'D' )
)
# Values of column 'B' by values of column 'A'
column_by_other( dtf, A, B )
#> A B
#> 1 1 A
#> 2 2 B
#> 3 3 C
#> 4 3 D