Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
williamxu7 authored Jul 12, 2021
1 parent 85298e2 commit dd40a73
Showing 1 changed file with 6 additions and 37 deletions.
43 changes: 6 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
<https://github.com/r-lib/actions/tree/master/examples>.

You can also embed plots, for example:

<img src="man/figures/README-pressure-1.png" width="100%" />

In that case, don’t forget to commit and push the resulting figure
files, so they display on GitHub and CRAN.

0 comments on commit dd40a73

Please sign in to comment.