[R] The end of Matlab

Greg Snow Greg.Snow at imail.org
Fri Dec 12 19:47:07 CET 2008


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
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Claudia Beleites
> Sent: Friday, December 12, 2008 11:38 AM
> To: r-help at r-project.org
> 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: cbeleites at units.it
>
> ______________________________________________
> 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