epiverse-trace / serofoi

Estimates the Force-of-Infection of a given pathogen from population based sero-prevalence studies
https://epiverse-trace.github.io/serofoi/
Other
17 stars 4 forks source link

Use inherits() (or maybe is()) to check for attributes #102

Closed jamesmbaazam closed 10 months ago

jamesmbaazam commented 1 year ago

From a devtools::check() run

>devtools::check()

>  Found if() conditions comparing class() to string:
  File ‘serofoi/R/modelling.R’: if (class(fit@sim$samples) != "NULL") ...
  File ‘serofoi/R/visualisation.R’: if (class(seromodel_object$fit@sim$samples) != "NULL") ...
  File ‘serofoi/R/visualisation.R’: if (class(seromodel_object$fit@sim$samples) != "NULL") ...
  File ‘serofoi/R/visualisation.R’: if (class(seromodel_object$fit@sim$samples) != "NULL") ...
  File ‘serofoi/R/visualisation.R’: if (class(seromodel_object$fit@sim$samples) != "NULL") ...

I'm happy to submit a PR to fix it. Do let me know.