library(ggplot2) prices = read.csv("mieszkania.tsv", sep="\t", header=TRUE) prices$area = prices$powierzchnia prices$price = prices$cena pdf("linregr2.pdf") ggplot(prices, aes(x=area, y=price)) + geom_point() + stat_smooth(method=lm, se=FALSE) dev.off()