Ah, those can be used to index the rows:
# create a new column with TRUE for the first row of each Vin:
ladata2$First <- !duplicated(ladata2$Vin)
# view only those rows:
ladata2[ladata2$First,]
>>>
From: wookie1976
To:
Date: 24/Feb/2010 2:53 p.m.
Subject: Re: [R] First. La
Steve,
Your example seems to work quite well, except I get a summary printout
showing all the true and false values.
> !duplicated(ladata2$Vin)
[1] TRUE TRUE TRUE TRUE
What I would like to do is have the true/false values appended to a column
at the end of my dataset so that when don
These tell you the first and last row for each plate:
!duplicated(df$plate)
!duplicated(df$plate, fromLast=TRUE)
Hope that helps.
Steve
>>>
From: wookie1976
To:
Date: 24/Feb/2010 6:54 a.m.
Subject: [R] First. Last. Data row selection
I am in the process of switching from SAS
wookie1976 wrote:
>
> I am in the process of switching from SAS over to R. I am working on very
> large CSV datasets that contain vehicle information. As I am processing
> the data, I need to select the first (or sometimes the second) record (by
> date) for any records that have the same licen
e attached are in
no way my original work.
Benjamin
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of wookie1976
Sent: Tuesday, February 23, 2010 12:40 PM
To: r-help@r-project.org
Subject: [R] First. Last. Data row selection
I
I am in the process of switching from SAS over to R. I am working on very
large CSV datasets that contain vehicle information. As I am processing the
data, I need to select the first (or sometimes the second) record (by date)
for any records that have the same license plate number. In SAS, ther
6 matches
Mail list logo