Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cf <- function(score,P50,P75){
- if (score<P50) {
- return(3)
- } else if (score>=P50 & score<P75) {
- return(2)
- } else {
- return(1)
- }
- }
- classp <- NULL
- for (i in 1:dim(pdata)[1]) {
- classp[i] <- cf(score=pdata$平均成績[i], P50 = pdata$P50[i],P75 = pdata$P75[i])
- }
- classp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement