Blog

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

Version: Français

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) Data preparation We’ll use the self-esteem score dataset measured over three time points. The data is available in the datarium package. # Wide format data("selfesteem", package = "datarium") head(selfesteem, 3) ## # A tibble: 3...

How to Perform Paired Pairwise T-tests in R

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) Data preparation We’ll use the self-esteem score dataset measured over three time points. The data is available in the datarium package. # Wide format data("selfesteem", package = "datarium") head(selfesteem, 3) ## # A tibble: 3...

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) # Prepare the data and inspect a random sample of the data mydata <- as_tibble(iris) mydata %>% sample_n(6) ## # A tibble: 6 x 5 ## Sepal.Length Sepal.Width Petal.Length Petal.Width Species ## <dbl> <dbl> <dbl>...

How to Perform T-test for Multiple Variables in R: Pairwise Group Comparisons

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) # Prepare the data and inspect a random sample of the data mydata <- as_tibble(iris) mydata %>% sample_n(6) ## # A tibble: 6 x 5 ## Sepal.Length Sepal.Width Petal.Length Petal.Width Species ## <dbl> <dbl> <dbl>...

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) # Prepare the data and inspect a random sample of the data data("PlantGrowth") set.seed(1234) PlantGrowth %>% sample_n_by(group, size = 1) ## # A tibble: 3 x 2 ## weight group ## <dbl> <fct> ## 1...

How to Perform T-test for Multiple Groups in R

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) # Prepare the data and inspect a random sample of the data data("PlantGrowth") set.seed(1234) PlantGrowth %>% sample_n_by(group, size = 1) ## # A tibble: 3 x 2 ## weight group ## <dbl> <fct> ## 1...

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) # Prepare the data and inspect a random sample of the data mydata <- iris %>% filter(Species != "setosa") %>% as_tibble() mydata %>% sample_n(6) ## # A tibble: 6 x 5 ## Sepal.Length Sepal.Width Petal.Length...

How to Perform Multiple T-test in R for Different Variables

Prerequisites # Load required R packages library(tidyverse) library(rstatix) library(ggpubr) # Prepare the data and inspect a random sample of the data mydata <- iris %>% filter(Species != "setosa") %>% as_tibble() mydata %>% sample_n(6) ## # A tibble: 6 x 5 ## Sepal.Length Sepal.Width Petal.Length...

Step 1. Load required packages library(devtools) library(rhub) Step 2. Inspect and choose R-hub platforms to run the check on rhub::platforms() ## debian-clang-devel: ## Debian Linux, R-devel, clang, ISO-8859-15 locale ## debian-gcc-devel: ## Debian Linux, R-devel, GCC ## debian-gcc-devel-nold: ## Debian Linux, R-devel, GCC, no...

How to Run CRAN Checks for a Package on R-hub

Step 1. Load required packages library(devtools) library(rhub) Step 2. Inspect and choose R-hub platforms to run the check on rhub::platforms() ## debian-clang-devel: ## Debian Linux, R-devel, clang, ISO-8859-15 locale ## debian-gcc-devel: ## Debian Linux, R-devel, GCC ## debian-gcc-devel-nold: ## Debian Linux, R-devel, GCC, no...

This article describes how to perform image processing in R using the magick R package, which is binded to ImageMagick library: the most comprehensive open-source image processing library available. The magick R package supports: Many common formats: png, jpeg, tiff, pdf, etc Different manipulations...

Easy Image Processing in R using the Magick Package

This article describes how to perform image processing in R using the magick R package, which is binded to ImageMagick library: the most comprehensive open-source image processing library available. The magick R package supports: Many common formats: png, jpeg, tiff, pdf, etc Different manipulations...

# 1. Load required R packages suppressPackageStartupMessages(library(ggpubr)) suppressPackageStartupMessages(library(rstatix)) # 2. Data preparation df <- ToothGrowth df$dose <- factor(df$dose) # 3. Statistical tests res.stats <- df %>% group_by(dose) %>% t_test(len ~ supp) %>% adjust_pvalue() %>% add_significance() res.stats ## # A tibble: 3 x 11 ##...

How to Create Stacked Bar Plots with Error Bars and P-values

# 1. Load required R packages suppressPackageStartupMessages(library(ggpubr)) suppressPackageStartupMessages(library(rstatix)) # 2. Data preparation df <- ToothGrowth df$dose <- factor(df$dose) # 3. Statistical tests res.stats <- df %>% group_by(dose) %>% t_test(len ~ supp) %>% adjust_pvalue() %>% add_significance() res.stats ## # A tibble: 3 x 11 ##...

This article describes the essentials of R coding style best practices. It’s based on the tidyverse style guide. Google’s current guide is also derived from the tidyverse style guide. Two importants R packages are available to help you in applying the R coding style...

R Coding Style Best Practices

This article describes the essentials of R coding style best practices. It’s based on the tidyverse style guide. Google’s current guide is also derived from the tidyverse style guide. Two importants R packages are available to help you in applying the R coding style...

This article describes how to read and write data from the clipboards using the R package clipr, which works well on Windows, OS X, and Unix-like systems. Note that on Linux, you will need to install the system requirement, either xclip or xsel. This...

How to Easily Read and Write Data from Clipboard in R

This article describes how to read and write data from the clipboards using the R package clipr, which works well on Windows, OS X, and Unix-like systems. Note that on Linux, you will need to install the system requirement, either xclip or xsel. This...

This article describes how to interpret the kappa coefficient, which is used to assess the inter-rater reliability or agreement. In most applications, there is usually more interest in the magnitude of kappa than in the statistical significance of kappa. The following classifications has been...

Kappa Coefficient Interpretation

This article describes how to interpret the kappa coefficient, which is used to assess the inter-rater reliability or agreement. In most applications, there is usually more interest in the magnitude of kappa than in the statistical significance of kappa. The following classifications has been...