ccSums: 'c'heck and 'c'orrect row-wise sums

Usage Arguments Value Examples

View source: R/ccSums.R

Usage

1
ccSums(x, total, cols = NULL, ef = NA, fna = 0)

Arguments

total

sum column to be compared with base::rowSums

cols

column number

ef

The symbol used to fill empty rows.

fna

fill NA's with 0 (default).

Value

A list with: x numeric data.frame or matrix with argument x corrected total a numeric vector with the totals corrected. uT a numeric table (data.frame or matrix) with total appended at the right of x

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
flag <- 0
xe <- data.frame(a = 1:7, b = flag, c = flag)
xe[2, 1] <- flag
xe[3, 2] <- 3
xe[3, 3] <- 6
xe[4, 2:3] <- NA
xe[4, 1] <- 0
xe[5, 2] <- NA
xe[6, 1:3] <- NA
xe[7, 1] <- NA
print(xe)
ccSums(x = xe[, 1:2], total = xe[,3], ef = -99.009)

mathphysmx/cleanTable documentation built on May 29, 2019, 2:51 p.m.