lab09_theme = theme_bw() + 
  theme(text = element_text(family = "serif", size = 12))

Plotly Graph

## Change this to read in whatever data you're using
covid = read_csv("covid_data.csv")
## Parsed with column specification:
## cols(
##   signal = col_character(),
##   geo_value = col_character(),
##   time_value = col_date(format = ""),
##   value = col_double(),
##   stderr = col_double(),
##   sample_size = col_double()
## )
covid %>%
  group_by(geo_value, signal) %>%
  summarize(
    avg = mean(value, na.rm = T)
  ) %>%
  pivot_wider(id_cols = geo_value, names_from = signal, values_from = avg) %>%
  ungroup() -> state_avg
## `summarise()` regrouping output by 'geo_value' (override with `.groups` argument)
## Change this to make your plot

p2 = state_avg %>%
    mutate(state = str_to_upper(geo_value)) %>%
    ggplot(aes(x = smoothed_wearing_mask, y = smoothed_cli)) +
    geom_point(aes(text = toupper(geo_value))) + 
    theme_minimal()
## Warning: Ignoring unknown aesthetics: text
ggplotly(p2, tooltip = "text")
p1 = state_avg %>%
    mutate(state = str_to_upper(geo_value)) %>%
    ggplot(aes(x = smoothed_wearing_mask, y = smoothed_cli)) +
    geom_point() + 
    theme_minimal()

ggplotly(p1)
p2 = state_avg %>%
    mutate(state = str_to_upper(geo_value)) %>%
    ggplot(aes(x = smoothed_wearing_mask, y = smoothed_cli)) +
    geom_point(aes(text = toupper(geo_value))) + 
    theme_minimal()
## Warning: Ignoring unknown aesthetics: text
ggplotly(p2, tooltip = "text")

Part 2 The first graph below is a scatter plot that I used in Lab 2. The graph below that uses plotly.

ggplot(starwars, 
       aes(x = height, y = mass, color = gender, size = birth_year)) +
  geom_point(color = "#30509C") +
  labs(
    title = "Distribution of Heights and Masses of Stars Wars Characters",
    x = "Height", 
    y = "Mass",
    size = "Birth Year"
    )+
  lab09_theme
## Warning: Removed 51 rows containing missing values (geom_point).

p3 = starwars %>%
    #mutate( name= str_to_upper(name)) %>%
    ggplot(aes(x = height, y = mass)) +
    geom_point(aes(text = toupper(name))) + 
    theme_minimal()+
    labs(title="Trend of Heights and Masses of Stars Wars Characters",
         x="Height",y="Mass")+
    lab09_theme 
## Warning: Ignoring unknown aesthetics: text
ggplotly(p3, tooltip = "text")