Clean characters in expression columns
clean_character.Rd
If the class of expression contain characters(e.g. 'NA.', 'filtered'), run Clean characters to replace character by NA, and transfor expression value to numeric
Examples
expression_assay = data.frame(A = c("1165799.5","51419028","1.9e6","2213111.25"),
B = c("1455111","Filtered","2021020.375","NA"),
c = c(261344, 49840292, 2388750, 1753475.625))
str(expression_assay)
#> 'data.frame': 4 obs. of 3 variables:
#> $ A: chr "1165799.5" "51419028" "1.9e6" "2213111.25"
#> $ B: chr "1455111" "Filtered" "2021020.375" "NA"
#> $ c: num 261344 49840292 2388750 1753476
(clean_character(expression_assay))
#> A B c
#> 1 1165800 1455111 261344
#> 2 51419028 NA 49840292
#> 3 1900000 2021020 2388750
#> 4 2213111 NA 1753476