This is my plot

This is my code so far for the plot

#From 2004 to 2019, Canada, Buildings--#

x = (2004:2019)

y = integer(19)

y = as.double(y)

len = dim(Buildings)[1]

rng = (1:len)

for (i in rng) {

idx = strtoi(Buildings[i,2]) - 2000

y[idx] = y[idx] + as.double(Buildings[i,77])

}

y=y[04:19]

matplot(x, y, type="b", lty=4, pch = 18, col="blue",xlab="Year",

ylab="Total Emission",main = "Building Sector 2004-2019", lwd = '3')

pettittTest <- trend::pettitt.test(x = Buildings[['TotalEmi']])

print(pettittTest)

print(Buildings[['Year']][pettittTest$estimate])

Thanks in advance