library(tidyverse)
library(gapminder)
gapminder %>%
filter(country == "Afghanistan") %>%
ggplot(aes(x = year, y =lifeExp)) %>%
geom_point()
#> Error: `mapping` must be created by `aes()`
#> Did you use %>% instead of +?
library(tidyverse)
library(gapminder)
gapminder %>%
filter(country == "Afghanistan") %>%
ggplot(aes(year, lifeExp)) %>%
geom_point()
#> Error: `mapping` must be created by `aes()`
#> Did you use %>% instead of +?
library(tidyverse)
library(gapminder)
gapminder %>%
filter(country == "Afghanistan") %>%
ggplot(aes(x = year, y = lifeExp)) %>%
geom_point()
#> Error: `mapping` must be created by `aes()`
#> Did you use %>% instead of +?
library(tidyverse)
library(reprex)
library(dslabs)
data("murders")
murders %>%
group_by( region) %>%
summarise(whole_region = sum("total"))
#> Error: Problem with `summarise()` input `whole_region`.
#> x invalid 'type' (character) of argument
#> ℹ Input `whole_region` is `sum("total")`.
#> ℹ The error occurred in group 1: region = "Northeast".
murders %>%
mutate(rate = total/populatios * 10e5)
#> Error: Problem with mutate() input rate.
#> x object 'populatios' not found
#> Input rate is total/populatios * 1e+06.
I do not know why my columns aren't being created through mutate. Help!
library(reprex)
library(dslabs)
library(tidyverse)
data("murders")
murders %>%
ggplot(aes(x = state, y = population)) %>%
geom_col()
#> Error: `mapping` must be created by `aes()`
#> Did you use %>% instead of +?
I was trying to create a column for the rate of murders but I'm getting this weird code. Here is my reprex!
library(reprex)
library(dslabs)
library(tidyverse)
# Load data from dslabs (murder stats for all 50 states).
data("murders")
murders %>%
mutate(rate = tota/population*1e5)
#> Error: Problem with `mutate()` input `rate`.
#> x object 'tota' not found
#> ℹ Input `rate` is `tota/population * 1e+05`.