0

Grade analysis

I'm stuck with this question. Somebody can help me? input <- readLines('stdin') x <- as.integer(input[1]) data <- data.frame( "id" = c(1:10), "grade" = c(75, 26, 54, 90, 86, 93, 48, 71, 66, 99) print(length(data$grade["grade"]>=89,]))

16th Apr 2023, 2:57 PM
Cédric De Craim
Cédric De Craim - avatar
6 Réponses
+ 5
You are not using "x"? And read again, how to slice vectors.
16th Apr 2023, 3:10 PM
Lisa
Lisa - avatar
+ 5
And pay attention to the task description: It is "greater than", not "greater or equal"
16th Apr 2023, 3:13 PM
Lisa
Lisa - avatar
+ 2
Exactly the 3 things I suggested. If you need more help, show your updated code.
16th Apr 2023, 3:26 PM
Lisa
Lisa - avatar
0
Yes it is x in place of 89
16th Apr 2023, 3:11 PM
Cédric De Craim
Cédric De Craim - avatar
0
Ok. But what else to do?
16th Apr 2023, 3:23 PM
Cédric De Craim
Cédric De Craim - avatar
0
I use that code in place of the above; Print(length(t(subset(data,data$grade>x))))["grade"] Not the good one yet
16th Apr 2023, 3:26 PM
Cédric De Craim
Cédric De Craim - avatar