daten_D <- read.csv("/home/tobi/Desktop/Tobi/data/worldbank_D.csv", header=TRUE, sep=";") result <- lm(GDP.growth ~ GDP,data=daten_D) summary(result) # Setup empty plot window plot(0, type = "n", main = "Unser Plot", xlab = "X Achse (Jahr)", ylab = "Y Achse", xlim = c(2000,2004), ylim = c(-1,3)) grid() # add grid lines(daten_D$year, daten_D$Exports, lty = 3) # draw Exports lines(daten_D[,1], daten_D[,3], lty = 1) # draw third dataset lines(daten_D[,1], daten_D[,4], lty = 2) # draw fourth dataset legend("topright", c("GDP growth", "Inflation", "Exports"), lty = c(1, 2) )