Learn R Programming

eiCompare (version 3.0.4)

sum_over_cols: 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)

Value

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

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.