Hi, Im a beginner/re-lerarner and immeaditly run into waht is probably an easy problem when maniulating data.
Tried following this video.(https://www.youtube.com/watch?v=nRtp7wSEtJA&list=PLtL57Fdbwb_Chn-dNR0qBjH3esKS2MXY3&index=5) with the following code. But dont get any output in the console.
library(tidyverse)
view(starwars)
starwars %>%
select(gender, mass, height, species) %>%
filter(species == "human") %>%
na.omit() %>%
mutate(height= height/100) %>%
mutate(BMI = mass/height^2) %>%
group_by(gender) %>%
summarise(average_BMI=mean(BMI)) %>%
view(average_BMI)
output:
starwars %>%
- select(gender, mass, height, species) %>%
- filter(species == "human") %>%
- na.omit() %>%
- mutate(height= height/100) %>%
- mutate(BMI = mass/height^2) %>%
- group_by(gender) %>%
- summarise(average_BMI=mean(BMI))
A tibble: 0 × 2
2 variables: gender , average_BMI
starwars %>%
- select(gender, mass, height, species) %>%
- filter(species == "human") %>%
- na.omit() %>%
- mutate(height= height/100) %>%
- mutate(BMI = mass/height^2) %>%
- group_by(gender) %>%
- summarise(average_BMI=mean(BMI)) %>%
- view(average_BMI)
Error: object 'average_BMI' not found