{"id":18241562,"url":"https://github.com/ttimbers/canlang","last_synced_at":"2025-04-04T10:30:55.196Z","repository":{"id":48133923,"uuid":"285185140","full_name":"ttimbers/canlang","owner":"ttimbers","description":"R Data package for Canadian language data collected via the Canadian Census.","archived":false,"fork":false,"pushed_at":"2020-09-07T21:56:22.000Z","size":1543,"stargazers_count":8,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T09:02:31.135Z","etag":null,"topics":["census","data","language","package","r"],"latest_commit_sha":null,"homepage":"https://ttimbers.github.io/canlang/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttimbers.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-05T05:04:49.000Z","updated_at":"2024-05-11T21:50:03.000Z","dependencies_parsed_at":"2022-08-12T19:30:43.587Z","dependency_job_id":null,"html_url":"https://github.com/ttimbers/canlang","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttimbers%2Fcanlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttimbers%2Fcanlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttimbers%2Fcanlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttimbers%2Fcanlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttimbers","download_url":"https://codeload.github.com/ttimbers/canlang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247160285,"owners_count":20893802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["census","data","language","package","r"],"created_at":"2024-11-05T05:42:28.223Z","updated_at":"2025-04-04T10:30:54.080Z","avatar_url":"https://github.com/ttimbers.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# canlang \u003ca href='https://ttimbers.github.io/canlang'\u003e\u003cimg src='man/figures/hex-canlang.png' align=\"right\" height=\"138.5\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R build status](https://github.com/ttimbers/canlang/workflows/R-CMD-check/badge.svg)](https://github.com/ttimbers/canlang/actions)\n[![R build status](https://github.com/ttimbers/canlang/workflows/pkgdown/badge.svg)](https://github.com/ttimbers/canlang/actions)\n\u003c!-- badges: end --\u003e\n\nThe goal of {canlang} is to easily share language data collected in the 2016 Canadian census. This data was retreived from the 2016 Canadian census data set using the {[cancensus](https://mountainmath.github.io/cancensus/index.html)} R package.\n\nThis package contains three data sets:\n\n1. [`can_lang`](#example-usage-of-can_lang): Contains the counts of the total number of Canadians that report each language as their mother tongue, which language they speak most often at home, which language they use most often at work, and which language they have knowledge for.\n\n2. [`region_lang`](#example-usage-of-region_lang): For each census division, it contains the counts of how many Canadians report each language as their mother tongue, which language they speak most often at home, which language they use most often at work, and which language they have knowledge for. \n\n3. [`region_data`](#example-usage-of-region_data): For each census division, it contains the statistics for number of households, land area, population and number of dwellings. \n\n## Installation\n\nYou can install the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"ttimbers/canlang\")\n```\n## Example usage of `can_lang`\n\nThe data set `can_lang` contains the counts of the total number of Canadians that report each language as their mother tongue, which language they speak most often at home, which language they use most often at work, and which language they have knowledge for. This data was recorded in the 2016 Census:\n\n```{r example-can_lang}\nlibrary(canlang)\nhead(can_lang)\n```\n\n```{r example-plot-from-data, warning = FALSE, fig.height = 3.5, fig.retina = 2}\nlibrary(ggplot2)\nggplot2::ggplot(data = can_lang,\n       aes(x = most_at_home, y = mother_tongue, \n           colour = category, shape = category)) + \n    geom_point(alpha = 0.7) +\n    scale_color_manual(values = c(\"blue3\",\"red3\",\"black\")) +\n    scale_y_log10(name = \"Number of Canadians reporting the \\n language as their mother tongue\", \n                       labels = scales::comma) +\n    scale_x_log10(name = \"Number of Canadians speaking the language \\n as their primary language at home\", \n                       labels = scales::comma) +\n    annotation_logticks() +\n    theme_bw()\n```\n\n## Example usage of `region_lang`\n\nFor each census metropolitan area (CMA), the data set `region_lang` contains the counts of how many Canadians report each language as their mother tongue, which language they speak most often at home, which language they use most often at work, and which language they have knowledge for. \n\n```{r example-region_lang, warning = FALSE, message = FALSE}\nlibrary(canlang)\nlibrary(dplyr)\nregion_lang %\u003e% \n    filter(region == \"Vancouver\") %\u003e% \n    arrange(desc(mother_tongue)) %\u003e% \n    head()\n```\n\n## Example usage of `region_data`\n\nFor each census metropolitan area (CMA), the data set `region_data` contains the statistics for number of households, land area, population and number of dwellings.\n\n```{r example-region_data, warning = FALSE, message = FALSE}\nlibrary(canlang)\nlibrary(dplyr)\nregion_data %\u003e% \n    arrange(desc(population)) %\u003e% \n    head()\n```\n\n## Plain text, excel and SQLite database files\n\nWe have included several different plain text files, an excel files and a SQLite database file in this repo to be used for practice importing from these filetypes. Specifically, they are:\n\n### Canada-level\n+ [`can_lang.csv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/can_lang.csv): the same dataset available via `canlang::can_lang` stored as a vanilla `.csv` file.\n+ [`can_lang-meta-data.csv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/can_lang-meta-data.csv): the same dataset available via `canlang::can_lang` stored as a vanilla `.csv` file with two rows of metadata that should be skipped.\n+ [`can_lang.tsv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/can_lang.tsv): the same dataset available via `canlang::can_lang` stored as a `.tsv` (tab separated) file and has no column names.\n+ [`can_lang.xlsx`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/can_lang.xlsx): the same dataset available via `canlang::can_lang` stored as a `.xlsx` file. Can be read in using the {[readxl](https://readxl.tidyverse.org/)} package.\n+ [`can_lang.db`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/can_lang.db): the same dataset available via `canlang::can_lang` stored as a SQLite database (`.db`) file. Can be read in using the {[RSQLite](https://rsqlite.r-dbi.org/)} package.\n\n### Census metroolitan area (CMA)-level\n+ [`vancouver_lang.csv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/vancouver_lang.csv) \u0026 [`calgary_lang.csv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/calgary_lang.csv): data for Vancouver, BC and Calgary, AB, respectively, stored as a vanilla `.csv` file.\n+ [`victoria_lang.csv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/victoria_lang.csv): data for Victoria, BC stored as a vanilla `.tsv` file.\n+ [`kelowna_lang.csv`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/kelowna_lang.csv): data for Kelowna, BC stored as a `.csv` file (csv2 flavour) with metadata in the header and footer that should be skipped.\n+ [`abbotsford_lang.xlsx`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/abbotsford_lang.xlsx): data for Abbotsford, BC stored as a `.xlsx` file where sheet 1 is the column names, and sheet 2 is the data with no column names. Can be read in using the {[readxl](https://readxl.tidyverse.org/)} package.\n+ [`edmonton_lang.xlsx`](https://github.com/ttimbers/canlang/blob/master/inst/extdata/edmonton_lang.xlsx): data for Edmonton, AB stored as a `.xlsx` file where all the data is in sheet 1.\n\n## How this was made\n\nThe [`data-raw`](https://github.com/ttimbers/canlang/tree/master/data-raw) directory contains the the scripts necessary to create everything in this package, including the R data objects and the plain text, excel and SQLite database files.\n\n## References\n\n**Data originally published in:** \n\n+ Source: Statistics Canada, Census of Population, 2016. Reproduced and distributed on an \"as is\" basis with the permission of Statistics Canada.\n\n\n**Package development resources:**\n\n+ von Bergmann, J., Aaron Jacobs, Dmitry Shkolnik (2020). cancensus: R package to access, retrieve, and work with Canadian Census data and geography. v0.3.2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttimbers%2Fcanlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttimbers%2Fcanlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttimbers%2Fcanlang/lists"}