dots_and_violin {dotsViolin} | R Documentation |
Makes a composite dot-plot and violin-plot
Description
This function makes a dot-plot and violin-plot
Usage
dots_and_violin(
dataframe,
colgroup,
collabel,
maxcountcol,
widthdots,
maxx,
labelx,
desiredorder,
binwidth,
adjust,
binexp,
fill_group = "fill_group",
dots = TRUE,
violin = TRUE
)
Arguments
dataframe |
dataframe |
colgroup |
chr column to group by |
collabel |
label to be used in the plot |
maxcountcol |
numeric variable |
widthdots |
dotsize parameter for geom_dotplot |
maxx |
x axis maximum value |
labelx |
label for x axis |
desiredorder |
order for the colgroup categories |
binwidth |
see, plot_dotviolin |
adjust |
adjust param, see geom_violin |
binexp |
digit to modify size of bins with base 10 |
fill_group |
2nd categorical data (use only 2 categories) |
dots |
boolean include dot plot |
violin |
boolean include violin plot |
Value
A grid of ggplots that mimics a single plot
Examples
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_clade_n_df$label_count <- fabaceae_clade_n_df_count$label_count[match(
fabaceae_clade_n_df$clade,
fabaceae_clade_n_df_count$clade
)]
desiredorder1 <- unique(fabaceae_clade_n_df$clade)
dots_and_violin(
fabaceae_clade_n_df, "clade", "label_count", "parsed_n", 2,
30, "Chromosome haploid number", desiredorder1, 1, .85, 4,
"ownwork",
violin = FALSE
)
dots_and_violin(
fabaceae_clade_n_df, "clade", "label_count", "parsed_n", 2,
30, "Chromosome haploid number", desiredorder1, 1, .85, 4,
dots = FALSE
)
dots_and_violin(
fabaceae_clade_n_df, "clade", "label_count", "parsed_n", 2,
30, "Chromosome haploid number", desiredorder1, 1, .85, 4
)
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_Cx_peaks_count_df <- make_legend_with_stats(
fabaceae_Cx_mode_counts_per_clade_df,
namecol, 1, TRUE
)
fabaceae_clade_1Cx_df$labelcountcustom <-
fabaceae_clade_Cx_peaks_count_df$labelcountcustom[match(
fabaceae_clade_1Cx_df$clade,
fabaceae_clade_Cx_peaks_count_df$clade
)]
desiredorder <- unique(fabaceae_clade_1Cx_df$clade)
dots_and_violin(
fabaceae_clade_1Cx_df, "clade", "labelcountcustom", "Cx", 3,
3, "Genome Size", desiredorder, 0.03, 0.25, 2,
"ownwork"
)
dots_and_violin(
fabaceae_clade_1Cx_df, "clade", "labelcountcustom", "Cx", 3,
3, "Genome Size", desiredorder, 0.03, 0.25, 2,
dots = FALSE
)
dots_and_violin(
fabaceae_clade_1Cx_df, "clade", "labelcountcustom", "Cx", 3,
3, "Genome Size", desiredorder, 0.03, 0.25, 2,
"ownwork",
violin = FALSE
)
[Package dotsViolin version 0.0.1 Index]