Giter Club home page Giter Club logo

pharmaprepro's Introduction

pharmaprepro

This R package is for medical staff such as pharmacists to use for preprocessing clinical data.

Installation

You can install the released version of pharmaprepro from GitHub with:

install.packages("devtools")
require(devtools)
install_github("nyubachi/pharmaprepro")

Example

# loading package
library(pharmaprepro)
# test data
x <- data.frame(age = c(109, 98, 72, 25),
                height = c(161.5, 182.5, 170.1, 155.4),
                weight = c(55.2, 70.2, 60.5, 54.8),
                scr = c(0.4, 0.9, 1.1, 0.5),
                gender = c("female", "male", "male", "female"),
                birthday = c("M43.09.12", "T10.11.05", "S22/03/31", "H06-12-29"),
                target_day = c("1990/06/10", "2010/04/22", "2018/12/03", "2015/10/03"))

agecalc

Calculate the age on the specific date.

# Convert birthday from Japanese calendar to Christian calendar year.
birthday <- wareki2seireki(x$birthday)
# Calculate age from birthday and target date.
agecalc(birthday, x$target_day)
#> [1] 79 88 71 20
# If the second argument is omitted, today is entered.
agecalc(birthday)
#> [1] 108  97  71  24

bmicalc

Calculate the body mass index from height and weight data.

bmicalc(x$height, x$weight)
#> [1] 21.16 21.08 20.91 22.69

bsacalc

Calculate the body surface area from height and weight data.

# If the third argument is 1 (default), using the DuBois formula.
bsacalc(x$height, x$weight, 1)
#> [1] 1.58 1.91 1.70 1.53
# If the third argument is 2, using the Shintani formula.
bsacalc(x$height, x$weight, 2)
#> [1] 1.61 1.95 1.74 1.57
# If the third argument is 3, using the Fujimoto formula.
bsacalc(x$height, x$weight, 3)
#> [1] 1.53 1.85 1.65 1.49

ccrcalc

Calculate creatinine clearance.

# When the fifth argument is 1 (default), if scr is less than 0.6, it rounds up to 0.6.
ccrcalc(x$age, x$weight, x$scr, x$gender, 1)
#> [1]  33.67  45.50  51.94 124.00
# If the fifth argument is 0, scr is not corrected.
ccrcalc(x$age, x$weight, x$scr, x$gender, 0)
#> [1]  50.50  45.50  51.94 148.80

stdwtcalc

Calculate standard weight from height data.

stdwtcalc(x$height)
#> [1] 57.38 73.27 63.65 53.13

wareki2seireki

Convert Japanese calendar to Christian calendar.

wareki2seireki(x$birthday)
#> [1] "1910-09-12" "1921-11-05" "1947-03-31" "1994-12-29"

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.