Usage Arguments Value References Examples
View source: R/MoveCells2left.R
1 | MoveCells2left(df, fillwith = NA, shift = 1, ef = c(NA, -999, 0))
|
df |
table (data.frame/2D-matrix) to be checked |
fillwith |
what is the character/number to fill the "empty" cells. Default the same as |
... |
|
a data.frame/2D-matrix
http://stackoverflow.com/questions/23285215/advanced-dataframe-manipulation-in-r-shifting-cells-to-the-left
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # example 1
xe <- data.frame(x=c("l","m",NA,NA,"p"),
y=c(NA,"b","c",NA,NA),
z=c("u",NA,"w","x","y"))
print(xe)
MoveCells2left(df = xe, ef = NA)
# example 2
xe <- data.frame(a = 3:6, b = 0, c = 0, d = 0, e = 0)
xe[2, 1] <- 0
xe[1, 4] <- 3
xe[2, 3] <- 3
xe[3, 3] <- 3
xe[3, 5] <- 3
xe[4, 2] <- 3
print(xe)
MoveCells2left(df = xe, ef = 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.