dplyr and torrents from cpasbien

32
dplyr [email protected] Romain François

Transcript of dplyr and torrents from cpasbien

Page 1: dplyr and torrents from cpasbien

dplyr

[email protected]

Romain François

Page 2: dplyr and torrents from cpasbien
Page 3: dplyr and torrents from cpasbien
Page 4: dplyr and torrents from cpasbien

...

$ wc -l R/*.R | tail -n1 3576 total $ wc -l src/*.cpp | tail -n1 4908 total $ wc -l **/*.h | tail -n1 8908 total

Page 5: dplyr and torrents from cpasbien

dis playa

Page 6: dplyr and torrents from cpasbien

DEEP LIAR

Page 7: dplyr and torrents from cpasbien

%>%(païpe)

Page 8: dplyr and torrents from cpasbien

verbe( sujet, complement )

sujet %>% verbe( complement )

Page 9: dplyr and torrents from cpasbien
Page 10: dplyr and torrents from cpasbien

enjoy(cool(bake(shape(beat(append(bowl(rep("flour", 2), "yeast", "water", "milk", "oil"), "flour", until = "soft"), duration = "3mins"), as = "balls", style = "slightly-flat"), degrees = 200, duration = "15mins"), duration = "5mins"))

bowl(rep("flour", 2), "yeast", "water", "milk", "oil") %>% append("flour", until = "soft") %>% beat(duration = "3mins") %>% shape(as = "balls", style = "slightly-flat") %>% bake(degrees = 200, duration = "15mins") %>% cool(buns, duration = "5mins") %>% enjoy()

Page 11: dplyr and torrents from cpasbien

Vocabulary

Page 12: dplyr and torrents from cpasbien

filterx y

purple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

x ypurple 2purple 3purple 6

data %>% filter( x == "purple" )

Page 13: dplyr and torrents from cpasbien

mutatex y

purple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

data %>% mutate( y = y*2, z = nchar(x) )

x y zpurple 4 6purple 6 6

red 8 3red 10 3

purple 12 6yellow 14 6yellow 16 6

Page 14: dplyr and torrents from cpasbien

selectx y

purple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

data %>% select( x )

xpurplepurple

redred

purpleyellowyellow

Page 15: dplyr and torrents from cpasbien

arrangex y

purple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

data %>% arrange( desc(x) )

x yyellow 8yellow 7purple 6

red 5red 4

purple 3purple 2

Page 16: dplyr and torrents from cpasbien

group_by

x ypurple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

x ypurple 2purple 3purple 6

data %>% group_by( x )

x y

red 4

red 5

x yyellow 7yellow 8

Page 17: dplyr and torrents from cpasbien

summarise

x ypurple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

summarise( data, z = min(y) )

z

2

Page 18: dplyr and torrents from cpasbien

group_by + summarise

x ypurple 2purple 3

red 4red 5

purple 6yellow 7yellow 8

x ypurple 2purple 3purple 6

data %>% group_by( x )%>% summarise( z = max(y) )

x y

red 4

red 5

x yyellow 7yellow 8

x z

purple 6

red 5

yellow 8

Page 19: dplyr and torrents from cpasbien
Page 20: dplyr and torrents from cpasbien

Mise en garde :

comme son nom l'indique ...

Page 21: dplyr and torrents from cpasbien

install_github( "romainfrancois/cpasbien" ) library("cpasbien") movies <- get_all_movies( pages = 1:20 ) episodes <- get_all_episodes( pages = 1:20 )

Page 22: dplyr and torrents from cpasbien

> glimpse( movies ) Observations: 600 Variables: 11 $ type <chr> "policiers-thrillers", "policiers-thrillers", "policiers-thr... $ title <chr> "Oppression", "Oppression", "Oppression", "Oppression", "Ret... $ year <chr> "2016", "2016", "2016", "2016", "2016", "2016", "2016", "201... $ lang <chr> "french", "french", "french", "french", "french", "french", ... $ quality <chr> "dvdrip", "dvdrip-x264", "bluray-1080p", "bluray-720p", "dvd... $ size <dbl> 710, 345, 7885, 4506, 701, 632, 696, 701, 1434, 4710, 1434, ... $ up <dbl> 2928, 285, 223, 330, 5541, 522, 2329, 8362, 4835, 1157, 261,... $ down <dbl> 188, 18, 62, 54, 236, 17, 90, 400, 452, 159, 27, 29, 126, 66... $ torrent <chr> "http://www.cpasbien.cm/telechargement/oppression-french-dvd... $ poster <chr> "http://www.cpasbien.cm/_pictures/oppression-french-dvdrip-2... $ href <chr> "http://www.cpasbien.cm/dl-torrent/films/policiers-thrillers...

> glimpse( episodes ) Observations: 569 Variables: 11 $ show <chr> "NCIS New Orleans ", "Hawaii 5-0 (2010) ", "Van Helsing ", "... $ season <dbl> 2, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 27, 27, 1, 2, 4, 1, 3, 3... $ episode <dbl> 17, 1, 2, 12, 11, 10, 2, 6, 5, 1, 4, 2, 3, 2, 1, 2, 1, 1, 1,... $ lang <chr> "french", "vostfr", "vostfr", "french", "french", "french", ... $ quality <chr> "hdtv", "hdtv", "hdtv", "hdtv", "hdtv", "hdtv", "hdtv", "hdt... $ size <dbl> 351, 367, 356, 344, 348, 336, 230, 346, 346, 368, 347, 347, ... $ up <dbl> 131, 204, 717, 1143, 1081, 1222, 235, 700, 658, 295, 648, 38... $ down <dbl> 22, 20, 45, 144, 132, 154, 14, 49, 61, 20, 48, 18, 4, 5, 32,... $ torrent <chr> "http://www.cpasbien.cm/telechargement/l-m-n/ncis-new-orlean... $ poster <chr> "http://www.cpasbien.cm/_pictures/l-m-n/ncis-new-orleans-s02... $ href <chr> "http://www.cpasbien.cm/dl-torrent/series/l-m-n/ncis-new-orl...

Page 23: dplyr and torrents from cpasbien

Les comédies les plus téléchargées en ce moment

en qualité dvdrip

Page 24: dplyr and torrents from cpasbien

Les comédies les plus téléchargées en ce moment

en qualité dvdrip

movies %>% filter( grepl( "comedies", type ), quality == "dvdrip" ) %>% arrange( desc(down) )

Page 25: dplyr and torrents from cpasbien

Les films d'animation en meilleure qualité possible

(mais pas dvdscr) en français

Page 26: dplyr and torrents from cpasbien

movies %>% filter( grepl("animation", type), lang == "french", quality != "dvdscr" ) %>% select(-type, -lang) %>% group_by(title) %>% filter(size == max(size))

Page 27: dplyr and torrents from cpasbien

Le dernier episode disponible de chaque série en VO

Page 28: dplyr and torrents from cpasbien

episodes %>% filter( lang == "vostfr" ) %>% group_by( show ) %>% filter( season == max(season) ) %>% filter( episode == max(episode) ) %>% arrange(desc(up))

Le dernier episode disponible de chaque série en VO

Page 29: dplyr and torrents from cpasbien

episodes %>% filter( lang == "vostfr" ) %>% group_by( show ) %>% filter( season == max(season) ) %>% filter( episode == max(episode) ) %>%

filter( episode == 1 ) %>% arrange( desc(up) )

... les séries d'automne ...

Page 31: dplyr and torrents from cpasbien

Demolibrary("cpasbien") library("shiny")

runApp( system.file("app", package = "cpasbien") )

Page 32: dplyr and torrents from cpasbien