Question: I have a column in my data frame `df` called `Ratio` which comprises of two positive integers `x` and `y` separated by a `/` [That is, format the is `x/y`]. I would like to replace each row in this column by `integer((x/y)*10)` (rounded off to the nearest integer)

Example, if that value of an element in `Ratio` is `14/20` I need to change it to `7`.

[There is a level `0/0` in the `Ratio` column in which case I would like it changed to `5`]

Answer: 
```
df$Ratio<-as.character(df$Ratio)
df$resRatio[df$Ratio!="0/0"]<-sapply(df$Ratio[df$Ratio!="0/0"],
                                     function(expr) {
                                           round(eval(parse(text=expr))*10,0)})
df$resRatio[df$Ratio=="0/0"]<-5

```
Have you tried to use `as.integer`?

```
> as.integer(14.001/20.01*10)
[1] 7

```