Write R documentation