Update Functionals.rmd

clarified explanation of sweep() example code and changed code so it does what example describes.