library(RMySQL) library(tidyverse) yhendus<-dbConnect(dbDriver("MySQL"), user='mart', password='ajutine1234', host='localhost', dbname='mart' ) paring<-dbSendQuery(yhendus, "SELECT production_year, COUNT(*) AS kogus FROM efis_film GROUP BY production_year") andmed=fetch(paring, n=-1) andmed$production_year=as.numeric(andmed$production_year) #andmed ggplot(andmed, aes(production_year, kogus))+geom_point()+xlab("aasta")+ylab("filmide arv")+geom_smooth() ggsave("filmikogused.png", width=25, height=20, units="cm") #jaagup@praktika1 ~/public_html/2018/kvant/02 $ Rscript baas1.R