Learn R Programming

dotsViolin (version 0.0.1)

make_legend_with_stats: Make legends with stats

Description

This function merges all columns in a dataframe to be used as legends

Usage

make_legend_with_stats(
  data,
  namecol,
  start_column_idx = 2,
  first_justified_left = FALSE
)

Value

data.frame with combined source columns

Arguments

data

dataframe with columns to be merged into 1

namecol

name to be given to new column

start_column_idx

numeric index of first column to process

first_justified_left

boolean when TRUE justifies first column to the left, defaults to FALSE

Examples

Run this code
fabaceae_mode_counts <- get_modes_counts(fabaceae_clade_n_df, "clade", "parsed_n")
fabaceae_clade_n_df_count <- make_legend_with_stats(fabaceae_mode_counts, "label_count", 1, TRUE)
fabaceae_Cx_mode_counts_per_clade_df <- get_peaks_counts_continuous(
  fabaceae_clade_1Cx_df,
  "clade", "Cx", 2, 0.25, 1, 2
)
namecol <- "labelcountcustom"
fabaceae_clade_1Cx_modes_count_df <- make_legend_with_stats(
  fabaceae_Cx_mode_counts_per_clade_df,
  namecol, 1, TRUE
)

Run the code above in your browser using DataLab