How to Calculate Summary Statistics in R DataFrame
- R-PROGRAMMING
To calculate summary statistics in R, you can use two different function in R.
The following methods show how you can do it with syntax.
Method 1: Use summary() Function
summary(data) Method 2: Use summarize() Function from dplyr Package
library(dplyr) summary <- df %>% summarize( Mean = mean(colum1), Median = median(colum1), Min = min(colum1), Max = max(colum1), StdDev = sd(colum1), Variance = var(colum1), ) The following examples show how use this methods to calculate summary statistics in R.