I have a dataframe, parsed from Coursera. One of the columns is number of students enrolled on the course. Looks like this:
df <- data.frame(uni = c("Yale", "Toronto", "NYU"), students = c("16m", "240k", "7.5k"))
uni students
1 Yale "16m"
2 Toronto "240k"
3 NYU "7.5k"
What I need to get is
uni students
1 Yale 16000000
2 Toronto 240000
3 NYU 75000
So, the main difficulty for me there is that the class of values is character, and I do not know function for replacing ks and ms, and transforming the class of column to numerics.
Please, help me!