library(openxlsx) sample1<-read.xlsx("http://kanggc.iptime.org/book/data/sample1-n.xlsx") year<-sample1$year gdp<-sample1$gdp consumption<-sample1$consumption gdp consumption par(mfrow=c(2,1)) plot(year, gdp, type="l", main="GDP of Korea(2000-2016)") plot(year, consumption, type="l", lty=2,main="Consumption of Korea(2000-2016)") par(mfrow=c(1,2)) hist(gdp) hist(consumption, breaks=8, col="red") par(mfrow=c(1,1)) plot(gdp, consumption, main="Scatter plot of GDP and Consumption")