sum_over_cols: Sum row-wise over columns in a dataframe

View source: R/ei_preprocessing.R

sum_over_colsR Documentation

Sum row-wise over columns in a dataframe

Description

Simple wrapper of rowSums for checking row sums of race, candidate columns

Usage

sum_over_cols(data, cols)

Arguments

data

A data.frame() object containing precinct-level turnout data by race and candidate

cols

A set of columns to sum over. Typically, enter cand_cols or race_cols here.

Value

A vector of row-wise sums across the column vector entered as argument.


eiCompare documentation built on Aug. 31, 2023, 5:16 p.m.