Linked Questions
20 questions linked to/from Remove duplicated rows using dplyr
12
votes
2
answers
50k
views
R: how to remove duplicate rows by column [duplicate]
df <- data.frame(id = c(1, 1, 1, 2, 2),
gender = c("Female", "Female", "Male", "Female", "Male"),
variant = c("a", "b", "c", "d", "e"))
> df
id gender variant
...
0
votes
1
answer
12k
views
Filter duplicated rows in R data.frame [duplicate]
I have a data.frame as shown below.
> df2 <- data.frame("StudentId" = c(1,1,1,2,2,3,3), "Subject" = c("Maths", "Maths", "English","Maths", "English", "Science", "Science"), "Score" = c(100,90,...
0
votes
2
answers
2k
views
Filter to all rows where there are duplicate values in two columns (dplyr) [duplicate]
I have a data frame that looks like this:
id dob lname
1 1900-01-01 a
2 1900-01-01 b
3 1900-01-01 b
4 1901-01-01 c
5 1901-01-01 d
6 1902-01-01 e
7 1902-01-01 e
8 ...
0
votes
1
answer
219
views
filtering large data table by two variables in R [duplicate]
With the RWE below, I am one step short of achieving my desired result. I can identify the unique combinations, but I want to obtain a data.table of all three columns (A,B and C)
a <- c(1,1,1,1,1,...
-1
votes
3
answers
198
views
Leave only unique rows in 3 columns out of 4 [duplicate]
I have a dataframe:
Date ID Type Value
2020-08-04 03:00:00 1 active 14
2020-08-04 03:00:00 1 active 15
2020-08-04 03:00:00 2 active ...
0
votes
0
answers
54
views
Subset a dataframe according to very specific conditions [duplicate]
My apologies for this title, i didn't succeeded to find a good explicit title.
Here is a reproducible code for what my data looks like :
subject = gl(3,4,12)
item = factor(c("A","B","B","A","A","A",...
0
votes
0
answers
14
views
Filter rows with same values for two specific columns in R? [duplicate]
I have a tibble in R like:
df1<-tibble(student=c("John", "John", "John", "Mark", "June"),
grade=c("A", "A", "A&...
6
votes
3
answers
2k
views
Randomly remove duplicated rows using dplyr()
As a follow-up question to this one: Remove duplicated rows using dplyr, I have the following:
How do you randomly remove duplicated rows using dplyr() (among others)?
My command now is:
data....
8
votes
2
answers
8k
views
unique rows in dplyr : row_number() from tbl_dt inconsistent to tbl_df
en bref:
I am wondering how to get unique rows from a data.table in a somewhere along a dplyr workflow. Since v0.2 I can use row_number==1 (see: Remove duplicated rows using dplyr)
BUT!
tbl_df(...
4
votes
2
answers
5k
views
tidyr:Pivot_wider replace values with data type
I have a data frame with variables in the rows and the columns that both contain variables, so I am trying to use pivot wide tidy the data. My data looks like the following:
head(df)
# A tibble: 6 x ...
0
votes
2
answers
4k
views
Remove duplicate rows based on conditions from multiple columns (decreasing order) in R
I have a 3-columns data.frame (variables: ID.A, ID.B, DISTANCE). I would like to remove the duplicates under a condition: keeping the row with the smallest value in column 3.
It is the same problem ...
2
votes
2
answers
3k
views
Filter only rows that are duplicated using dplyr
I have been trying for a while now to solve a problem close to the one as presented at this issue with no success. This consists in filtering for items that are duplicated in a group, but also ...
0
votes
1
answer
3k
views
R duplicate ID variables with different values [duplicate]
I have a data frame that looks like this;
head(x)
user_id location
1 New York
1 Chicago
2 Atlanta
3 San Antonio
I would like to remove the duplicate rows (ie. ...
-4
votes
2
answers
1k
views
How to get duplicate rows from table in R [duplicate]
Name Address Account a b Amount Phone
John CA 4879759 qwqe rerter 203 807789747
Nil FD 1234455 iuyui jhgjhg 4321 98797897
Was FR 8979696 yikjh kkjhk 45989 ...
1
vote
1
answer
598
views
Remove Duplicates by Unique Value in another Column
I have a dataframe that looks like this:
COLA COLB COLC
A nb 1
A nc 0.8
A bc 0.7
A nb 0.7 <------------
B ...