Due Date: 11:59pm, Oct 25
Honor Pledge: I have recreated my group submission using using the tools I have installed on my own computer
data(EuStockMarkets) # load EuStockMarkets
dat <- as.data.frame(EuStockMarkets) # coerce it to a data frame
dat$time <- time(EuStockMarkets) # add `time` variable
longdat <- gather(dat, key = "stock", value = "price", -time)
# wide to long format
longdat$stock <-as.factor(longdat$stock)
fig <- plot_ly(longdat, x = ~time, y = ~price, type = 'scatter',
color=longdat$stock)
fig
This dataset has different measurements of penguins. It was collected and made publicly available by Dr. Kristen Gorman and the Palmer Station, Antarctica LTER, a member of the Long Term Ecological Research Network. The dataset is made up of 9 columns: species, island, bill_length_mm, bill_depth_mm, flipper_length_mm, body_mass_g, sex, and year. The dataset can be found on kaggle with this link: https://www.kaggle.com/larsen0966/penguins. The columns are explained more in depth below.
df2 <- read.csv("penguins.csv")
df2 <- gather(df2, key = penguin_att, value = value,
"bill_length_mm": "bill_depth_mm")
df2$species <- as.factor(df2$species)
fig2 <- ggplot(df2, aes(x=species, y=value, fill = species)) +
geom_boxplot() +
facet_grid(~ penguin_att) + theme_classic()+
theme(legend.position = 'None')+
labs(title = 'Boxplots for Bill Depth and Bill Length')+
xlab("Species") + ylab("Measurement in mm") +
theme(plot.title = element_text(hjust = .5))
fig2