expandrows function added
Changed "VAR" to ".var"
Code formatting cleanup from roxygen