I need to rename data from a column of a data.frame. What I need the code to do for me is to change the name of one column regarding 4 conditions. To put you in context, I have a data.frame ("trayectorias") with around 200000 rows and 40 columns. One of those columns is "wtc", that is the one I would like to change. That column contains info about aircraft type. Now, it contains an M, L, H or L/M. What I want the code to do is to change that letter to numbers:
- "L" to a 0
- "M" to a 1
- "H" to a 2
- "L/M" to a 01
Then, I would also like to count the % of the aircraft (data.frame "trayectorias") type 0, type 1, type 2 and type 01.
Thanks in advance for your help.