Please solve this using R | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Please solve this using R

You have a dataframe that includes grades of students.Your program needs to take a number as input, and output the number of students who have a grade greater than the given input. Input : 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) )

7th Jan 2023, 7:17 AM
Adwaith Krishna S
Adwaith Krishna S - avatar
3 Respuestas
+ 2
Attempts?
7th Jan 2023, 8:07 AM
AÕĘJ
AÕĘJ - avatar
+ 1
Read the lesson again before doing the task. Then show your attempt.
7th Jan 2023, 8:24 AM
Lisa
Lisa - avatar
0
The following is my attempt,please suggest the changes….. 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) ) y <- length("grade" > x) print (y)
10th Jan 2023, 2:45 AM
Adwaith Krishna S
Adwaith Krishna S - avatar