Giter Site home page Giter Site logo

biomathr's Introduction

BioMathR

The R package {BioMathR} provides a collection of utility and wrapper functions, {ggplot2} themes and color palettes, all of which are often used at BioMath.

Installation

You can install BioMathR quickly like so:

remotes::install_github('SchmidtPaul/BioMathR')

Or you can install it with all its suggested packages (i.e. extra packages that may only be necessary for one of the functions in BioMathR) like so:

remotes::install_github("SchmidtPaul/BioMathR", dependencies = TRUE, suggest = TRUE)

Find the documentation of all functions by clicking on the "Reference" tab at the top.

biomathr's People

Contributors

schmidtpaul avatar

Watchers

 avatar

biomathr's Issues

Add `get_desc()`

Base on dlookr::describe(weight)

  • make sure not to load the package, as it loads {showtext} which leads to rendering issues with {ggplot2}
  • optional German
  • optional print-ready table

Add `get_residual_plots()`

Base on this:

residuencheck <-
  function(model,
           col_dots = BMcols["grey"],
           col_line = BMcols["green"]) {
    
    # Varianzhomogenität
    rp1 <- plot(check_heteroscedasticity(model)) + theme_BioMath()
    rp1$layers[[1]]$aes_params$colour <- col_dots
    rp1$layers[[2]]$aes_params$colour <- col_line
    rp1$layers[[2]]$aes_params$fill   <- col_line
    
    # Normalverteilung
    rp2 <- plot(check_normality(model), type = "qq") + theme_BioMath()
    rp2$layers[[1]]$aes_params$fill   <- col_line
    rp2$layers[[2]]$aes_params$colour <- col_dots
    rp2$layers[[3]]$aes_params$colour <- col_line
    
    plot_grid(rp1, rp2, nrow = 1)
  }
  • replace {cowplot} with {patchwork}
  • optional test results?
  • optional German?

Add `get_varcomp()`

Base on this:

get_vc <- function(model) {
  model %>%
    VarCorr() %>%
    as_tibble() %>%
    setNames(c('group', 'effect', 'eff_2', 'var', 'sd')) %>%
    mutate(
      var_prop = var / sum(var),
      var_p = case_when(
        var_prop < 0.000001 ~ "   0%",
        TRUE ~ percent(var_prop, accuracy = 0.1, trim = FALSE)
      ),
      effect   = gsub(effect, pattern = '[\\(,\\)]', replacement = ''),
      effect   = ifelse(is.na(effect), '', effect)
    ) %>%
    select(group, var, var_p, sd, effect, everything())
}
  • which model classes are supported?
  • optional German?
  • optional print-ready version?

Add `desplot_BM()`

Base on this:

fargs <- formals(desplot)
fargs$flip <- TRUE
fargs$cex <- 1
fargs$out1.gpar <- list(col = "black", lwd = 1, lty = "dashed")
fargs$out2.gpar <- list(col = "black", lwd = 1, lty = "dotted")
formals(desplot) <- fargs

Add `project_setup()`

  • create folder structure
  • 00 setup.R
    • create
  • 01 import.R
    • create
    • source(here::here("10 RCode" , "code", "00 setup.R"), encoding = "UTF-8")

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.