library(openxlsx) excel_sample1<-read.xlsx("http://kanggc.iptime.org/book/data/sample1-n.xlsx") excel_sample1 excel_sample1_dat<- data.matrix(excel_sample1) excel_sample1_dat year<-excel_sample1_dat[,1] gdp<-excel_sample1_dat[,2] consumption<-excel_sample1_dat[,3] summary(excel_sample1_dat)