# Null dimensional margin
data(coasts)
# apply function to every element manually
# memory taken by every layer
apply(coasts, MARGIN=NULL, object.size)
# double of itself
data(dems)
a<- cbind(dems, dems)
same <- apply(a, 1, sum)
Run the code above in your browser using DataLab