Hi,
I have a dataset with 220 obs of 41 variables and would like to extract only the rows with unique values (keeping all the col) in col 3 (ID number so unpredictable values) how can I do that ? The other variable are not completely between the different rows with identical ID numbers but not important at that point which rows is kept.
I try several options
df2 <- df%>% select(ID, Name) %>% unique() # But do not know then how to keep the other columns
which(duplicated(cf$ID))
df2<-df[-doublons,3, ]# actually working but >50 duplicated (some 4x, 4x) so if do not want to enter them manually!
uniqueID <- unique(df$ID)
dfset <- subset(df, MRN==unique(df$ID) #error message "longer object length is not a multiple of shorter object length"
Thanks a lot for your help, hope my question is understandable.