Skip to content

Commit

Permalink
added README
Browse files Browse the repository at this point in the history
  • Loading branch information
sskorik01 committed Dec 29, 2023
1 parent 5448278 commit 80a258c
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 44 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^docs$
^pkgdown$
^CITATION\.cff$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
76 changes: 62 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ knitr::opts_chunk$set(
fig.path = "man/figures/README-",
out.width = "100%"
)
library(tidyverse)
library(epoxy)
library(leaflet)
library(chckapmalawi)
```

# chckapmalawi

<!-- badges: start -->
[![R-CMD-check](https://github.com/openwashdata/chckapmalawi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/chckapmalawi/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of chckapmalawi is to ...
This packages compiles insights from a Knowledge, Attitudes, and Practices (KAP) Survey conducted by [BASEflow](https://baseflowmw.org/) for Waste Advisers in Malawi, focusing on Community Health Centers (CHCs).

## Installation

Expand All @@ -28,27 +34,69 @@ You can install the development version of chckapmalawi from [GitHub](https://gi
# install.packages("devtools")
devtools::install_github("openwashdata/chckapmalawi")
```
Alternatively, you can download the individual dataset as a CSV or XLSX
file from the table below.

```{r, echo=FALSE}
library(dplyr)
library(stringr)
library(readr)
extdata_path <- "https://github.com/openwashdata/chckapmalawi/raw/main/inst/extdata/"
read_csv("data-raw/dictionary.csv", col_types = cols(.default = "c")) |>
distinct(file_name) |>
mutate(file_name = str_remove(file_name, ".rda")) |>
rename(dataset = file_name) |>
mutate(
CSV = paste0("[Download CSV](", extdata_path, dataset, ".csv)"),
XLSX = paste0("[Download XLSX](", extdata_path, dataset, ".xlsx)")
) |>
knitr::kable(show_col_types = FALSE)
## Example
```

## Project goal

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

```{r example}

## Data

The data set covers diverse aspects including household demographics, CHC membership, water sources, sanitation, nutrition knowledge, hygiene practices, and environmental conditions. It was collected in 20XX.

The package provides access to a single data sets.

```{r, echo = TRUE}
library(chckapmalawi)
library(tidyverse)
## basic example code
```

```{r}
chckapmalawi |>
count(water_pay)
The `chckapmalawi` data set has `r ncol(chckapmalawi)`
variables and `r nrow(chckapmalawi)` observations. For an overview
of the variable names, see the following table.

```{r, eval=FALSE}
chckapmalawi
```

```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv", col_types = cols(.default = "c")) |>
dplyr::filter(file_name == "chckapmalawi.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```

```{r}
## Example

chckapmalawi |>
ggplot(aes(x = water_pay)) +
geom_bar()
```

## License

Data are available as
[CC-BY](https://github.com/openwashdata/basisghana/LICENSE.md).

## Citation

To cite this package, please use:

```{r}
citation("chckapmalawi")
```
Loading

0 comments on commit 80a258c

Please sign in to comment.