0

I am docummenting a dataset using roxygen2 (for my package development). I am trying to put cube meter (m^2) as a unit for one of my variable but it remains the same (m^2) when I am trying to see the documentation ?data. How can I generate units inside roxygen2?

Thank you

  • m^2 would be square meters. It's also not clear to me what your issue is. Are you saying you want the m^3 to show up with the 3 formatted as an actual exponent? If so what documents do you want that in? Just the help files? – Dason Jan 03 '22 at 15:07
  • @Dason, yes exactly I want m^3 written inside the roxygen to show up with the 3 formatted as an actual exponent (sorry I put 2 instead of 3) – Mayssa Harfouch Jan 03 '22 at 15:14

1 Answers1

0

You should use this line:

\ifelse{html}{\out{m<sup>2</sup>}}{\eqn{m^2}}   

You need to keep in mind that Roxygen is used to produce by HTML and PDF versions of your documentation. The first statement in the ifelse will be for the HTML, the second will be for PDF.