The details of the problem is listed here in this link
I couldn't not understand whats happening in the following lines of code:
Elite[college$Top10perc >50]=" Yes"
Do the included comments clarify your questions?
#Create a vector of "No" of length equal to the number of rows in the dataframe college Elite=rep("No",nrow(college)) #Subset the vector with the conditions of the column Top10perc > 50 #in the dataframe college and then set values to "YES" Elite[college$Top10perc >50]=" Yes" #Turn the Yes/No character strings into factors Elite=as.factor(Elite) #column bind the original dataframe with the newly created vector #to update the original dataframe college. college=data.frame(college ,Elite)