{"id":19487143,"url":"https://github.com/tylerlittlefield/treeco","last_synced_at":"2025-09-04T02:37:38.433Z","repository":{"id":182545139,"uuid":"144327733","full_name":"tylerlittlefield/treeco","owner":"tylerlittlefield","description":":deciduous_tree: Ecosystem benefits of Trees","archived":false,"fork":false,"pushed_at":"2018-12-08T16:28:55.000Z","size":8083,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-14T21:46:55.892Z","etag":null,"topics":["forestry","r","rstats","trees"],"latest_commit_sha":null,"homepage":"https://treeco.netlify.com/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tylerlittlefield.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,"governance":null}},"created_at":"2018-08-10T20:05:47.000Z","updated_at":"2023-11-15T23:26:49.000Z","dependencies_parsed_at":"2023-07-20T12:30:52.767Z","dependency_job_id":null,"html_url":"https://github.com/tylerlittlefield/treeco","commit_stats":null,"previous_names":["tylerlittlefield/treeco"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tylerlittlefield/treeco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerlittlefield%2Ftreeco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerlittlefield%2Ftreeco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerlittlefield%2Ftreeco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerlittlefield%2Ftreeco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylerlittlefield","download_url":"https://codeload.github.com/tylerlittlefield/treeco/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerlittlefield%2Ftreeco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273542728,"owners_count":25124216,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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"}},"keywords":["forestry","r","rstats","trees"],"created_at":"2024-11-10T20:44:11.033Z","updated_at":"2025-09-04T02:37:38.401Z","avatar_url":"https://github.com/tylerlittlefield.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, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# treeco \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=150/\u003e\n\n[![Travis build status](https://travis-ci.org/tyluRp/treeco.svg?branch=master)](https://travis-ci.org/tyluRp/treeco)\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/tyluRp/treeco?branch=master\u0026svg=true)](https://ci.appveyor.com/project/tyluRp/treeco)\n[![Coverage status](https://codecov.io/gh/tyluRp/treeco/branch/master/graph/badge.svg)](https://codecov.io/github/tyluRp/treeco?branch=master)\n[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n\n\u003cimg src=\"man/figures/co2_plot.png\" align=\"center\"/\u003e\n\nThe goal of `treeco` is to provide R users a tool for calculating the eco benefits of trees. All data used to calculate benefits is ripped from OpenStreetMaps [`otm-ecoservice`](https://github.com/OpenTreeMap/otm-ecoservice) repository which was (probably) ripped from [i-Tree](https://www.itreetools.org/)'s Eco or Streets software. A single tree is represented by 15 rows and 8 columns as there are 15 benefits calculated for every tree. Since tree inventories can be rather large, `treeco` utilizes the [`data.table`](https://github.com/Rdatatable/data.table) package for speed. All calculations are done on unique species/dbh pairs to avoid redundant computation. \n\n## Installation\n\n`treeco` isn't available on CRAN but you can install it directly from github using [`devtools`](https://github.com/r-lib/devtools):\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"tylurp/treeco\")\n```\n\n## A reproducible example\n\nWe can use the [`trees`](https://stat.ethz.ch/R-manual/R-patched/library/datasets/html/trees.html) dataset to demonstrate how `eco_guess` and `eco_run_all` works:\n\n```{r, message=FALSE, warning=FALSE}\nlibrary(dplyr)\nlibrary(treeco)\n\ndf_trees \u003c- trees %\u003e% \n  mutate(common_name = \"Black cherry\") %\u003e% \n  select(common_name, Girth) %\u003e% \n  mutate(botanical_name = eco_guess(common_name, \"botanical\"))\n\neco_run_all(\n  data = df_trees,                  # dataset or path to CSV\n  common_col = \"common_name\",       # common name field\n  botanical_col = \"botanical_name\", # botanical name field\n  dbh_col = \"Girth\",                # dbh field\n  region = \"PiedmtCLT\",             # region code\n  n = 0.99,                         # optional, threshold for species guessing\n  ) %\u003e% as_tibble()\n```\n\n## More examples\n\nUse `eco_run` to calculate benefits for a single tree:\n\n```{r}\ntreeco::eco_run(\"Common fig\", 20, \"InlEmpCLM\")\n```\n\nOne issue with eco benefits is that they all rely on i-Tree's `master_species_list` which is a list of 3,000+ species, therefore a users data needs to fit this list in order to extract benefits. For example, \"Commn fig\" doesn't match i-Tree's \"Common fig\" because of the typo. So far, there really isn't a great solution to this. For now, `treeco` guesses the species code on the fly by quantifying the \"similarity\", anything below 90% similar is immediately discarded.\n\nFor example, if we misspell \"Common fig\" as \"Commn fig\":\n\n```{r}\ntreeco::eco_run(\"Commn fig\", 20, \"InlEmpCLM\")\n```\n\nIf you are missing a field, you can use `eco_guess` to try and find it:\n\n```{r}\nx \u003c- c(\"common fig\", \"red maple\", \"fir\")\ntreeco::eco_guess(x, \"botanical\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerlittlefield%2Ftreeco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylerlittlefield%2Ftreeco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerlittlefield%2Ftreeco/lists"}