Blog

We provide practical tutorials on data mining, visualization and statistics for decision making.

Version: Français

library(ggpubr) # Create a basic plot p <- ggscatter(mtcars, x = "wt", y = "mpg") p # Increase the number of ticks p + scale_x_continuous(breaks = get_breaks(n = 10)) + scale_y_continuous(breaks = get_breaks(n = 10)) # Set ticks according to a specific step, starting...

How to Easily Set Axis Ticks Number for Numeric Variables

library(ggpubr) # Create a basic plot p <- ggscatter(mtcars, x = "wt", y = "mpg") p # Increase the number of ticks p + scale_x_continuous(breaks = get_breaks(n = 10)) + scale_y_continuous(breaks = get_breaks(n = 10)) # Set ticks according to a specific step, starting...

  This article describes how to add p-values generated elsewhere to a ggplot using the ggpubr package. The following key ggpubr functions will be used: stat_pvalue_manual(): Add manually p-values to a ggplot, such as box blots, dot plots and stripcharts. geom_bracket(): Add brackets with...

GGPUBR: How to Add P-Values Generated Elsewhere to a GGPLOT

  This article describes how to add p-values generated elsewhere to a ggplot using the ggpubr package. The following key ggpubr functions will be used: stat_pvalue_manual(): Add manually p-values to a ggplot, such as box blots, dot plots and stripcharts. geom_bracket(): Add brackets with...

This articles describes how to create and customize an interactive heatmap in R using the heatmaply R package, which is based on the ggplot2 and plotly.js engine. Contents: Prerequisites Data preparation Basic heatmap Split rows and columns dendrograms into k groups Change color palettes...

How to Create a Beautiful Interactive Heatmap in R

This articles describes how to create and customize an interactive heatmap in R using the heatmaply R package, which is based on the ggplot2 and plotly.js engine. Contents: Prerequisites Data preparation Basic heatmap Split rows and columns dendrograms into k groups Change color palettes...

This article describes seriation methods, which consists of finding a suitable linear order for a set of objects in data using loss or merit functions. There are different seriation algorithms. The input data can be either a dissimilarity matrix or a standard data matrix....

Seriation in R: How to Optimally Order Objects in a Data Matrice

This article describes seriation methods, which consists of finding a suitable linear order for a set of objects in data using loss or merit functions. There are different seriation algorithms. The input data can be either a dissimilarity matrix or a standard data matrix....

Data normalization methods are used to make variables, measured in different scales, have comparable values. This preprocessing steps is important for clustering and heatmap visualization, principal component analysis and other machine learning algorithms based on distance measures. This article describes the following data rescaling...

How to Normalize and Standardize Data in R for Great Heatmap Visualization

Data normalization methods are used to make variables, measured in different scales, have comparable values. This preprocessing steps is important for clustering and heatmap visualization, principal component analysis and other machine learning algorithms based on distance measures. This article describes the following data rescaling...

Missing values are generally represented by NA in a data frame. Here, we will describe how to visualize missing data in R using an interactive heatmap. Contents: Prerequisites Show missing values in R Prerequisites Install the heatmaply R package: install.packages("heatmaply"). Show missing values in...

How to Visualize Missing Data in R using a Heatmap

Missing values are generally represented by NA in a data frame. Here, we will describe how to visualize missing data in R using an interactive heatmap. Contents: Prerequisites Show missing values in R Prerequisites Install the heatmaply R package: install.packages("heatmaply"). Show missing values in...

This articles describes how to create an interactive correlation matrix heatmap in R. You will learn two different approaches: Using the heatmaply R package Using the combination of the ggcorrplot and the plotly R packages. Contents: Prerequisites Data preparation Correlation heatmaps using heatmaply Load...

How to Create an Interactive Correlation Matrix Heatmap in R

This articles describes how to create an interactive correlation matrix heatmap in R. You will learn two different approaches: Using the heatmaply R package Using the combination of the ggcorrplot and the plotly R packages. Contents: Prerequisites Data preparation Correlation heatmaps using heatmaply Load...

# Load required R packages library(ggpubr) library(rstatix) # Data preparation df <- tibble::tribble( ~sample_type, ~expression, ~cancer_type, ~gene, "cancer", 25.8, "Lung", "Gene1", "cancer", 25.5, "Liver", "Gene1", "cancer", 22.4, "Liver", "Gene1", "cancer", 21.2, "Lung", "Gene1", "cancer", 24.5, "Liver", "Gene1", "cancer", 27.3, "Liver", "Gene1", "cancer", 30.9, "Liver",...

GGPUBR: How to Add Adjusted P-values to a Multi-Panel GGPlot

# Load required R packages library(ggpubr) library(rstatix) # Data preparation df <- tibble::tribble( ~sample_type, ~expression, ~cancer_type, ~gene, "cancer", 25.8, "Lung", "Gene1", "cancer", 25.5, "Liver", "Gene1", "cancer", 22.4, "Liver", "Gene1", "cancer", 21.2, "Lung", "Gene1", "cancer", 24.5, "Liver", "Gene1", "cancer", 27.3, "Liver", "Gene1", "cancer", 30.9, "Liver",...

This article describes how to publish a reproducible example from R to the datanovia website using the pubr package. The goal of pubr R package is to convert reproducible R scripts and Rmd contents into a publishable HTML block. It makes it easy to...

Publish Reproducible Examples from R to Datanovia Website

This article describes how to publish a reproducible example from R to the datanovia website using the pubr package. The goal of pubr R package is to convert reproducible R scripts and Rmd contents into a publishable HTML block. It makes it easy to...

Requirements: dplyr v>=1.0.0 library(dplyr) # Data preparation df <- tibble(w = 0:2, x = 1:3, y = c("a", "b", "c"), z = c("d", "e", "f")) df ## # A tibble: 3 x 4 ## w x y z ## <int> <int> <chr> <chr> ##...

dplyr: How to Change the Order of Columns in Data Frame

Requirements: dplyr v>=1.0.0 library(dplyr) # Data preparation df <- tibble(w = 0:2, x = 1:3, y = c("a", "b", "c"), z = c("d", "e", "f")) df ## # A tibble: 3 x 4 ## w x y z ## <int> <int> <chr> <chr> ##...