# DAL ToolBox # version 1.01.727 source("https://raw.githubusercontent.com/cefet-rj-dal/daltoolbox/main/jupyter.R") #loading DAL load_library("daltoolbox") load_library("RColorBrewer") #color palette colors <- brewer.pal(4, 'Set1') load_library("ggplot2") # setting the font size for all charts font <- theme(text = element_text(size=16)) # example4: dataset to be plotted example <- data.frame(exponential = rexp(100000, rate = 1), uniform = runif(100000, min = 2.5, max = 3.5), normal = rnorm(100000, mean=5)) head(example) options(repr.plot.width=8, repr.plot.height=5) grf <- plot_density(example, colors=colors[1:3]) + font plot(grf) load_library("dplyr") grfe <- plot_density(example |> select(exponential), label_x = "exponential", color=colors[1]) + font grfu <- plot_density(example |> select(uniform), label_x = "uniform", color=colors[2]) + font grfn <- plot_density(example |> select(normal), label_x = "normal", color=colors[3]) + font load_library("gridExtra") options(repr.plot.width=15, repr.plot.height=4) grid.arrange(grfe, grfu, grfn, ncol=3)