0
Grade analysis R task
#Code not working input <- readLines('stdin') x <- as.integer(input[1]) dat <- data.frame("id" = c(1:10), "grade" = c(75, 26, 54, 90, 86, 93, 48, 71, 66, 99)) n <- c(dat[dat$grade>x]) print(length(n))
2 ответов
+ 2
shiwana
There should be comma after > x
you have to get length of grade
n <- c(dat[dat$grade > x, ])
print(length(n$grade))
0
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(t(subset(data,data$grade>x)["grade"])))
#It worked