Write an if/else function that goes through and labels a TipPercentage of 16 percent or more as "large" and less than 16 percent as "small". Label this new variable TipPSL Also write an if/else function that labels a party size of 4 or more as "large" and a party size of less than 4 as "small". Label this new variable PartySL.
TipPSL < - if(EX2.TIPS$Tip.Percentage >= 16){
print("large")
} else{
print("small")
}
PartySL < - if(EX2.TIPS$Size_of_Party >= 4){
print("large")
} else{
print("small")
}
This is the code that I have attempted but I keep getting an error. This data comes form the data set EX2.TIPS
Aucun commentaire:
Enregistrer un commentaire