rfswick / eds221-day9-activities

Materials for EDS 221 Activities - Day 9
0 stars 0 forks source link

ggplot issue #2

Open rfswick opened 2 months ago

rfswick commented 2 months ago
mack_creek <- data.frame(
  stringsAsFactors = FALSE,
                                    length1 = c(58,61,89,
                                                58,93,86,107,131,103,117),
                                    species = c("ONCL",
                                                "ONCL","ONCL","ONCL","ONCL",
                                                "ONCL","ONCL","ONCL","ONCL",
                                                "ONCL"),
                                     weight = c(1.75,1.95,
                                                5.6,2.15,6.9,5.9,10.5,20.6,
                                                9.55,13)
               )

mack_creek %>% 
  clean_names() %>% 
  filter(species == "ONCL") |>
  ggplot(aes(x = length1, y = weight)) +
         geom_point(aes(shape = 12), color = "purple") +
         theme_minimal() +
         labs(x = "Cutthroat trout length (cm)",
              y = "Weight (g)")
#> Error in ggplot(mack_creek %>% clean_names() %>% filter(species == "ONCL"), : could not find function "ggplot"

Created on 2024-08-22 with reprex v2.1.1

rfswick commented 2 months ago

geom_point(color = "purple", shape = 12)`

move shape outside of aes