Interactive visualization of Roxygen help

roxygen2

#1

G'day mates:

I have recently installed RStudio for doing some test of a few small lectures I will gave as an introductory kind of course (more like a side part of another ocurse in which we use R)

I found the way to make automated Roxy skeletons, but I wonder if there is a keybind or something to open the roxy skeleton in html format in the help panel of RStudio (or in a web browser) interactively.

For example, with this dummy function:

 ##' Function to scale variables
 ##'
 ##' Rescale function scale numerical vectors by subtracting the original mean and dividing by the standard deviation
 ##' @title Rescale
 ##' @param Data the original vector to be scaled
 ##' @return a numerical vector 
 ##' @author Fer
 Rescale <- function(Data){
   ScaledData <- (Data - mean(Data)) / sd(Data)
   return(ScaledData)
 }

I would like to get something like:

Either in The RStudio IDE or in a web browser (the screenshot is from a browser)

cheers and thanks in advance
Fer


#2

I don't think there is such a way. Usually, what you do is first run "Document" with, for example, Ctrl + Shift + D or Cmd + Shift + D on Mac. This will create Markdown (md) files. Then you can see your function inside of "Help" pane with normal ?Rescale.

I don't know how much that helps, but that the workflow I usually have. This is also the recommended workflow in "R Packages" book.


#3

Thanks!. I am completely new to RStudio and everything around it. I choose it as it is the most documented IDe, and the most commonly used, so better for anyone with no exposure to R at all. but I struggle a bit trying to make working some of the stuff I want to show the students.