
Convert Density Representations to Real Numbers
convert_density_representations.Rd
This function processes a dataframe to convert density values that might be in various representations (e.g., "10K", "10k") into their real number equivalents. For instance, "10K" or "10k" will be converted to 10000.
Value
A dataframe with the converted density values. Special values are 0 ('Negative Control') and -1 ('Value was not known'). All other values are returned as numerics. In cases where 'K' or 'k' is appended, the numeric value in front is multiplied by 1000.
Examples
user_df <- data.frame(Density = c("1", "10k", "100K"))
convert_density_representations(user_df, "Density")
#> Density
#> 1 1e+00
#> 2 1e+04
#> 3 1e+05