I have the following data frames(month columns with NA value) : df
Vehicle Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec <br/>
123X<br/>
435y<br/>
...<br/>
where number of row is defined by the number of unique vehicle number. Number of column is 13
the following data frame is generated in for loop for each vehicle to find out the number of breakdown of each vehicle in each month
[for a single vehicle]
occurrences:<br/>
Month Freq<br/>
Jan 1<br/>
Mar 3<br/>
Jul 5<br/>
May 3<br/>
each time the occurrence data frame is generated i want to plug in the freq value into the df data frame by the month name. I have tried using for loop, which is becoming very very complex. Is there any easier way plug in the value from the occurrences data frame into the df data frame?
I am expecting the following result: for df
Vehicle Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
123X 1 na 3 na 3 na 5 na na na na na
435y
...