Last active
December 27, 2022 01:15
-
-
Save lundquist-ecology-lab/8ab1ec50853a37afb09805c9f321f7ec to your computer and use it in GitHub Desktop.
Summary statistics in R with examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculating mean, and other summary statistics in R with examples | |
# Set up | |
library(palmerpenguins) | |
data(penguins) | |
penguins <- na.omit(penguins) | |
# Mean | |
mean(penguins$bill_length_mm) | |
# Meadian | |
median(penguins$bill_length_mm) | |
# Mean, median and quartiles | |
summary(penguins$bill_length_mm) | |
# Variance | |
var(penguins$bill_length_mm) | |
# Standard deviation | |
sd(penguins$bill_length_mm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment