From: John McHenry <john_d_mchenry_at_yahoo.com>

Date: Thu 10 Aug 2006 - 10:30:47 EST

R-help@stat.math.ethz.ch 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. Received on Thu Aug 10 11:38:26 2006

Date: Thu 10 Aug 2006 - 10:30:47 EST

Hi WizaRds,

In MATLAB you can do

x=1:10

and then specify

x(2:end)

to get

2 3 4 5 6 7 8 9 10

Obviously there isn't much gain in syntax when the variable name is x, but when it's something like

hereIsABigVariableName(j:end-i)

it makes things a lot more readable than

hereIsABigVariableName(j:length(hereIsABigVariableName)-i)

n<- length(hereIsABigVariableName)

hereIsABigVariableName[j:n-i]

but I'd like to use something like 'end', if it exists.

Am I missing something obvious in R that does what 'end' does in MATLAB?

[[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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. Received on Thu Aug 10 11:38:26 2006

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Fri 11 Aug 2006 - 00:18:48 EST.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*