pull_cell: Select a cell from a dataframe given a row and a column

Description Usage Arguments Details Value Examples

Description

Given a row (identified by row names or a character column called "rowname"), select the cell that intersects with a given column.

Usage

1
pull_cell(df, rowname, col, percent = FALSE)

Arguments

df

a dataframe

rowname

the name (or id) of a row

col

the name of a column

percent

return value multiplied by 100

Details

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.

Value

a single cell from a data frame that is of the class of the value's containing column

Examples

1
pull_cell(mtcars, `Mazda RX4`, mpg, percent = FALSE)

dylanrussellmd/nsqipBileSpill documentation built on Dec. 20, 2021, 2:17 a.m.