I have a dataframe that involves several columns, in which there are many instances where inequalities are present. What I would like to have, is an R script that will identify these inequalities and replace them with actual values. More specific, let's assume that we have "<2" and we want to replace it with its half value ("<2" -> 1.0). Is there a generic way to do it so that I do not need to find manually all the inequalities within the dataframe and replace them?
A simple example might be the following:
Col1,Col2, Col3, Col4
2.2, <3, 4,<2
3.4, 4, <5,3
4.2, 2,2.1,5
1.3, 1,4,<8
And I want to get something like this:
Col1,Col2,Col3,Col4
2.2, 1.5, 4,1
3.4, 4, 2,5,3
4.2, 2,2.1,5
1.3, 1,4,4