Parse mass/retention-time strings
parse_mass_rt.RdExtract mass and retention time (RT) values from strings of the form "mass@rt". Accepts a single string or a vector.
Usage
parse_mass_rt(x, what = c("mass", "rt", "both"), clean_rt_suffix = TRUE)Examples
parse_mass_rt("100.5@23.1", what = "mass")
#> [1] 100.5
parse_mass_rt(c("10.2@1.5", "20.4@2.5"), what = "rt")
#> [1] 1.5 2.5
parse_mass_rt("50@7.5", what = "both")
#> mass rt
#> 1 50 7.5
parse_mass_rt("100.5@23.1:1",
what = "rt",
clean_rt_suffix = TRUE
)
#> [1] 23.1