What are idioms for taking a head or a tail of a vector, either up to an index, or from an index to the end? Also -- is it necessary to use length(v) to refer to the last element? E.g., Python has
v[:3] # indices 0,1,2 v[3:] # indices 3,4,... v[-1] # the last element of v v[:-1] # all but last Cheers, Alexy ______________________________________________ R-help@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.