I have a df
in R
containing data on the voting behavior of political parties in the Russian Duma. See the attached photo.
Each column currently contains the percentage and number of votes. So, for example, in the first row of the first column, UR_yes
, we see 95.8% and 228 гол. (that is, 228 votes in English). In each column I want the latter figure without гол. So, for example, each cell should just contain one number. Using the first column as an example, this would look like 228 in the first cell, 234 in the second, 235 in the third, and so on. I am dealing with a lot of entries (~15,000 across 15 separate df
), so that means the editing this by hand in Excel will be difficult. Is there a way to automate this process in R
? Any advice would be appreciated.