I have a table looking as the following:
ID period 1 period 2 period 3 period 4
A 4 2 25 42
B 3 56 2 45
C 16 1 34 67
D 56 2 8 48
I want to check in R how many times(cols) in each row I get values lower than 10. For example in row A I have two values lower than 10. Any ideas???
I used the quantile values and got the following:
quantile(v[,2:5],na.rm=TRUE) 0% 25% 50% 75% 100% 1.00 2.75 20.50 45.75 67.00
But this is not exactly what I need; I want to know the percentage (or count) of values below 10. I tried using the following and also didn´t work:
limit [1] 10 v$tot<-count(v,c("ID","period1","period2"),wt_var=limit)`
The first few rows of the actual dataset areas follows:
id 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1 xxxlll 61 36 277 462 211 182 45 41 128 174 179 87 18 NaN NaN NaN NaN
2 ccvvbb 281 340 592 455 496 348 422 491 408 548 596 611 570 580 530 602 614
3 ddffgr 587 964 895 866 1120 725 547 90 NaN NaN NaN NaN NaN NaN NaN NaN NaN
4 rrteww 257 331 320 411 442 316 334 403 355 444 522 661 508 499 520 413 494
5 oiertw 261 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN