That depends on what you want evens() & last(5) to mean.  Does that mean the 
last 5 evens (returning 5 values) or the values in the last 5 that are also 
even items (returning either 2 or 3 values depending on if the structure has an 
odd or even number of elements).  It could be interpreted either way.  Your 
subset below does the first, the other examples do the 2nd.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[email protected]
801.408.8111


> -----Original Message-----
> From: [email protected] [mailto:r-help-boun...@r-
> project.org] On Behalf Of Claudia Beleites
> Sent: Friday, December 12, 2008 11:38 AM
> To: [email protected]
> Subject: Re: [R] The end of Matlab
>
> > evens() & last(5)
> wouldn't x[evens()][last(5)] do the & already?
>
> or is different, though.
>
> Claudia
>
> --
> Claudia Beleites
> Dipartimento dei Materiali e delle Risorse Naturali
> Università degli Studi di Trieste
> Via Alfonso Valerio 6/a
> I-34127 Trieste
>
> phone: +39 (0 40) 5 58-34 47
> email: [email protected]
>
> ______________________________________________
> [email protected] 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.

______________________________________________
[email protected] 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.

Reply via email to