'Convert "hour:minute" character column to numeric column of minutes (column has NA values)

I have a character column called ipaq_2 in r that is like "02:00" (hour:minute). Also the column has some NA values. I need to convert this column into a numeric column that shows the minutes (in the above example: 120), replacing at the same time NA values with the mean. enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source