powered by
Similar to tidyr::unnest but lands rowids and value ids, and can work on remote data sources. Fairly expensive per-row operation, not suitable for big data.
tidyr::unnest
expandColumn(data, colName, ..., rowidSource = NULL, rowidDest = NULL, idxDest = NULL, tempNameGenerator = makeTempNameGenerator("replyr_expandColumn"))
data.frame to work with.
character name of column to expand.
force later arguments to be bound by name
optional character name of column to take row indices from (rowidDest must be NULL to use this).
optional character name of column to write row indices to (must not be an existing column name, rowidSource must be NULL to use this).
optional character name of column to write value indices to (must not be an existing column name).
temp name generator produced by replyr::makeTempNameGenerator, used to record dplyr::compute() effects.
expanded data frame where each value of colName column is in a new row.
# NOT RUN { d <- data.frame(name= c('a','b')) d$value <- list(c('x','y'),'z') expandColumn(d, 'value', rowidDest= 'origRowId', idxDest= 'valueIndex') # }
Run the code above in your browser using DataLab