Q: Hand calculated Variogram in R I am trying to calculate a variogram in R by "hand" to create a vector of several values at different lags, k. 
Essentially I am trying to calculate this:
Gk = Var (yt+k − yt)/ Var (yt+1 − yt), k = 1, 2, … , 12 

Where the time series observations are represented by yt.
My attempt below (where diff.df is a vector of differenced data length 72.
k <- seq(1,12,1)
x <- seq(1,length(diff.df)-length(k),1)    
vario <- var(diff.df[x+k,]-diff.df[x,])/ var(diff.df[x+1,]-dif[x])

is producing an error of "incorrect number of dimensions"
I'm unsure what I am doing wrong here. any help would be appreciated.
Thanks.

A: I realized that I was acting as if the vector was a data frame ([x,] as opposed to simply looking up index of x, [x]) 
for (i in 1:70){
x <- seq(1,71-i,1)
vario[i] <- var(diff2.df[x+i]-diff2.df[x])/ var(diff2.df[x+1]-diff2.df[x])
}
vario
plot(vario,type = 'l',xlab = 'Lag', ylab = 'Variogram')

is the final working code for anyone that cares.
