0

I have an SAS table imported to R Studio, there are around 2500 observations (patient ID). This is a table with data from different experiments (3 experiments or readings), and for some observations/patients, more than one experiment was conducted. I want to know which of those observations have more than one experiment in order to filter the data and just choose an experiment. Also, this will help me see the exact number of observations.

LuizZ
  • 945
  • 2
  • 11
  • 23
Ary
  • 13
  • 2
  • 1
    janitor::get_dupes()` will return duplicate cases. `dplyr::distinct()` will return the first instance of a specific value in a variable (or in a combination of variables), and `dplyr::n_distinct()` will return the number of unique observations of a variable (or combination of variables). – Phil Nov 29 '20 at 05:31
  • 2
    There are multiple ways of doing this. Please [research](https://meta.stackoverflow.com/q/261592/1422451), select an approach, make an earnest effort, and come back with specific issues with [reproducible example](https://stackoverflow.com/q/5963269/1422451). – Parfait Nov 29 '20 at 05:42
  • also see `?duplicated` in base R ... or `?table` ... – Ben Bolker Dec 01 '20 at 00:16

0 Answers0