[R] unique, but keep LAST occurence

2006-07-24 Thread davidr
?unique says Value: An object of the same type of 'x'. but if an element is equal to one with a smaller index, it is removed. However, I need to keep the one with the LARGEST index. Can someone please show me the light? I thought about reversing the row order twice, but I couldn't

Re: [R] unique, but keep LAST occurence

2006-07-24 Thread Marc Schwartz (via MN)
On Mon, 2006-07-24 at 12:00 -0500, [EMAIL PROTECTED] wrote: ?unique says Value: An object of the same type of 'x'. but if an element is equal to one with a smaller index, it is removed. However, I need to keep the one with the LARGEST index. Can someone please show me the

Re: [R] unique, but keep LAST occurence

2006-07-24 Thread Berton Gunter
learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, July 24, 2006 10:00 AM To: r-help@stat.math.ethz.ch Subject: [R] unique, but keep LAST occurence ?unique says Value

Re: [R] unique, but keep LAST occurence

2006-07-24 Thread davidr
, July 24, 2006 12:51 PM To: David Reiner [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: RE: [R] unique, but keep LAST occurence Try: largestDF - DF[nrow(DF)- which(!duplicated(rev(DF$t)))+1,] You can then sort this however you like in the usual way. Row names will be preserved. -- Bert

Re: [R] unique, but keep LAST occurence

2006-07-24 Thread johan Faux
I have a question about deparse function in R What is the reason that deparse use an argument like width.cutoff ? Why the maximum cutoff is 500? I was manipulating an R formula and used deparse. Since the length of user's formula was greater then 500, my code didnt work. thanks Johan