uot; "b" "e"
>>> > > letters[]
>>> > [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n&quo
quot; "e"
>> > > letters[]
>> > [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q"
>
Hi all,
I'm guessing what's the rationale behind this:
> subsettingFun <- function(vec, ix) vec[ix]
> subsettingFun(letters, c(1,2,5))
[1] "a" "b" "e"
> subsettingFun(letters)
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q"
"r" "s"
[20] "t" "u" "v" "w" "x" "y" "z"
If
the check yourself and not rely on programming language.
And BTW I did not know an answer before I inspected docs.
Cheers
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Stefano
> de Pretis
> Sent: Thursday, February 04, 2016 11:00
" "y" "z"
> >
> > It is sometimes useful not "expect" the program behavior but "inspect"
> why
> > it behaves differently.
> >
> > If you want your function to throw error when some arguments are missing
> > you
"x" "y" "z"
>
> It is sometimes useful not "expect" the program behavior but "inspect" why
> it behaves differently.
>
> If you want your function to throw error when some arguments are missing
> you need to do the check yourself a
6 matches
Mail list logo