R_Code-10.r
Problem Statement
R_Code-10.r
Create a numeric vector of student exam scores. Write a single line of code that evaluates these scores and outputs "Pass" for any score 50 or above, and "Fail" for any score below 50.
Source Code
r
# Create a numeric vector of student exam scores.
# Write a single line of code that evaluates these scores and
# outputs "Pass" for any score 50 or above, and "Fail" for any score below 50.
score <- c(45, 26, 89, 21, 75, 99, 13, 68, 85)
ifelse(score < 50, "Fail", "Pass")1
2
3
4
5
6
7
2
3
4
5
6
7