How to create a new variable based on the values of another variable

Hi ,
I am new to R.
So I would require a bit of your help.
I have a dataset Of College Admission_CSV in which I have a Column call gre that is to be classified as follows:

0-440 Low
440-580 Medium
580+ High

I have also attached in Attachment the dataset & the requirement.Dataset

nirgrahamuk can you please help me with the code how to accomplish this in R . Should I use if else?

Anyone can you please help me with the code?

You could do something like this


your_dataframe_name <- your_dataframe_name %>% 
    mutate(gre_class = case_when(
        gre < 440 ~ "Low",
        gre > 440 & gre < 580 ~ "Medium",
        gre > 580 ~ "High"

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

Since I am new to R , I am unable to understand what the question demands:
PLease can anyone help me out?

This is not an R question, this question could be posed for any programming,statistical analysis tool, even spreadsheet....
That aside,.. what specifically are the elements you want help with ?
plotting ?

Hi @nirgrahamuk,
I just need to know hoe do I execute it in R?

Thanks for the code @nirgrahamuk. It eems to work perfectly fine now.

@nirgrahamuk I have some confusion Regarding how do I find the admission probaability percentages and then the plotting it on a point chart

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.