I have a list of 689 data.frame
name DF
. Each data.frame have a different name and many columns. For this question, just the columns $AGE
is interesting.
The first thing a want to do is find the max of the $AGE
columns for each data.frame. Whit this code it’s ok a can find the max for each data.frame
AV<- sapply(DF, function(x) max(x$AGE, na.rm=TRUE))
It’s after this code I don’t know what to do. So first, I have to scenario possible to TEST if the scenarios are true or false
If the max is <150, 60% of my value (of the columns df$AGE) is in a interval of +or – 70 of the max (interval = max-70,max+70)
If the max is >150, 60% of my value (of the columns df$AGE) is in a interval of +or – 40 of the max (interval = max-40,max+40)
For all data.frame
that for one of the scenario the result is TRUE
, I want to keep the result somewhere. If it’s FALSE
,I want to go to scenario 3 and 4 that the same thing of 1 and 2 but with less value. I’m a little loss especially whit how to work whit a list of data.frame
Thank