Which plants are better for bees: native or non-native?
📖 Background
You work for the local government environment agency and have taken on a project about creating pollinator bee-friendly spaces. You can use both native and non-native plants to create these spaces and therefore need to ensure that you use the correct plants to optimize the environment for these bees.
The team has collected data on native and non-native plants and their effects on pollinator bees. Your task will be to analyze this data and provide recommendations on which plants create an optimized environment for pollinator bees.
💾 The Data
You have assembled information on the plants and bees research in a file called plants_and_bees.csv
. Each row represents a sample that was taken from a patch of land where the plant species were being studied.
Column | Description |
---|---|
sample_id | The ID number of the sample taken. |
species_num | The number of different bee species in the sample. |
date | Date the sample was taken. |
season | Season during sample collection ("early.season" or "late.season"). |
site | Name of collection site. |
native_or_non | Whether the sample was from a native or non-native plant. |
sampling | The sampling method. |
plant_species | The name of the plant species the sample was taken from. None indicates the sample was taken from the air. |
time | The time the sample was taken. |
bee_species | The bee species in the sample. |
sex | The gender of the bee species. |
specialized_on | The plant genus the bee species preferred. |
parasitic | Whether or not the bee is parasitic (0:no, 1:yes). |
nesting | The bees nesting method. |
status | The status of the bee species. |
nonnative_bee | Whether the bee species is native or not (0:no, 1:yes). |
Source (data has been modified)
suppressPackageStartupMessages(library(tidyverse))
data <- readr::read_csv("data/plants_and_bees.csv", show_col_types = FALSE)
data
Part 1 - Plant Preference by Native and Non-Native Bees
library(tidyverse)
data <- readr::read_csv("data/plants_and_bees.csv", show_col_types = FALSE)
data %>% group_by(native_or_non, plant_species) %>% summarise(count = n()) %>% arrange(desc(count)) %>% print(n=25)
Native Species Plant Preference:
- Given the data in the table, native species prefer the following plants: Rudbeckia hirta, Chamaecrista fasciculata, Helenium flexuosum, Asclepia tuberosa, Penstemon digitalis, Rudbeckia triloba, Monarda punctata, Pycanthemum tenuifolium.
Non-Native Species Plant Preference:
- Given the data in the table, non-native species prefer the following plants: Leucanthemum vulgare, Melilotus officinalis, Cichorium intybus, Trifolium pratense, Coronilla varia, Cosmos bipinnatus, Trifolium repens, Agastache foeniculum, Lobularia maritima, Lotus corniculatus, Trifolium incarnatum, Viola cornuta, and Origanum vulgare.
Part 2 - Bee and Plant Species Distribution
library(tidyverse)
data <- readr::read_csv("data/plants_and_bees.csv", show_col_types = FALSE)
bee_plant_subset <- data %>% filter(sample_id == 17439)
ggplot(bee_plant_subset, aes(x = str_wrap(bee_species, width = 10))) +
geom_bar(fill = "blue", color = "black") +
labs(x = "Bee Species", y = "Count") +
ggtitle("Distribution of Bee Species in Sample 17439") +
scale_x_discrete(guide = guide_axis(n.dodge = 1, angle = 45))
library(tidyverse)
data <- readr::read_csv("data/plants_and_bees.csv", show_col_types = FALSE)
bee_plant_subset <- data %>% filter(sample_id == 17439)
ggplot(bee_plant_subset, aes(x = str_wrap(plant_species, width = 10))) +
geom_bar(fill = "blue", color = "black") +
labs(x = "Plant Species", y = "Count") +
ggtitle("Distribution of Plant Species in Sample 17413") +
scale_x_discrete(guide = guide_axis(n.dodge = 1, angle = 45))
Part 3 - Recommendations to Support Native Bee Population Growth
library(tidyverse)
data <- readr::read_csv("data/plants_and_bees.csv", show_col_types = FALSE)
data %>% group_by(native_or_non, plant_species) %>% summarise(count = n()) %>% arrange(desc(count)) %>% print(n=25)
Top 3 Plant Species to Support Native Bees
- Given the data in the table, the following plant species are recommended to support native bees: rudbeckia hirta, chamaecrista fasciculata, and helenium flexuosum.