Home:ALL Converter>How to keep strings that are repeated more than once?

How to keep strings that are repeated more than once?

Ask Time:2021-11-04T05:05:03         Author:nik

Json Formatter

I have a data like this

mydf<- structure(list(rn = c("AAAA", "CDSD", "HUMN", "AAAA", "CRAT", 
"CAMSAP3", "RRR", "RRR", "AAAA", "AAAA", "NPRL2", "CDSD", "RAD18", 
"THAL", "BRO"), values = c(0.744760161, 0.741827081, 0.737886634, 
0.72658262, 0.71792587, 0.71787455, 0.674992626, 0.674716174, 
0.670139778, 0.668368874, 0.668332846, 0.663282622, 0.659781148, 
0.656606592, 0.656403592)), class = "data.frame", row.names = c(NA, 
-15L))

I am trying to remove those that are repeated 1 time and keep those that are more than once based on r column

I was trying something like this

mydf$value_count <- rowSums(!is.na(mydf[-1])) 
mydf2 <- df[df$value_count > 1,]

I cannot figure it out

Author:nik,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/69831704/how-to-keep-strings-that-are-repeated-more-than-once
yy