s2(y, w)
w
var
s2(1:10) s2(1:10, rep(1:2, each = 5)) all.equal(s2(1:10), var(1:10))
Run the code above in your browser using DataCamp Workspace