0

Getting number of elements in a data frame on a specific variable

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) ) ### RUN SOME COMMANDS TO GET NUMBER OF STUDENTS WITH THE FOLLOWING GRADES ##1. GREATER THAN 50 ###2. GREATER THAN 75 ###3. GREATER THAN 89 ##4. GRAETER THAN 90 ###5. GREATER THAN 86 ### Kindly help with a command that return the above results

24th Feb 2023, 10:36 AM
PHILEMON MAKUBO NYAMAGAINI
PHILEMON MAKUBO NYAMAGAINI - avatar
1 Resposta
+ 3
1. Conditionally index the dataframe ir the column of the dataframe. 2. Get the nrow() of the sliced dataframe or length of the sliced column. Please TAG THE RELEVANT PROGRAMMING LANGUAGE, not "anyone", "to" – these are not informative.
24th Feb 2023, 11:38 AM
Lisa
Lisa - avatar