Skip to content

Commit

Permalink
typos in the vignettes corrected.
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiacek committed Dec 7, 2024
1 parent 0aa1a1a commit e94f4d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
8 changes: 6 additions & 2 deletions vignettes/articles/get-cp-example.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "get-cp-example"
title: "Get Country Profiles"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{pipr}
%\VignetteIndexEntry{get-cp-example}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -16,6 +16,10 @@ knitr::opts_chunk$set(
)
```

```{r}
library(pipr)
```

## Overview

The `get_cp()` and `get_cp_ki()` functions provide **country profile data**, also available in [PIP's Country Profile page](https://pip.worldbank.org/country-profiles/IDN). This dataset comes from the [Global Monitoring Indicators (GMI)](https://datacatalog.worldbank.org/int/search/dataset/0065517/global-monitoring-indicators--gmi-), a set of harmonized indicators produced from the Global Monitoring Database (GMD) [^1]
Expand Down
16 changes: 9 additions & 7 deletions vignettes/articles/get-gd-example.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "get-gd-example"
title: "Get Grouped Data Parameters"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{pipr}
%\VignetteIndexEntry{get-gd-example}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down Expand Up @@ -159,12 +159,12 @@ ggplot(poverty_stats, aes(x = poverty_line)) +

### Lorenz Curve Data
```{r, warning=FALSE, message=FALSE}
lorenz_points_lq <- get_gd(datt_data$L, datt_data$p, estimate = "lorenz", lorenz = "lq", server = "dev")
lorenz_points_lq_10 <- get_gd(datt_data$L, datt_data$p, estimate = "lorenz", lorenz = "lq", n_bins = 10, server = "dev")
lorenz_points_lq <- get_gd(datt_rural$L, datt_rural$p, estimate = "lorenz", lorenz = "lq")
lorenz_points_lq_10 <- get_gd(datt_rural$L, datt_rural$p, estimate = "lorenz", lorenz = "lq", n_bins = 10)
ggplot() +
geom_bar(data = lorenz_points_lq_10, aes(x = weight, y = welfare), stat = "identity", fill = "darkorange", alpha = 0.3) +
geom_point(data = datt_data, aes(x = p, y = L), color = "darkorange", size = 2) +
geom_point(data = datt_rural, aes(x = p, y = L), color = "darkorange", size = 2) +
geom_point(data = lorenz_points_lq, aes(x = weight, y = welfare), color = "darkorange", size = 0.5) +
geom_abline(intercept = 0, slope = 1, color = "black") +
labs(
Expand All @@ -174,10 +174,12 @@ ggplot() +
) +
theme_minimal()
```


### Rural vs Urban
```{r, warning=FALSE, message=FALSE}
lorenz_rural <- get_gd(datt_rural$L, datt_rural$p, estimate = "lorenz", lorenz = "lq", server = "dev", n_bins = 1000)
lorenz_urban <- get_gd(datt_urban$L, datt_urban$p, estimate = "lorenz", lorenz = "lq", server = "dev", n_bins = 1000)
lorenz_rural <- get_gd(datt_rural$L, datt_rural$p, estimate = "lorenz", lorenz = "lq", n_bins = 1000)
lorenz_urban <- get_gd(datt_urban$L, datt_urban$p, estimate = "lorenz", lorenz = "lq", n_bins = 1000)
ggplot() +
geom_point(data = lorenz_rural, aes(x = weight, y = welfare), color = "darkorange", size = 0.5) +
Expand Down

0 comments on commit e94f4d8

Please sign in to comment.