Deconcatenate delimited column values in a data.frame
Arguments
- x
data.frameor compatible object- column
charactervector with one or morecolnames(x)that should be de-concatenated.- split
characterpattern used bystrsplit()to split multiple values in each column.- blank
characterstring used to replace entries that would otherwise be zero-length as returned bystrsplit().- ...
additional arguments are ignored.
Details
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.
See also
Other jam utility functions:
ashape(),
avg_angles(),
avg_colors_by_list(),
bulk_cnet_adjustments(),
call_fn_ellipsis_deprecated(),
cell_fun_bivariate(),
collapse_mem_clusters(),
colorRamp2D(),
display_colorRamp2D(),
enrichList2geneHitList(),
filter_mem_genes(),
filter_mem_sets(),
find_colname(),
find_enrich_colnames(),
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()
Examples
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