g = sk_validate(list(gval=stats::rnorm(4^2), gdim=4, gres=0.5))
# verify a trig identity using Ops and Math
summary( cos(g)^2 + sin(g)^2 )
# create a logical grid indicating points satisfying a condition
plot(g < 0)
all( !(g > 0) == (g[] < 0) )
# test negation
all( (-g)[] == -(g[]) )
Run the code above in your browser using DataLab