{"id":20206,"name":"footprint","description":"An R package to calculate carbon footprints from air travel based on IATA airport codes or latitude and longitude.","url":"https://github.com/acircleda/footprint","last_synced_at":"2026-04-23T22:30:22.359Z","repository":{"id":55580216,"uuid":"319331403","full_name":"acircleda/footprint","owner":"acircleda","description":"An R package to calculate carbon footprints from air travel based on IATA airport codes or latitude and longitude.","archived":false,"fork":false,"pushed_at":"2024-07-31T20:17:12.000Z","size":8804,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-08T15:03:39.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acircleda.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2020-12-07T13:39:28.000Z","updated_at":"2026-01-31T06:36:30.000Z","dependencies_parsed_at":"2024-11-05T23:01:24.173Z","dependency_job_id":null,"html_url":"https://github.com/acircleda/footprint","commit_stats":{"total_commits":61,"total_committers":4,"mean_commits":15.25,"dds":0.5245901639344263,"last_synced_commit":"a94b09f921223e90a6a7b21e38eb045a6e1e5625"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acircleda/footprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acircleda","download_url":"https://codeload.github.com/acircleda/footprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31808518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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"}},"owner":{"login":"acircleda","name":"Anthony Schmidt","uuid":"51770624","kind":"user","description":"","email":"","website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/51770624?u=b9e7f6b6fa6d4d31cfa1e1738f6fc8b7e542ba3d\u0026v=4","repositories_count":5,"last_synced_at":"2023-02-28T07:42:56.132Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/acircleda","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-02-28T07:42:16.505Z","updated_at":"2023-02-28T07:42:56.147Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acircleda","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acircleda/repositories"},"packages":[{"id":433380,"name":"footprint","ecosystem":"cran","description":"Calculate Air Travel Emissions","homepage":"https://github.com/acircleda/footprint","licenses":"CC0","normalized_licenses":["CC0-1.0"],"repository_url":"https://github.com/acircleda/footprint","keywords_array":[],"namespace":null,"versions_count":2,"first_release_published_at":"2021-01-06T00:00:00.000Z","latest_release_published_at":"2024-08-27T00:00:00.000Z","latest_release_number":"0.2","last_synced_at":"2026-04-18T20:01:52.203Z","created_at":"2022-04-06T22:19:55.845Z","updated_at":"2026-04-18T20:01:52.203Z","registry_url":"https://cran.r-project.org/package=footprint","install_command":null,"documentation_url":"http://cran.r-project.org/web/packages/footprint/footprint.pdf","metadata":{},"repo_metadata":{"id":55580216,"uuid":"319331403","full_name":"acircleda/footprint","owner":"acircleda","description":"An R package to calculate carbon footprints from air travel based on IATA airport codes or latitude and longitude.","archived":false,"fork":false,"pushed_at":"2024-07-31T20:17:12.000Z","size":8804,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T20:33:01.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acircleda.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-07T13:39:28.000Z","updated_at":"2024-07-31T20:17:15.000Z","dependencies_parsed_at":"2022-08-15T03:31:21.618Z","dependency_job_id":null,"html_url":"https://github.com/acircleda/footprint","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/acircleda%2Ffootprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acircleda","download_url":"https://codeload.github.com/acircleda/footprint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222129293,"owners_count":16936292,"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"},"owner_record":{"login":"acircleda","name":"Anthony Schmidt","uuid":"51770624","kind":"user","description":"","email":"","website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/51770624?u=b9e7f6b6fa6d4d31cfa1e1738f6fc8b7e542ba3d\u0026v=4","repositories_count":5,"last_synced_at":"2023-02-28T07:42:56.132Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/acircleda","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-02-28T07:42:16.505Z","updated_at":"2023-02-28T07:42:56.147Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acircleda","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acircleda/repositories"},"tags":[]},"repo_metadata_updated_at":"2024-10-29T22:59:57.528Z","dependent_packages_count":0,"downloads":305,"downloads_period":"last-month","dependent_repos_count":0,"rankings":{"downloads":74.28801592190683,"dependent_repos_count":35.45467469080226,"dependent_packages_count":29.796711368051938,"stargazers_count":14.561910628820545,"forks_count":28.830024167180024,"average":36.58626735535232},"purl":"pkg:cran/footprint","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/cran/footprint","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/cran/footprint","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/cran/footprint/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2024-10-29T19:31:09.790Z","issues_count":2,"pull_requests_count":9,"avg_time_to_close_issue":113957.5,"avg_time_to_close_pull_request":130186.33333333333,"issues_closed_count":2,"pull_requests_closed_count":9,"pull_request_authors_count":2,"issue_authors_count":2,"avg_comments_per_issue":1.0,"avg_comments_per_pull_request":0.4444444444444444,"merged_pull_requests_count":9,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":1,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":432693.0,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":1,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":3.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":1,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/issues","maintainers":[{"login":"acircleda","count":5,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/acircleda"},{"login":"KKulma","count":4,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/KKulma"}],"active_maintainers":[{"login":"acircleda","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/acircleda"}]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/footprint/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/footprint/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/footprint/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/footprint/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/footprint/codemeta","maintainers":[{"uuid":"aschmi11@utk.edu","login":null,"name":"Anthony Schmidt","email":"aschmi11@utk.edu","url":null,"packages_count":1,"html_url":null,"role":null,"created_at":"2022-11-14T17:21:40.293Z","updated_at":"2022-11-14T17:21:40.293Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/maintainers/aschmi11@utk.edu/packages"}],"registry":{"name":"cran.r-project.org","url":"https://cran.r-project.org","ecosystem":"cran","default":true,"packages_count":28128,"maintainers_count":15585,"namespaces_count":0,"keywords_count":0,"github":"r-project-org","metadata":{"icon_url":"https://cran.r-project.org/CRANlogo.png","funded_packages_count":546},"icon_url":"https://cran.r-project.org/CRANlogo.png","created_at":"2022-04-06T16:32:25.637Z","updated_at":"2026-04-03T06:40:33.945Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages","maintainers_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/maintainers","namespaces_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/namespaces"}}],"commits":{"id":723388,"full_name":"acircleda/footprint","default_branch":"master","total_commits":61,"total_committers":4,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":15.25,"dds":0.5245901639344263,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-18T20:01:35.336Z","last_synced_commit":"a94b09f921223e90a6a7b21e38eb045a6e1e5625","created_at":"2023-03-09T13:08:51.321Z","updated_at":"2026-04-18T20:01:29.852Z","committers":[{"name":"kkulma","email":"katarzyna.kulma@gmail.com","login":"KKulma","count":29},{"name":"acircleda","email":"acornrevolution@yahoo.com","login":null,"count":25},{"name":"Your","email":"your-email@example.com","login":"renoschubert","count":6},{"name":"Anthony Schmidt","email":"51770624+acircleda","login":"acircleda","count":1}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-22T00:00:10.876Z","repositories_count":6216398,"commits_count":899204063,"contributors_count":34908164,"owners_count":1144305,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"acircleda/footprint","html_url":"https://github.com/acircleda/footprint","last_synced_at":"2025-10-11T14:49:56.172Z","status":"error","issues_count":2,"pull_requests_count":9,"avg_time_to_close_issue":113957.5,"avg_time_to_close_pull_request":130186.33333333333,"issues_closed_count":2,"pull_requests_closed_count":9,"pull_request_authors_count":2,"issue_authors_count":2,"avg_comments_per_issue":1.0,"avg_comments_per_pull_request":0.4444444444444444,"merged_pull_requests_count":9,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":1,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":432693.0,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":1,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":3.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":1,"created_at":"2023-05-09T10:37:12.353Z","updated_at":"2025-10-11T14:49:56.172Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/acircleda%2Ffootprint/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":2},"pull_request_author_associations_count":{"OWNER":6,"COLLABORATOR":4},"issue_authors":{"sgichuki":1,"lilyclements":1},"pull_request_authors":{"acircleda":6,"KKulma":4},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-18T00:00:07.858Z","repositories_count":14310564,"issues_count":34535270,"pull_requests_count":113019991,"authors_count":11237972,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{},"past_year_pull_request_authors":{},"maintainers":[{"login":"acircleda","count":6,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/acircleda"},{"login":"KKulma","count":4,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/KKulma"}],"active_maintainers":[]},"events":{"total":{"WatchEvent":3},"last_year":{"WatchEvent":1}},"keywords":[],"dependencies":[{"ecosystem":"cran","filepath":"DESCRIPTION","sha":null,"kind":"manifest","created_at":"2022-08-15T03:31:21.207Z","updated_at":"2022-08-15T03:31:21.207Z","repository_link":"https://github.com/acircleda/footprint/blob/master/DESCRIPTION","dependencies":[{"id":1735386381,"package_name":"R","ecosystem":"cran","requirements":"\u003e= 2.10","direct":true,"kind":"depends","optional":false},{"id":1735386382,"package_name":"airportr","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":1735386383,"package_name":"dplyr","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":1735386384,"package_name":"magrittr","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":1735386385,"package_name":"rlang","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":1735386386,"package_name":"devtools","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":1735386387,"package_name":"knitr","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":1735386388,"package_name":"rmarkdown","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":1735386389,"package_name":"testthat","ecosystem":"cran","requirements":"\u003e= 2.1.0","direct":true,"kind":"suggests","optional":false},{"id":1735386390,"package_name":"tibble","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":1735386391,"package_name":"covr","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/R-CMD-check.yaml","sha":null,"kind":"manifest","created_at":"2024-11-05T23:01:24.024Z","updated_at":"2024-11-05T23:01:24.024Z","repository_link":"https://github.com/acircleda/footprint/blob/master/.github/workflows/R-CMD-check.yaml","dependencies":[{"id":20581585834,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v4","direct":true,"kind":"composite","optional":false},{"id":20581585835,"package_name":"r-lib/actions/setup-r","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false},{"id":20581585836,"package_name":"r-lib/actions/setup-pandoc","ecosystem":"actions","requirements":"v1","direct":true,"kind":"composite","optional":false},{"id":20581585837,"package_name":"actions/cache","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false},{"id":20581585838,"package_name":"actions/upload-artifact","ecosystem":"actions","requirements":"main","direct":true,"kind":"composite","optional":false}]}],"score":10.000251220968435,"created_at":"2023-09-11T14:52:10.773Z","updated_at":"2026-04-23T22:30:22.361Z","avatar_url":"https://github.com/acircleda.png","language":"R","category":"Emissions","sub_category":"Carbon Intensity and Accounting","monthly_downloads":305,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/acircleda/footprint/workflows/R-CMD-check/badge.svg)](https://github.com/acircleda/footprint/actions)\n[![CRAN status](https://www.r-pkg.org/badges/version/footprint)](https://CRAN.R-project.org/package=footprint)\n\u003c!-- badges: end --\u003e\n\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# footprint \n\u003cimg src=\"man/figures/footprint_hex.png\" align=\"right\" height=150/\u003e\n\n\nThe goal of footprint is to calculate carbon footprints from air travel based on IATA airport codes or latitude and longitude.\n\n## Installation\n\nYou can install the development version from [GitHub](https://github.com/) with:\n\n```{r, warning=FALSE, message=FALSE, error=FALSE, eval=FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"acircleda/footprint\")\n```\n\n## Data and Methodology\n\nPackage `footprint` uses the the Haversine great-circle distance formula\nto calculate distance between airports or distance between latitude and\nlongitude pairs. This distance is then used to derive a carbon footprint\nestimate, which is based on conversion factors from the Department for\nEnvironment, Food \u0026 Rural Affairs (UK) 2019 Greenhouse Gas Conversion\nFactors for Business Travel (air):\n\u003chttps://www.gov.uk/government/publications/greenhouse-gas-reporting-conversion-factors-2019\u003e.\n\n## Example Usage\n\nLoad `footprint` using\n\n```{r}\nlibrary(footprint)\nlibrary(tidyverse)\n```\n\n\n### Using Airport Codes\n\nYou can use pairs of three-letter IATA airport codes to calculate distance. This function uses the [`airportr`](https://github.com/dshkol/airportr) package, which contains the data and does the work of getting the distance between airports. *Note*: the `airportr` package offers a number of useful functions for looking up airports by city or name and getting the IATA airport codes.\n\n#### Calculating a Single Trip\n\nThe example below calculates a simple footprint estimation for an economy flight from Los Angeles International (LAX) to Heathrow (LHR). The estimate will be in CO~2~e (carbon dioxide equivalent, including radiative forcing). The output is always in kilograms.\n\n```{r, warning=FALSE, message=FALSE, error=FALSE}\nairport_footprint(\"LAX\", \"LHR\", \"Economy\", \"co2e\")\n```\n\n\nIf there is a layover in Chicago, you could calculate each leg of the trip as follows:\n\n```{r}\nairport_footprint(\"LAX\", \"ORD\", \"Economy\", \"co2e\") + \n  airport_footprint(\"ORD\", \"LHR\", \"Economy\", \"co2e\")\n```\n\n#### Calculating More than One Trip\n\nWe can calculate the footprint for multiple itineraries at the same time and add to an existing data frame using `mutate`. Here is some example data:\n\n```{r}\nlibrary(tibble)\n\ntravel_data \u003c- tibble(\n  name = c(\"Mike\", \"Will\", \"Elle\"),\n  from = c(\"LAX\", \"LGA\", \"TYS\"),\n  to = c(\"PUS\", \"LHR\", \"TPA\")\n)\n```\n\n```{r echo=FALSE, message=FALSE, warning=FALSE}\nlibrary(dplyr)\n\ntravel_data |\u003e\n  knitr::kable()\n```\n\nHere is how you can take the `from` and `to` data and calculate emissions for each trip. The following function calculates an estimate for CO~2~ (carbon dioxide with radiative forcing).\n\n```{r eval=FALSE, message=FALSE, warning=FALSE, include=FALSE}\ntravel_data |\u003e\n  rowwise() |\u003e\n  mutate(emissions = airport_footprint(from, to, \"Economy\", output = \"co2\"))\n```\n\n```{r echo=FALSE}\ntravel_data |\u003e\n  rowwise() |\u003e\n  mutate(emissions = airport_footprint(from, to, \"Economy\", output = \"co2\")) |\u003e\n  knitr::kable()\n```\n\n\n#### Calculating More than One Trip and Different years\n\nWe can calculate the footprint for multiple itineraries at the same time and add to an existing data frame using `mutate`. Here is some example data:\n\n```{r}\nlibrary(tibble)\n\ntravel_data \u003c- tibble(\n  name = c(\"Mike\", \"Will\", \"Elle\", \"Elle\"),\n  from = c(\"LAX\", \"LGA\", \"TYS\", \"TYS\"),\n  to = c(\"PUS\", \"LHR\", \"TPA\", \"TPA\"),\n  date = c(\"2024-04-05\", \"2023-04-02\", \"2024-06-12\", \"2019-06-12\")\n)\n```\n\n```{r eval=FALSE, message=FALSE, warning=FALSE, include=FALSE}\ntravel_data |\u003e\n  rowwise() |\u003e\n  mutate(emissions = airport_footprint(from, to, \"Economy\", output = \"co2\", year=year(date)))\n```\n\n```{r echo=FALSE}\ntravel_data |\u003e\n  rowwise() |\u003e\n  mutate(emissions = airport_footprint(from, to, \"Economy\", output = \"co2\", year=year(date))) |\u003e\n  knitr::kable()\n```\n\n## From Latitude and Longitude\n\nIf you have a list of cities, it might be easier to calculate emissions based on longitude and latitude rather than trying to locate the airports used. For example, one could take city and state data and join that with data from `maps::us.cities` to quickly get latitude and longitude. They can then use the `latlong_footprint()` function to easily calculate emissions based on either a single itinerary or multiple itineraries:\n\n### Calculating a Single Trip\n\nThe following example calculates the footprint of a flight from Los Angeles (34.052235, -118.243683) to Busan, South Korea (35.179554, 129.075638). It assumes an average passenger (no `flightClass` argument is included) and its output will be in kilograms of CO~2~e (the default)\n\n```{r}\nlatlong_footprint(34.052235, -118.243683, 35.179554, 129.075638)\n```\n\n### Calculating Multiple Trips\n\nYou can use `mutate` to calculate emissions based on a dataframe of latitude and longitude pairs.\n\nHere is some example data:\n\n```{r}\ntravel_data2 \u003c- tribble(~name, ~departure_lat, ~departure_long, ~arrival_lat, ~arrival_long,\n         # Los Angeles -\u003e Busan\n        \"Mike\", 34.052235, -118.243683, 35.179554, 129.075638,\n        # New York -\u003e London\n        \"Will\", 40.712776, -74.005974, 51.52, -0.10)\n```\n\n```{r echo=FALSE}\ntravel_data2 |\u003e knitr::kable()\n```\n\nAnd here is code to apply it to a dataframe:\n\n```{r eval=FALSE, include=TRUE}\ntravel_data2 |\u003e\n  rowwise() |\u003e\n  mutate(emissions = latlong_footprint(departure_lat,\n                                       departure_long,\n                                       arrival_lat,\n                                       arrival_long))\n```\n\n```{r echo=FALSE}\ntravel_data2 |\u003e\n  rowwise() |\u003e\n  mutate(emissions = latlong_footprint(departure_lat,\n                                       departure_long,\n                                       arrival_lat,\n                                       arrival_long)) |\u003e\n  knitr::kable()\n```\n\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/20206","html_url":"https://ost.ecosyste.ms/projects/20206"}