library(tidyverse) library(RMySQL) yhendus<-dbConnect(dbDriver("MySQL"), user="if16", password="ifikad16", host="localhost", dbname='if16_film') paring<-dbSendQuery(yhendus, "SELECT id, production_year FROM efis_film") filmiandmed=fetch(paring, n=-1) head(filmiandmed) filmiandmed %>% group_by(production_year) %>% summarise(kogus=n()) %>% arrange(desc(kogus))