mSums2: Check and correct Multiple sums

Usage Arguments Details Value Examples

View source: R/mSums2.R

Usage

1
mSums2(x, sc, ec, scT, ecT, nr = 1, nc = 1, ...)

Arguments

x

Table to be checked. data not need to be contigous but must be equally spaced.

sc, scT

names of the starting column of the table x for data to be checked sc and for the totals, scT

ec, scT

names of the end column column of the table x for data to be checked sc and for the totals, scT

nr

Block length

nc

number of blocks. Default to 1, i.e., a the totals must be a vector.

...

further arguments passed to ccSums

Details

total columns must be contiguous, and data blocks too.

Value

A list with

x

input x but data checked

cPos

column numbers representing sc and ec of data x

cPosT

column numbers representing sc and ec of the totals

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
xe <- as.data.frame(matrix(c(-1:-5, 33301:33305,
                             -1:-5, 33301:33305,
                             1:10), # totals
                           nrow = 5, ncol = 6))
flag <- NA
xe[1, 1] <- flag
xe[2, 1] <- flag
xe[2, 3] <- flag
print(xe)
mSums2(xe, sc = "V1", ec = "V4",
      scT = "V5", ecT = "V6",
      nr = 2, nc = 2, ef = -99.009)

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