Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Catherine Miller authored and Catherine Miller committed Mar 8, 2014
2 parents 83afad5 + a55ad1d commit 0e0c8e7
Show file tree
Hide file tree
Showing 18 changed files with 773 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.html
*.md
*.md
.Rhistory
13 changes: 13 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Package: MedicMobileImpact
Type: OpenCPU Application
Title: Markdown Application for OpenCPU
Version: 0.1
Date: 2014-03-08
Author: F. William High
Maintainer: F. William High <[email protected]>
Description: OpenCPU App for markdown package
License: Apache2
Depends:
knitr
Suggests:
opencpu (>= 1.0.1)
16 changes: 16 additions & 0 deletions MedicMobileImpact.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

BuildType: Package
PackageInstallArgs: --no-multiarch --with-keep.source
20 changes: 10 additions & 10 deletions Medic_Mobile_ANC_worksheet/Medic_Mobile_ANC_worksheet.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ CBR: Crude birth rate
**What is the name of the country?**

```{r}
country.name <- "Kenya"
country.name <- "Nigeria"
```

**Provide a recent estimate of the population of `r country.name`.**

```{r}
country.population <- 43200000
country.population <- 168.8e6
```

**What is the year of this estimate? It's okay if the year is approximate.**
Expand All @@ -44,13 +44,13 @@ country.population.year <- 2012
**What is the name of the catchment?**

```{r}
catchment.name <- "Kilifi county"
catchment.name <- "Lagos"
```

**What is the population of `r catchment.name`?**

```{r}
catchment.population <- 1109735
catchment.population <- 5.195e6
```

**What is the year of this estimate? It's okay if it is approximate, but it should at least be roughly around `r country.population.year`.**
Expand All @@ -68,7 +68,7 @@ first.anc.year <- 2014
**How many women will your program serve in `r first.anc.year`?**

```{r}
n.women.covered <- 91600
n.women.covered <- 100000
```

You are embarking on an ANC projection for `r catchment.name`, `r country.name`. The population of `r catchment.name` is `r sprintf("%i",catchment.population)`, which is `r sprintf("%.2f",catchment.population/country.population*100)`% of `r country.name`'s population. Your baseline year for demographic projections is `r country.population.year`, and the year you want to model an increase in coverage is `r first.anc.year`.
Expand Down Expand Up @@ -119,13 +119,13 @@ Click the _Multiply_ button. Enter the following number in Spectrum.
Click _Ok_. You will see all the numbers in the population table reduced by this fraction. Double check that the total population is now roughly equal to your catchment area as follows. **What is the total male population listed in the table?**

```{r}
spectrum.catchment.male.population <- 544933
spectrum.catchment.male.population <- 2.547e6
```

**And what is the total female population?**

```{r}
spectrum.catchment.female.population <- 550576
spectrum.catchment.female.population <- 2.495e6
```

```{r echo=FALSE}
Expand All @@ -143,7 +143,7 @@ Click on _Results &rarr; Total Population_. The defaults in the dialog you are
**What, in whole numbers (not in millions), is the total projected population size in `r first.anc.year`?**

```{r}
spectrum.catchment.population.first.anc.year <- 1.17e6
spectrum.catchment.population.first.anc.year <- 5.09e6
```

The projection population for your first year of increased ANC coverage (`r first.anc.year`) is `r sprintf("%.2f",(spectrum.catchment.population.first.anc.year/catchment.population-1)*100)`% bigger than the population in `r catchment.population.year`, which was `r sprintf("%i",catchment.population)`.
Expand All @@ -155,7 +155,7 @@ Click on _Results &rarr; Vital Events &rarr; Crude Birth Rate_. The defaults in
This is the number of births per 1000 people. **What is the CBR for `r first.anc.year`?**

```{r}
spectrum.cbr.first.anc.year <- 34.41
spectrum.cbr.first.anc.year <- 38.15
```

```{r echo=FALSE}
Expand All @@ -171,7 +171,7 @@ Make sure you’re in the _Modules_ tab. Select the _LiST_ module.
Select _Coverage_. In the dialog, select the _Pregnancy_ tab. You’ll see nationally averaged coverage rates already populated in the table. Look at the "Antenatal care" row of the table. **What is the coverage rate shown for `r first.anc.year`?**

```{r}
baseline.anc.coverage.rate <- 45.7
baseline.anc.coverage.rate <- 44.8
```

By default, LiST is assuming that `r sprintf("%.f",baseline.anc.coverage.rate/100*n.pregnant.women.first.anc.year)` out of `r sprintf("%.f",n.pregnant.women.first.anc.year)` pregant women are being treated with antenatal care. This coverage rate is equal to the national coverage rate by default, and we've just scaled it down to the catchment size.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export(rmdtext)
10 changes: 10 additions & 0 deletions R/rmdtext.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## This app requires OpenCPU 1.0.1 or higher !!!!
##

#' @export
rmdtext <- function(text){
writeLines(text, con="input.Rmd");
knit2html("input.Rmd", output="output.html");
invisible();
}

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ MedicMobileImpact

Step 1. Download this repository. On the GitHub site, you can download a zipped version of this repo, or if you are a savvy git user, you can clone it to your desktop.

Step 2. Download and install RStudio.
Step 2. Download and install R.

http://cran.r-project.org/

And RStudio.

https://www.rstudio.com/

Step 3. Open RStudio, and install the knitr package. Do this by clicking _Packages_ tab, then click the _Install Packages_ button. Search for "knitr", make sure _Install dependencies_ is checked, and click _Install_.
Step 3. Open RStudio, and install the knitr package. Do this by clicking _Packages_ tab, then click the _Install Packages_ button. Search for "knitr", make sure _Install dependencies_ is checked, and click _Install_. This procedure has been tested using knitr 1.5. To make sure you have the latest knitr update, in RStudio in the _Packages_ tab click _Check for Updates_ and follow the instructions.

Step 4. Enable knitr in RStudio. Do this by clicking _Preferences_, then clicking the _Sweave_ tab. Next to "Weave Rnw files using", select knitr from the drop-down menu. Click _Apply_ and _Ok_.

Expand Down
Binary file added inst/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0e0c8e7

Please sign in to comment.