I hope this is what you want.
## Exclude replicated rows
(DF1 <- unique(DF))
## Sort the data
(DF2 <- DF1[order(DF1$V1, DF1$V2, DF1$V3, DF1$V4),])
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-extract-rows-from-data-frame-based-on-unique-variable-gro
ubject: [R] How to extract rows from data frame based on unique
> variable groupings
>
>
>
> R community,
>
> I would like to know how to extract rows from a data frame (DF) such
> that
> each row in the new data frame (D.F) represents the first instance of
> a u
R community,
I would like to know how to extract rows from a data frame (DF) such that
each row in the new data frame (D.F) represents the first instance of
a unique variable pairing in the original dataframe (ordered first by
variable V1 then by variable V2). The unique function does not se
3 matches
Mail list logo