I have a dataset of 19000. The lenght of the unique patient ID's is 15000. I want to have a subset of these unique ID's, but with the other variables as in the orginal dataset
patnr age and 25 other variables
1 20
2 21
3 16
4 5
19000
How can i do this? Now i can only see how many unique patient ID's are in this database with this command:
length(unique(data$patnr))