Re: [ESS] Working with Roxygen2

2023-06-27 Thread Vikas Rawal via ESS-help
>
>
> and save it, ESS mode offers in menu ESS an entry Roxygen with first option
> Generate/Update Template and keyboard shortcut C-c C-o C-o (in my version).
> That has been here since _forever_.  Invoking it adds this header above
>
> Oops. I did not look at the most obvious place!!

and that is 'Good Enough for Me (TM)'.  I can't remember if I had to set an
> Emacs variable to have my username come up or if ESS queries my Linux host
> but it is all quite nicely done.
>
> Indeed. Thanks.

Cheers,

V.

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Working with Roxygen2

2023-06-27 Thread Dirk Eddelbuettel via ESS-help


On 28 June 2023 at 06:49, Vikas Rawal via ESS-help wrote:
| I am trying to build my first R package, and am using Roxygen2 to document
| the functions. I was wondering if there is anything that would provide a
| boilerplate template? Maybe a yasnippet or something better?

There is and AFAIK always has been.

I.e. when I open a new file /tmp/pyth.R and add

pyth <- function(x, y) {
sqrt(x^2 + y^2)
}

and save it, ESS mode offers in menu ESS an entry Roxygen with first option
Generate/Update Template and keyboard shortcut C-c C-o C-o (in my version).
That has been here since _forever_.  Invoking it adds this header above

##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##' @title 
##' @param x 
##' @param y 
##' @return 
##' @author Dirk Eddelbuettel
pyth <- function(x, y) {
sqrt(x^2 + y^2)
}

and that is 'Good Enough for Me (TM)'.  I can't remember if I had to set an
Emacs variable to have my username come up or if ESS queries my Linux host
but it is all quite nicely done.

Hth, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] Working with Roxygen2

2023-06-27 Thread Vikas Rawal via ESS-help
Hi everyone.

I am trying to build my first R package, and am using Roxygen2 to document
the functions. I was wondering if there is anything that would provide a
boilerplate template? Maybe a yasnippet or something better?

Thanks,

V.

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help