1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 06:51:48 +02:00

mo_source improvement

This commit is contained in:
2019-03-01 09:34:04 +01:00
parent 2565b60024
commit c5efb272fd
21 changed files with 324 additions and 294 deletions

View File

@ -45,15 +45,19 @@ set_mo_source("home/me/ourcodes.xlsx")
# Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
}
It has now created a file "~/.mo_source.rds" with the contents of our Excel file. It it an R specific format with great compression.
It has now created a file "~/.mo_source.rds" with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.
And now we can use it in our functions:
\preformatted{
as.mo("lab_mo_ecoli")
# B_ESCHR_COL
[1] B_ESCHR_COL
mo_genus("lab_mo_kpneumoniae")
# "Klebsiella"
[1] "Klebsiella"
# other input values still work too
as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
[1] B_ESCHR_COL B_ESCHR_COL B_ESCHR_COL
}
If we edit the Excel file to, let's say, this:
@ -71,10 +75,10 @@ If we edit the Excel file to, let's say, this:
\preformatted{
as.mo("lab_mo_ecoli")
# Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
# B_ESCHR_COL
[1] B_ESCHR_COL
mo_genus("lab_Staph_aureus")
# "Staphylococcus"
[1] "Staphylococcus"
}
To remove the reference completely, just use any of these: