Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat@2022 update #4

Merged
merged 3 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: babynamesIL
Title: Israel Baby Names 1948-2021
Version: 0.0.1
Title: Israel Baby Names 1948-2022
Version: 0.0.2
Authors@R:
person("Aviezer", "Lifshitz", , "aviezer.lifshitz@weizmann.ac.il", role = c("aut", "cre"))
Description: Israeli baby names provided by Israel's Central Bureau of Statistics. The package contains only names used for at least 5 children in at least one gender and sector ("Jewish", "Muslim", "Christian", "Druze" and "Other"). Data was downloaded from: <https://www.cbs.gov.il/he/publications/LochutTlushim/2020/%D7%A9%D7%9E%D7%95%D7%AA-%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D.xlsx>.
Expand All @@ -19,6 +19,6 @@ LazyData: true
LazyDataCompression: xz
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.0
RoxygenNote: 7.2.3
Depends:
R (>= 2.10)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# babynamesIL 0.0.2

* Added 2022 data.

# babynamesIL 0.0.1

* Initial release.
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NULL

#' Israeli baby names total numbers.
#'
#' Total number of babies per name, sector and gender at the years 1948-2021.
#' Total number of babies per name, sector and gender at the years 1948-2022.
#'
#'
#' @format A data frame with 4 variables: \code{sector}, \code{sex}, \code{name}, \code{n}.
Expand Down
28 changes: 15 additions & 13 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ output: github_document

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

Expand All @@ -20,12 +20,12 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/aviezerl/babynamesIL/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/aviezerl/babynamesIL/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

`babynamesIL` contains the a dataset of names given to Israeli babies in the years 1948-2021. The data was downloaded from the Israeli Bureau of
`babynamesIL` contains the a dataset of names given to Israeli babies in the years 1948-2022. The data was downloaded from the Israeli Bureau of
Statistics (LAMAS). Only names used for at least 5 children in at least one gender and sector ("Jewish", "Muslim", "Christian", "Druze" and "Other") are included.

The following objects are available:

- `babynamesIL`: For each year in from 1948 to 2021, the number of babies of each sex and sector given to each name.
- `babynamesIL`: For each year in from 1948 to 2022, the number of babies of each sex and sector given to each name.
- `babynamesIL_totals`: a dataframe with the total number of of babies with each names per sex and sector.


Expand Down Expand Up @@ -54,30 +54,32 @@ head(babynamesIL_totals)
Add the missing values:

```{r example-missing}
library(dplyr)
babynamesIL %>%
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0))
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0))
```

Plot trajectory of names:

```{r example-traj}
library(ggplot2)
library(dplyr)
babynamesIL %>%
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0)) %>%
filter(name == "מעיין", sector == "Jewish") %>%
ggplot(aes(x = year, y = prop, color = sex)) +
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0)) %>%
filter(name == "מעיין", sector == "Jewish") %>%
ggplot(aes(x = year, y = prop, color = sex)) +
geom_line() +
ggsci::scale_color_aaas() +
scale_y_continuous(labels = scales::percent) +
ggtitle("מעיין הבן מול מעיין הבת") +
ggtitle("מעיין הבן מול מעיין הבת") +
theme_classic()
```


## Source of data

Data was downloaded from: [here](https://www.cbs.gov.il/he/publications/LochutTlushim/2020/%D7%A9%D7%9E%D7%95%D7%AA-%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D.xlsx)
Data was downloaded from: [here](https://www.cbs.gov.il/he/publications/LochutTlushim/2020/%D7%A9%D7%9E%D7%95%D7%AA-%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D.xlsx).

2022 data was downloaded from: [here](https://www.cbs.gov.il/he/mediarelease/Pages/2023/%D7%94%D7%A9%D7%9E%D7%95%D7%AA-%D7%94%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D-%D7%A9%D7%A0%D7%99%D7%AA%D7%A0%D7%95-%D7%9C%D7%99%D7%9C%D7%99%D7%93%D7%99-2022.aspx)

## Web App

Expand Down
96 changes: 53 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ status](https://www.r-pkg.org/badges/version/babynamesIL)](https://CRAN.R-projec
<!-- badges: end -->

`babynamesIL` contains the a dataset of names given to Israeli babies in
the years 1948-2021. The data was downloaded from the Israeli Bureau of
the years 1948-2022. The data was downloaded from the Israeli Bureau of
Statistics (LAMAS). Only names used for at least 5 children in at least
one gender and sector (“Jewish”, “Muslim”, “Christian”, “Druze” and
“Other”) are included.

The following objects are available:

- `babynamesIL`: For each year in from 1948 to 2021, the number of
babies of each sex and sector given to each name.
- `babynamesIL_totals`: a dataframe with the total number of of babies
with each names per sex and sector.
- `babynamesIL`: For each year in from 1948 to 2022, the number of
babies of each sex and sector given to each name.
- `babynamesIL_totals`: a dataframe with the total number of of babies
with each names per sex and sector.

## Installation

Expand All @@ -40,47 +40,32 @@ library(babynamesIL)

# yearly data
head(babynamesIL)
#> # A tibble: 6 x 6
#> sector year sex name n prop
#> 1 Jewish 1948 F שרה 326 0.05002302
#> 2 Jewish 1948 F רחל 323 0.04956268
#> 3 Jewish 1948 F אסתר 263 0.04035599
#> 4 Jewish 1948 F חנה 247 0.03790087
#> 5 Jewish 1948 F מרים 190 0.02915452
#> 6 Jewish 1948 F רות 165 0.02531840
#> # A tibble: 6 × 6
#> sector year sex name n prop
#> <chr> <dbl> <chr> <chr> <int> <dbl>
#> 1 Christian 1948 F לילה 19 0.129
#> 2 Christian 1948 F סמירה 14 0.0952
#> 3 Christian 1948 F מארי 13 0.0884
#> 4 Christian 1948 F נואל 11 0.0748
#> 5 Christian 1948 F אמל 9 0.0612
#> 6 Christian 1948 F מרים 7 0.0476

# totals per name
head(babynamesIL_totals)
#> # A tibble: 6 x 4
#> sector sex name total
#> 1 Jewish F נועה 47398
#> 2 Jewish F רחל 46301
#> 3 Jewish F יעל 45329
#> 4 Jewish F שרה 45059
#> 5 Jewish F מיכל 44945
#> 6 Jewish F אסתר 44657
#> # A tibble: 6 × 4
#> sector sex name total
#> <chr> <chr> <chr> <int>
#> 1 Christian F מריה 1063
#> 2 Christian F אמל 849
#> 3 Christian F מרים 751
#> 4 Christian F מארי 580
#> 5 Christian F רים 555
#> 6 Christian F מאיה 530
```

Add the missing values:

``` r
babynamesIL %>%
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0))
#> # A tibble: 3,133,900 x 6
#> sector year sex name n prop
#> 1 Christian 1948 F 'ג'ורג' 0 0
#> 2 Christian 1948 F אאוס 0 0
#> 3 Christian 1948 F אבא 0 0
#> 4 Christian 1948 F אבגיל 0 0
#> 5 Christian 1948 F אבטיסאם 0 0
#> 6 Christian 1948 F אבי 0 0
#> # ... with 3,133,894 more rows
```

Plot trajectory of names:

``` r
library(ggplot2)
library(dplyr)
#>
#> Attaching package: 'dplyr'
Expand All @@ -91,13 +76,35 @@ library(dplyr)
#>
#> intersect, setdiff, setequal, union
babynamesIL %>%
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0)) %>%
filter(name == "מעיין", sector == "Jewish") %>%
ggplot(aes(x = year, y = prop, color = sex)) +
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0))
#> # A tibble: 3,204,000 × 6
#> sector year sex name n prop
#> <chr> <dbl> <chr> <chr> <int> <dbl>
#> 1 Christian 1948 F 'ג'ורג' 0 0
#> 2 Christian 1948 F אאוס 0 0
#> 3 Christian 1948 F אבא 0 0
#> 4 Christian 1948 F אבגיל 0 0
#> 5 Christian 1948 F אבטיסאם 0 0
#> 6 Christian 1948 F אבי 0 0
#> 7 Christian 1948 F אבי-אברהם 0 0
#> 8 Christian 1948 F אביאור 0 0
#> 9 Christian 1948 F אביאל 0 0
#> 10 Christian 1948 F אביב 0 0
#> # ℹ 3,203,990 more rows
```

Plot trajectory of names:

``` r
library(ggplot2)
babynamesIL %>%
tidyr::complete(sector, year, sex, name, fill = list(n = 0, prop = 0)) %>%
filter(name == "מעיין", sector == "Jewish") %>%
ggplot(aes(x = year, y = prop, color = sex)) +
geom_line() +
ggsci::scale_color_aaas() +
scale_y_continuous(labels = scales::percent) +
ggtitle("מעיין הבן מול מעיין הבת") +
ggtitle("מעיין הבן מול מעיין הבת") +
theme_classic()
```

Expand All @@ -106,7 +113,10 @@ babynamesIL %>%
## Source of data

Data was downloaded from:
[here](https://www.cbs.gov.il/he/publications/LochutTlushim/2020/%D7%A9%D7%9E%D7%95%D7%AA-%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D.xlsx)
[here](https://www.cbs.gov.il/he/publications/LochutTlushim/2020/%D7%A9%D7%9E%D7%95%D7%AA-%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D.xlsx).

2022 data was downloaded from:
[here](https://www.cbs.gov.il/he/mediarelease/Pages/2023/%D7%94%D7%A9%D7%9E%D7%95%D7%AA-%D7%94%D7%A4%D7%A8%D7%98%D7%99%D7%99%D7%9D-%D7%A9%D7%A0%D7%99%D7%AA%D7%A0%D7%95-%D7%9C%D7%99%D7%9C%D7%99%D7%93%D7%99-2022.aspx)

## Web App

Expand Down
Loading
Loading