Deconcatenate delimited column values in a data.frame
deconcat_df2(x, column, split = "[,; |/]+", blank = "", ...)
data.frame
or compatible object
character
vector with one or more colnames(x)
that should be de-concatenated.
character
pattern used by strsplit()
to split
multiple values in each column.
character
string used to replace entries that
would otherwise be zero-length as returned by strsplit()
.
additional arguments are ignored.
This function deconcatenates delimited values in a column
of a data.frame
by calling strsplit()
on column values,
and repeating values in all other columns to match lengths()
following strsplit()
.
This function includes a correction for cases where strsplit()
would otherwise return zero-length entries, and which would
otherwise be dropped from the output. From this function,
zero-length entries are replaced with blank=""
so these
rows are not dropped from the output.
Other jam utility functions:
avg_angles()
,
avg_colors_by_list()
,
call_fn_ellipsis_deprecated()
,
cell_fun_bivariate()
,
collapse_mem_clusters()
,
colorRamp2D()
,
display_colorRamp2D()
,
enrichList2geneHitList()
,
filter_mem_genes()
,
filter_mem_sets()
,
find_colname()
,
get_hull_data()
,
get_igraph_layout()
,
gsubs_remove()
,
handle_igraph_param_list()
,
isColorBlank()
,
make_legend_bivariate()
,
make_point_hull()
,
mem_find_overlap()
,
order_colors()
,
rank_mem_clusters()
,
rotate_coordinates()
,
subgraph_jam()
,
subset_mem()
,
summarize_node_spacing()
,
xyAngle()
df <- data.frame(one=c("AB", "BC", "AC"),
two=c("a,b", "b,c", "a,c"));
deconcat_df2(df, column="two")
#> one two
#> 1_v1 AB a
#> 1_v2 AB b
#> 2_v1 BC b
#> 2_v2 BC c
#> 3_v1 AC a
#> 3_v2 AC c