0

We conducted an experiment at Uni which we tried out ourselves before we gave it to real test persons. The problem now is, that our testing-data is included in the whole csv datafile so I need to delete the first 23 "test persons". They all got a unique code and I could count how many of those unique codes exist (as you can see, there are 38). Now I only need the last 15 of them... I tried it with subset but I don't really now how to filter for those specific last 15 subjectId's (VPcount)

unique(d$VPcount)
uniqueN(d$VPcount)

[1] 7.941675e-312 7.941683e-312 7.941686e-312 7.941687e-312 7.941695e-312 7.941697e-312 7.941734e-312
[8] 7.942134e-312 7.942142e-312 7.942146e-312 7.942176e-312 7.942191e-312 7.942194e-312 7.942199e-312
[15] 7.942268e-312 7.942301e-312 7.942580e-312 7.943045e-312 7.944383e-312 7.944386e-312 7.944388e-312
[22] 7.944388e-312 7.944429e-312 7.944471e-312 7.944477e-312 7.944478e-312 7.944494e-312 7.944500e-312
[29] 7.944501e-312 7.944501e-312 7.944503e-312 7.944503e-312 7.944506e-312 7.944506e-312 7.944506e-312
[36] 7.944506e-312 7.944508e-312 7.944511e-312
[1] 38
Jessi
  • 5
  • 2
  • 1
    To get useful answers, you should include a reproducible example (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). If you want to only include only rows 24 to 38, you can do it by `d.filtered <- d[24:38,]` . – Otto Kässi Dec 15 '20 at 10:17

1 Answers1

0

You can try :

data <-  subset(d, VPcount %in% tail(unique(VPcount), 15))
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213