Skip to content

dhsmyanmar/dhsmmrdemo

Repository files navigation

dhsmmrdemo

The goal of dhsmmrdemo is to demostrate the package development process in r enviroment.

Installation

You can install the development version of dhsmmrdemo from GitHub with:

# install.packages("devtools")
devtools::install_github("dhsmyanmar/dhsmmrdemo")

Example

This is a basic example which shows you how to solve a common problem:

library(dhsmmrdemo)

## basic example code
# HAZ mean score
haz_score <- get_haz(PRdata$hv103, PRdata$hc70)

wt <- PRdata$hv005/1000000

weighted.mean(haz_score, wt, na.rm = TRUE)
#> [1] -1.345026

summary(haz_score, na.rm = TRUE)
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
#>   -5.99   -2.19   -1.40   -1.36   -0.59    5.95   50944

# stunting
stunting <- get_stunt(haz_score)
xtabs(wt ~ stunting)
#> stunting
#>        0        1 
#> 2897.093 1192.256
sum(xtabs(wt ~ stunting))
#> [1] 4089.349
prop.table(xtabs(wt ~ stunting))
#> stunting
#>         0         1 
#> 0.7084485 0.2915515

About

demo file for coding team

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages