Density plots
Metabolites and lipids descriptive statistical analysis in R
Preparing density plots via DataExplorer (level: basic)
# Calling library:
library(DataExplorer)
# Reading about plot_density:
?plot_density()
# Preparing plot - PLOT A
data %>%
filter(Label == 'N') %>%
select(`SM 41:1;O2`) %>%
plot_density(theme_config =
list(panel.background = element_blank(),
axis.line.x = element_line(color = 'black'),
axis.line.y = element_line(color = 'black')),
geom_density_args = list(color = 'royalblue', linewidth = 1)
)
# Preparing plot - PLOT B
data %>%
filter(Label == 'T') %>%
select(`SM 41:1;O2`) %>%
plot_density(theme_config =
list(panel.background = element_blank(),
axis.line.x = element_line(color = 'black'),
axis.line.y = element_line(color = 'black')),
geom_density_args = list(color = 'red2', linewidth = 1)
)
Preparing density plots via ggpubr (level: intermediate)

Preparing density plots via ggplot2 (level: advanced)




Last updated
