Skip to content

Instantly share code, notes, and snippets.

@gonzalezgouveia
Created February 5, 2019 19:47
Show Gist options
  • Save gonzalezgouveia/3fd41769d038be68c906f348e87b6081 to your computer and use it in GitHub Desktop.
Save gonzalezgouveia/3fd41769d038be68c906f348e87b6081 to your computer and use it in GitHub Desktop.
cleaning data with dplyr
clean_data <- winedata %>%
select(country, points, price) %>%
drop_na() %>% # quitando los nulos
group_by(country) %>%
filter(n()>2000) %>% # filtrando
ungroup() %>%
mutate(log_price = log(price)) # log price
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment