GithubHelp home page GithubHelp logo

Comments (4)

msberends avatar msberends commented on May 27, 2024 1

Great! Many thanks for your reply.

I squashed the bug. For mdro() and eucast_rules(), the col_mo argument can now contain any column name of your data. The problem was that the column name that you picked was also present in the microorganisms data set, leading to conflicting code.

The development version nows contains the fix to this issue. If you like, you can try the latest version yourself using:

install.packages("remotes") # if you haven't already
remotes::install_github("msberends/AMR")

from amr.

msberends avatar msberends commented on May 27, 2024 1

Fix released to official R repository

Just a small notice: we released a new software version, containing the fix to this issue. Please update your version using either the user interface of your software, or by running:

install.packages("AMR")

from amr.

msberends avatar msberends commented on May 27, 2024

Hi Jane, many thanks for using our package!

No, that’s absolutely not the way it should behave. The intended behaviour is that it just works without requiring you to think about it 🙂

Would you be able to share the structure of your data here, by pasting the output of str(vitek_spp)? Feel free to remove the actual data it prints, I’m just curious for the column names and data types.

I think the problem might be that the microorganisms data set also contains a column ‘species’, but that should not pose a problem. Could you also try:

vitek_spp %>%
  rename(mybugs = species) %>%
  mdro()

Then my last question, which AMR package version are you using?

from amr.

jhawkey avatar jhawkey commented on May 27, 2024

Okay, after running the following command (which converts the species column from character to the mo class, and then displaying the output of str(vitek_spp):

vitek_spp <-vitek_spp %>% select(-acquired_esbl) %>% filter(!is.na(AMP)) %>% mutate(species=as.mo(species))
str(vitek_spp)
tibble [403 × 20] (S3: tbl_df/tbl/data.frame)
 $ sampleID: chr [1:403] ...
 $ species : 'mo' chr [1:403] "B_KLBSL_PNMN" "B_KLBSL_PNMN" "B_KLBSL_PNMN" "B_KLBSL_PNMN" ...
 $ AMP     : chr [1:403] "R" "R" "R" "R" ...
 $ AUG     : chr [1:403] "R" "R" "S" "R" ...
[etc]

If I rename the species column to 'mybugs', then the mdro() function works correctly.

from amr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.