From dd40a730ad1cfd0e3138d221abecf83b90fef014 Mon Sep 17 00:00:00 2001 From: William Xu <67845982+williamxu7@users.noreply.github.com> Date: Mon, 12 Jul 2021 11:48:13 -0700 Subject: [PATCH] Add example --- README.md | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 9837fac..ea941a8 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,7 @@ The goal of PLCOm2012 is to … ## Installation -You can install the released version of PLCOm2012 from -[CRAN](https://CRAN.R-project.org) with: - -``` r -install.packages("PLCOm2012") -``` - -And the development version from [GitHub](https://github.com/) with: +The development version from [GitHub](https://github.com/) with: ``` r # install.packages("devtools") @@ -27,36 +20,12 @@ devtools::install_github("resplab/PLCOm2012") ## Example -This is a basic example which shows you how to solve a common problem: +This is a basic example which shows the the 6-year probability of lung cancer in an individual person. The example is an individual who is 62 years old, white, had some college (level 4) education, with body-mass index 27, no chronic obstructive pulmonary disease, no personal history of cancer, no family history of lung cancer, former smoker, smokes 80 cigarettes per day, smokes for 27 years and quits smoking for 10 years. He/she would have 1.75% 6-year probability of lung cancer. ``` r library(PLCOm2012) -## basic example code -``` - -What is special about using `README.Rmd` instead of just `README.md`? -You can include R chunks like so: - -``` r -summary(cars) -#> speed dist -#> Min. : 4.0 Min. : 2.00 -#> 1st Qu.:12.0 1st Qu.: 26.00 -#> Median :15.0 Median : 36.00 -#> Mean :15.4 Mean : 42.98 -#> 3rd Qu.:19.0 3rd Qu.: 56.00 -#> Max. :25.0 Max. :120.00 +plcom2012(age=62, race='White', education=4, bmi=27, copd=0, + cancer_hist=0, family_hist_lung_cancer=0, smoking_status=0, + smoking_intensity=80, duration_smoking=27, smoking_quit_time=10) + #> 0.01750922 ``` - -You’ll still need to render `README.Rmd` regularly, to keep `README.md` -up-to-date. `devtools::build_readme()` is handy for this. You could also -use GitHub Actions to re-render `README.Rmd` every time you push. An -example workflow can be found here: -. - -You can also embed plots, for example: - - - -In that case, don’t forget to commit and push the resulting figure -files, so they display on GitHub and CRAN.