{"id":14065934,"url":"https://github.com/associatedpress/cookiecutter-r-project","last_synced_at":"2025-07-29T21:34:17.164Z","repository":{"id":72275995,"uuid":"79505418","full_name":"associatedpress/cookiecutter-r-project","owner":"associatedpress","description":"Basic cookiecutter template for R projects","archived":false,"fork":false,"pushed_at":"2024-01-11T22:14:09.000Z","size":30,"stargazers_count":32,"open_issues_count":1,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-13T07:10:02.594Z","etag":null,"topics":["cookiecutter","r"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/associatedpress.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-01-19T23:27:17.000Z","updated_at":"2024-08-09T11:38:16.000Z","dependencies_parsed_at":"2024-01-12T02:13:08.395Z","dependency_job_id":"e0b3fa12-99b2-478d-8973-3928311b3fbd","html_url":"https://github.com/associatedpress/cookiecutter-r-project","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/associatedpress%2Fcookiecutter-r-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/associatedpress%2Fcookiecutter-r-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/associatedpress%2Fcookiecutter-r-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/associatedpress%2Fcookiecutter-r-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/associatedpress","download_url":"https://codeload.github.com/associatedpress/cookiecutter-r-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228052639,"owners_count":17862105,"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":["cookiecutter","r"],"created_at":"2024-08-13T07:04:51.028Z","updated_at":"2024-12-04T05:31:08.926Z","avatar_url":"https://github.com/associatedpress.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# AP R Cookiecutter\n\nThis is a project template powered by [Cookiecutter](https://github.com/cookiecutter/cookiecutter) for use with [datakit-project](https://github.com/associatedpress/datakit-project/).\n\n## Structure\n\n```\n.\n├── .Rprofile\n├── .gitignore\n├── README.md\n├── analysis\n│   └── archive\n│   └── markdown\n├── data\n│   ├── documentation\n│   ├── handmade\n│   ├── html_reports\n│   ├── processed\n│   ├── public\n│   └── source\n├── etl\n├── publish\n├── scratch\n├── viz\n└── {{cookiecutter.project_slug}}.Rproj\n```\n\n- `.Rprofile`\n  - Stores environment variables for local R projects.\n- `.gitignore`\n  - Ignores `packrat` and R user profile temporary files.\n- `README.md`\n  - Project-specific readme with boilerplate for data projects.\n  - Includes sourcing details and places to explain how to replicate/remake the project.\n- `analysis`\n  - R code that involves analysis on already-cleaned data. Code for cleaning data should go in `etl`.\n    - Multiple analysis files are numbered sequentially.\n    - If we are sharing the data, last analysis script is called make_dw_files.R to write_csv to public folder.\n  - `analysis/archive`\n    - Any analyses for story threads that are no longer being investigated are placed here for reference.\n  - `analysis/markdown`\n    - Any R Markdown files go here. \n    - The AP has an R Markdown template here: https://github.com/associatedpress/apstyle\n- `data`\n  - This is the directory used with our `datakit-data` plugin.\n  - `data/documentation`\n    - Documentation on data files should go here - data dictionaries, manuals, interview notes.\n  - `data/handmade`\n    - Manually created data sets by reporters go here.\n  - `data/html_reports`\n    - Any HTML reports or pages generated by code should go here. These are usually RMarkdown reports for sharing with reporters.\n  - `data/processed`\n    - Data that has been processed by scripts in this project and is clean and ready for analysis goes here.\n  - `data/public`\n    - Public-facing data files (i.e., final datasets we share with reporters/make accessible) go here - data files which are 'live'.\n  - `data/source`\n    - Original data from sources goes here.\n- `etl`\n  - ETL (extract, transform, load) scripts for reading in source data and cleaning and standardizing it to prepare for analysis go here.\n    - Multiple etl files are numbered.\n    - Joins are included in etl process.\n    - Last step of ETL process is to output an RDS file to data/processed.\n        - naming convention: etl_WHATEVERNAME.rds\n- `publish`\n  - This directory holds all documents in the project that will be public facing (e.g. data.world RMarkdown files).\n- `scratch`\n  - This directory contains scratch materials that will not be used in the project at the end.\n  - Common cases are filtered tables or quick visualizations for reporters.\n  - This directory is not tracked in git.\n- `viz`\n  - Graphics and visualization development specific work such as web interactive code should go here.\n- `{{cookiecutter.project_slug}}.Rproj`\n  - This is the .Rproj file that can be used with RStudio to work within the project.\n\n## Usage\n\nYou will need to clone this repository to `~/.cookiecutters/` (make the directory if it doesn't exist):\n\n```\ncd path/to/.cookiecutters\ngit clone git@github.com:associatedpress/cookiecutter-r-project\n```\n\nThen, use `datakit project`:\n\n```\ndatakit project create --template cookiecutter-r-project\n```\n\nIf you'd like to avoid specifying the template each time, you can edit `~/.datakit/plugins/datakit-project/config.json` to use this template by default:\n\n```\n{\"default_template\": \"/Users/lfenn/.cookiecutters/cookiecutter-r-project\"}\n```\n\n## Configuration\n\nYou can set the default name, email, etc. for a project in the `cookiecutter.json` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassociatedpress%2Fcookiecutter-r-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassociatedpress%2Fcookiecutter-r-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassociatedpress%2Fcookiecutter-r-project/lists"}