shiftCellsH: Shift cells (or block of cells) horizontally if the previous...

Usage Arguments Details Value Examples

View source: R/shiftCellsH.R

Usage

1
shiftCellsH(x, bLength = 1, fillwith = NULL, ef = c(NA, -999, 0))

Arguments

x

table (data.frame/2D-matrix) to be checked

bLength

Block length. Length (number of cells) of each block. Default to 1, i.e., a single cell is a block.

fillwith

The unique number,character, symbol (NA, Inf), etc. which represents empty cells. What is the symbol meaning empty cell?. If untouched, no change will be done on the cell values

ef

argument passed to EmptyRow

Details

depends on EmptyRow.R and MoveCells2left.R

Value

x with the blocks shifted if the case mcb a table in which each column represents a block and the value of each cell represents the corresponding column in x from where the block comes to xn.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# example 1
# Check what shiftCellsH does to each row
flag <- NA
xe <- matrix(data = flag, nrow = 6, ncol = 4)
xe[1, 1] <- 1
xe[2, 3:4] <- 2
xe[3, 3] <- 3
xe[4, 3] <- 4
xe[4, 4] <- 0
xe[5, 2:4] <- 0
xe[6, 2] <- 0
xe[6, 3:4] <- 6
print(xe)
shiftCellsH(x = xe, bLength = 2,
            ef = c(0, flag), fillwith = -999)

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