added documentation generation instructions
added Rdoc comments