Re: [R] Optional argument to be used in a subset function

2013-10-24 Thread David Mora
Sorry for the html code: I'm writing a function that needs an optional variable. If the variable is given, then a subset must be made using that variable, but if the variable is not given the subset must be done using all the values for that variable (ignoring that variable). Something like this:

Re: [R] R: Optional argument to be used in a subset function

2013-10-24 Thread Berend Hasselman
On 24-10-2013, at 16:15, David Mora wrote: > I'm writing a function that needs an optional variable. If the variable is > given, then a subset must be made using that variable, but if the variable > is not given the subset must be done using all the values for that variable > (ignoring that vari

[R] R: Optional argument to be used in a subset function

2013-10-24 Thread David Mora
I'm writing a function that needs an optional variable. If the variable is given, then a subset must be made using that variable, but if the variable is not given the subset must be done using all the values for that variable (ignoring that variable). Something like this: *band <- function(file,