Hi,
You can use some regular expressions to extract only the values
library(stringr)
myData = data.frame(
val = c("0,096", "ND(0,15)", "0,11")
)
myData$val = str_extract(myData$val, "\\d+,\\d+")
myData
#> val
#> 1 0,096
#> 2 0,15
#> 3 0,11
Created on 2022-06-02 by the reprex package (v2.0.1)
In regular expressions, \d+ means match one or more digits. The \ character needs to be escaped in an R string, so you write it as \\d+
Also, if these values are numbers in comma format (instead of period as R expects) you can use some more regular expressions to convert this as well
myData$val = as.numeric(str_replace(myData$val, ",", "\\."))
Hope this helps,
PJ