Created
August 20, 2019 19:47
-
-
Save JosiahParry/fc17a15d8931a1d9bb48b7c439b46d8a to your computer and use it in GitHub Desktop.
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
library(sqldf) | |
library(tidyverse) | |
polls <- read_csv("https://raw.githubusercontent.com/JosiahParry/r-4-campaigns/master/data/polls.csv") | |
sqldf("select candidate, count(*) as n | |
from polls | |
where points > 20 | |
group by candidate | |
order by n desc") | |
polls %>% | |
filter(points > 20) %>% | |
count(candidate, sort = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment