pull_cell.Rd
Given a row (identified by row names or a character column called "rowname"), select the cell that intersects with a given column.
pull_cell(df, rowname, col, percent = FALSE)
df | a dataframe |
---|---|
rowname | the name (or id) of a row |
col | the name of a column |
percent | return value multiplied by 100 |
a single cell from a data frame that is of the class of the value's containing column
This function requires a data frame either have row names, a column called "rowname", or that a row be referred to by its ID if neither of the previous conditions are true.
percent
is useful for returning numeric values reported as rates that you would like reported as percentages.
pull_cell(mtcars, `Mazda RX4`, mpg, percent = FALSE)#> [1] 21