column_by_other: Unique Values of one Column by Another

View source: R/S03_Utilities.R

column_by_otherR Documentation

Unique Values of one Column by Another

Description

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.

Usage

column_by_other(dtf, col1, col2)

Arguments

dtf

A data frame.

col1

The first column (non-standard evaluation possible).

col2

The second column (non-standard evaluation possible).

Value

A data frame with the unique values of the first column associated with the unique values of the second.

Author(s)

Kevin Potter

Examples

# 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 )


rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.