Last active
February 16, 2023 18:41
-
-
Save lundquist-ecology-lab/e51c65c9f15de7fd360a7cbe40b92b03 to your computer and use it in GitHub Desktop.
How to subset data in R
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
# Subsetting data in R | |
# Subset Iris data into a dataframe with only one species | |
virginica <- subset(iris, iris$Species == "virginica") | |
# Subset a particular vector with only the values from a particular group | |
virginica_sepals <- iris$Sepal.Length[iris$Species == "virginica"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment