upgrade to roxygen2 4.0 doco and fix for factors
redocument
fix documentation
merge with master