One of the initial steps was getting familiar with the Palmer Penguins dataset. As a dataset with multiple attributes that could be meaningfully visualized (e.g., bill measurements, flipper length, body mass), it provided ample opportunity for analysis and rich insights into penguin biology.
Choosing the right visualizations was crucial. The scatter plot effectively illustrated the relationship between bill length and depth, while the box plot provided a clear comparison of flipper lengths across species. The density plot for body mass by sex added depth to the analysis. Each visualization was selected to facilitate intuitive understanding and reveal patterns in the data.
Integrating interactivity using plotly significantly enhanced the user experience. Crafting informative tooltips was a rewarding challenge, emphasizing the need for clarity in presenting data-driven narratives. This interactivity allowed users to delve deeper into the dataset, fostering engagement and exploration.
Designing the dashboard layout with flexdashboard was another valuable learning experience. It required thoughtful organization to balance aesthetic appeal with functionality. The sidebar provided context, while the arrangement of charts facilitated easy comparison.
library(tidyverse)
library(plotly)
# Load data here
# Load your Kaggle CSV file
data <- read.csv("data/palmerpenguins_original.csv")
# Preview the data to understand its structure
head(data)
Do the following:
Make a plot. Any kind of plot will do (though it might be easiest
to work with geom_point()).
Make the plot interactive with ggplotly().
Make sure the hovering tooltip is more informative than the default.
Good luck and have fun!
# Create a scatter plot
plot <- ggplot(data, aes(x = flipper_length_mm, y = body_mass_g, color = species,
text = paste("Species:", species,
"<br>Island:", island,
"<br>Flipper Length (mm):", flipper_length_mm,
"<br>Body Mass (g):", body_mass_g))) +
geom_point() +
labs(title = "Flipper Length vs Body Mass of Palmer Penguins",
x = "Flipper Length (mm)", y = "Body Mass (g)") +
theme_minimal()
# Make the plot interactive with ggplotly
interactive_plot <- ggplotly(plot, tooltip = "text")
# Display the interactive plot
interactive_plot