R/inflate.R
raw| 1 | ## Not exported yet ... |
| 2 | |
| 3 | inflate <- function(df,w){ |
| 4 | w <- eval(substitute(w),df,parent.frame()) |
| 5 | i <- seq(nrow(df)) |
| 6 | i <- rep(i,as.integer(w)) |
| 7 | df[i,] |
| 8 | } |
| 9 | |
| 10 | |
| 11 | # test.inflate <- function(){ |
| 12 | # testdata <- data.frame(x=c(1,2,3),y=c(4,5,6),weights=c(4,8,12)) |
| 13 | # print(testdata) |
| 14 | # print( |
| 15 | # inflate(testdata,weights) |
| 16 | # ) |
| 17 | # } |
| 18 | # |
| 19 | # test.expand() |