Last active
May 12, 2020 10:53
-
-
Save mxeliezer/bfd96606e75209e6a5c35b61c3ac5081 to your computer and use it in GitHub Desktop.
R Script: learning to filter with 'dplyr'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# _██_ | |
# ‹(●̮•)› | |
# (█) | |
# / | | |
# R Script based on Data Science Live exercises, by Rob Campanell (org.). | |
# Episode 1: Filter | |
# Avaliable from: http://datasciencelive.com/post/2020/05/01/episode1filter/ | |
# ===== Librarys used ================================= # | |
library(dplyr) | |
library(readr) | |
# ===== Reading Data From URL ========================= # | |
seattle_art <- read_csv("https://data.seattle.gov/api/views/j7sn-tdzk/rows.csv?accessType=DOWNLOAD") | |
# ===== Filtering the Instalation: Classification ===== # | |
installation <- seattle_art %>% # reading this %>% as 'and then'. | |
filter(classification == 'Installation') %>% | |
distinct() # to eliminate the duplicates. | |
# ===== Filtering the Environments: Classification ===== # | |
environments <- seattle_art %>% | |
filter(classification == 'Environments') %>% | |
distinct() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment