Dear someone,
Jorge's solution is excellent, assuming it is what you had in mind. Please
note that the help page for unique() has duplicated() listed in its "See
Also" section. Thus, when you studied ?unique(), it would have made sense to
read about duplicated() as well. Or perhaps you did look in
On May 3, 2010, at 9:59 AM, someone wrote:
I dont want to apply the unique for all columns but just the ID
column.
dataset[ !duplicated(dataset$ID), ]
--
David Winsemius, MD
West Hartford, CT
__
R-help@r-project.org mailing list
https://s
How about
yourdata[ !duplicated(yourdata$ID), ]
?
See ?duplicated for more information.
HTH,
Jorge
On Mon, May 3, 2010 at 9:04 AM, someone <> wrote:
>
> as a r noob i am having another problem:
> i have a big dataframe where each row corresponds to one entry and each
> column is a field...
>
Hi:
Here are three solutions; since this question comes up fairly often, you can
find
other solutions in the R-help archives.
(1) Use functions from base R: split the data frame by ID, extract the first
record from each split and slurp them together with rbind():
> do.call(rbind, lapply(sp
could you please elaborate a little more on that?
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2124055.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org m
names()
-
Lanna Jin
lanna...@gmail.com
510-898-8525
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2124036.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-proje
I dont want to apply the unique for all columns but just the ID column.
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2124011.html
Sent from the R help mailing list archive at Nabble.com.
__
thanks for your effort.
to be more precise:
ID , OS, time and many more are the columns.
each entry is a row.
when I do:
x <- unique(dataset$ID)
It just gives me a list of all IDs (levels).
I want to get a dataframe where just one entry (row) for each ID is
included...
like:
userA , Win, 12:
if that doesn't work, maybe also try:
if x is your data frame with length a columns, "unique(x[,1:a])".
-
Lanna Jin
lanna...@gmail.com
510-898-8525
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2123964.html
Sent from the R help ma
Did you try: if x is the data frame, unique(x)?
-
Lanna Jin
lanna...@gmail.com
510-898-8525
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2123956.html
Sent from the R help mailing list archive at Nabble.com.
_
as a r noob i am having another problem:
i have a big dataframe where each row corresponds to one entry and each
column is a field...
for instance, i have the column ID and time and many more...
Id like to get a dataframe where all IDs are just included once (some users
with that ID might have sev
Try, unique(dataset[,1:a]), where a is the number of columns that you have.
1:a would apply the unique to all columns.
-
Lanna Jin
lanna...@gmail.com
510-898-8525
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2123976.html
Sent fr
12 matches
Mail list logo