[R] Arguments in functions when packaging

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jan 28 11:08:19 CET 2014


On 14-01-28 2:48 AM, Eva Prieto Castro wrote:
> Hi everybody,
>
> I have a doubt in relation with arguments in functions when packaging: Does it make sense the fact of having dots as an argument when it is the only argument?.
>
> I mean you have a package and a function that will be used directly by the user has dots as an argument; for example:
>
> ReadData <- function (...) {
> InPutParams(kValidate, ...)
>          ReadAll(...)
> }
>
> Does it make sense the fact of having dots as argument of ReadData, and no other argument?.

Sure, why not?  This usually means that no names at all are meaningful 
to ReadData.  An example like this is the list() function.  It 
constructs a list out of its arguments; you can use names if you want 
names in the list, but none of them mean anything special.

Duncan Murdoch

>
>
> I ask this question because I hace created a package and I use dots as argument (only dots) in several visible functions, because in this way the fact of validating the values passed by the user is more easy for me (within InPutParams function), but I have consulted several packages and I don't see visible functions with dots as unique argument.
>
> Thank you in advance.
>
> Regards.
>
> Eva
> 	[[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list