{"id":14290532,"url":"https://github.com/chuhousen/amerifluxr","last_synced_at":"2026-02-22T10:40:11.545Z","repository":{"id":38847957,"uuid":"335776188","full_name":"chuhousen/amerifluxr","owner":"chuhousen","description":"An R programmatic interface for AmeriFlux data and metadata","archived":false,"fork":false,"pushed_at":"2025-11-03T20:57:23.000Z","size":60484,"stargazers_count":25,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-02-14T08:08:45.410Z","etag":null,"topics":["ameriflux","api","carbon-flux","data","time-series"],"latest_commit_sha":null,"homepage":"https://chuhousen.github.io/amerifluxr/","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/chuhousen.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-03T22:48:11.000Z","updated_at":"2026-01-21T01:21:23.000Z","dependencies_parsed_at":"2023-09-26T21:20:02.992Z","dependency_job_id":"8085a4ed-fd5e-4f08-af91-f173cca521ea","html_url":"https://github.com/chuhousen/amerifluxr","commit_stats":{"total_commits":164,"total_committers":3,"mean_commits":"54.666666666666664","dds":"0.17682926829268297","last_synced_commit":"7c266641cd679432967694ddebfe5bc382511d47"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chuhousen/amerifluxr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuhousen%2Famerifluxr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuhousen%2Famerifluxr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuhousen%2Famerifluxr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuhousen%2Famerifluxr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuhousen","download_url":"https://codeload.github.com/chuhousen/amerifluxr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuhousen%2Famerifluxr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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"}},"keywords":["ameriflux","api","carbon-flux","data","time-series"],"created_at":"2024-08-23T19:01:27.883Z","updated_at":"2026-02-22T10:40:11.487Z","avatar_url":"https://github.com/chuhousen.png","language":"R","funding_links":[],"categories":["Emissions"],"sub_categories":["Emission Observation and Modeling"],"readme":"# amerifluxr \u003cimg src='man/figures/logo.png' align=\"right\" height=\"138.5\" /\u003e\n\n[![R-CMD-check](https://github.com/chuhousen/amerifluxr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/chuhousen/amerifluxr/actions/workflows/R-CMD-check.yaml)\n [![Codecov test coverage](https://codecov.io/gh/chuhousen/amerifluxr/graph/badge.svg)](https://app.codecov.io/gh/chuhousen/amerifluxr)\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/amerifluxr)](https://cran.r-project.org/package=amerifluxr)\n![CRAN\\_Downloads](https://cranlogs.r-pkg.org/badges/grand-total/amerifluxr)\n\nAn R programmatic interface for querying, downloading, and handling [AmeriFlux](https://ameriflux.lbl.gov/) data and metadata.  \n\n## Installation\n\n### Stable release\n\nTo install the current stable release use a CRAN repository:\n\n``` r\ninstall.packages(\"amerifluxr\")\nlibrary(\"amerifluxr\")\n```\n\n### Development release\n\nTo install the development releases of the package run the following\ncommands:\n\n``` r\nif(!require(devtools)){install.packages(\"devtools\")}\ndevtools::install_github(\"chuhousen/amerifluxr\")\nlibrary(\"amerifluxr\")\n```\n\nVignettes are not rendered by default, if you want to include additional\ndocumentation please use:\n\n``` r\nif(!require(devtools)){install.packages(\"devtools\")}\ndevtools::install_github(\"chuhousen/amerifluxr\", build_vignettes = TRUE)\nlibrary(\"amerifluxr\")\n```\n## Use\n\n### Obtain an AmeriFlux site list \n\nThis function obtains the latest AmeriFlux site list and\nsites' general info through the AmeriFlux web service.\n\n``` r\nsite \u003c- amf_site_info()\n\n```\n\n### Download all-site metadata\n\nAccess to AmeriFlux data requires creating an AmeriFlux account first.\nRegister an account through the\n[link](https://https://amfcdn.lbl.gov/create).\n\nThe following downloads a single file containing all AmeriFlux sites'\nmetadata (i.e., BADM data product) for sites under the CC-BY-4.0 data \nuse policy. The downloaded file is a Excel file saved to tempdir()\n(e.g., AMF\\_\\{SITES\\}\\_BIF\\_\\{POLICY\\}\\_\\{VERSION\\}\\.xlsx, SITES\n= AA-Net (all registered sites) or AA-Flx (all sites with flux/met \ndata available); POLICY = CCBY4 (shared under AmeriFlux CC-BY-4.0 \ndata use policy) or LEGACY (shared under AmeriFlux Legacy data use\npolicy)). \n\nFor details about BADM data files, see AmeriFlux \n[web page](https://ameriflux.lbl.gov/data/aboutdata/badm-data-product/).\n\n\n``` r\nfloc1 \u003c- amf_download_bif(user_id = \"my_user\",\n                          user_email = \"my_email@mail.com\",\n                          data_policy = \"CCBY4.0\",\n                          agree_policy = TRUE,\n                          intended_use = \"synthesis\",\n                          intended_use_text = \"obtain AmeriFlux sites' geolocation, IGBP, and climate classification\",\n                          out_dir = tempdir(),\n                          verbose = TRUE,\n                          site_w_data = TRUE)\n```\n\n\n| Parameter          | Description                                                                                                                     |\n| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |\n| user_id            | AmeriFlux account username                                                                                                      |\n| user_email         | AmeriFlux account user email                                                                                                    |\n| data_policy        | \"CCBY4.0\" or \"LEGACY\". AmeriFlux data are shared under two tiers of licenses as chosen by site's PI.                            |\n| agree_policy       | Acknowledge you read and agree to the AmeriFlux Data use policy                                                                 |  \n| intended_use       | The intended use category. It needs to be \"synthesis\", \"model\", \"remote_sensing\",\"other_research\", \"education\", or \"other\"      |\n| intended_use_text  | Brief description of intended use.This will be recorded in the data download log and emailed to site's PI.                      |\n| out_dir            | Output directory for downloaded data, default to tempdir()                                                                      |\n| verbose            | Show feedback on download progress                                                                                              |\n| site_w_data        | Logical, download all registered sites (FALSE) or only sites with available BASE data (TRUE)                                    |\n\nThe amf_download_bif() returns the full file path to the downloaded file,\nwhich can be used to read the file into R.\n\n``` r\nbif \u003c- amf_read_bif(file = floc1)\n\n```\n\n### Download single-site flux/met data\n\nThe following downloads AmeriFlux flux/met data (aka BASE data product)\nfrom a single site. For details about BASE data files, see AmeriFlux\n[BASE data](https://ameriflux.lbl.gov/data/data-processing-pipelines/base-publish/)\npage. \n\nThe downloaded file is a zipped file saved in tempdir()\n(e.g., AMF\\_\\{SITE_ID\\}\\_BASE-BADM\\_\\{VERSION\\}\\.zip), which contains a BASE data \nfile (e.g., AMF\\_\\{SITE_ID\\}\\_BASE\\_\\{RESOLUTION\\}\\_\\{VERSION\\}\\.csv, \nRESOLUTION = HH (half-hourly) or HR (hourly)) and a BADM data file (e.g., \nAMF\\_\\{SITE_ID\\}\\_BIF\\_\\{VERSION\\}\\.xlsx). The BADM data file is a site subset of \nthe all-site BADM downloaded through amf_download_bif().\n\n``` r\nfloc2 \u003c- amf_download_base(user_id = \"my_user\",\n                           user_email = \"my_email@mail.com\",\n                           site_id = \"US-CRT\",\n                           data_product = \"BASE-BADM\",\n                           data_policy = \"CCBY4.0\",\n                           agree_policy = TRUE,\n                           intended_use = \"remote_sensing\",\n                           intended_use_text = \"validate the model of GPP estimation\",\n                           verbose = TRUE,\n                           out_dir = tempdir())\n\n```\n\n\n| Parameter          | Description                                                                                                                     |\n| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |\n| user_id            | AmeriFlux account username                                                                                                      |\n| user_email         | AmeriFlux account user email                                                                                                    |\n| site_id            | A scalar or vector of character specifying the AmeriFlux Site ID (CC-Sss)                                                       |\n| data_product       | AmeriFlux data product. Currently, only \"BASE-BADM\" is currently supported and used as default.                                 |\n| data_policy        | \"CCBY4.0\" or \"LEGACY\". AmeriFlux data are shared under two tiers of licenses as chosen by site's PI.                            |\n| agree_policy       | Acknowledge you read and agree to the AmeriFlux Data use policy                                                                 |  \n| intended_use       | The intended use category. It needs to be \"synthesis\", \"model\", \"remote_sensing\",\"other_research\", \"education\", or \"other\"      |\n| intended_use_text  | Brief description of intended use.This will be recorded in the data download log and emailed to site's PI.                      |\n| out_dir            | Output directory for downloaded data, default to tempdir()                                                                      |\n| verbose            | Show feedback on download progress                                                                                              |\n\nThe amf_download_base() returns the full file path to the downloaded file,\nwhich can be used to read the file into R.\n\n``` r\nbase \u003c- amf_read_base(file = floc2,\n                      unzip = TRUE,\n                      parse_timestamp = TRUE)\n```\n\n\n| Parameter          | Description                                                                                                                     |\n| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |\n| file               | file path                                                                                                                       |\n| unzip              | logical, whether to unzip. Set TRUE if reading from a zipped file                                                               |\n| parse_timestamp    | logical, whether to parse the timestamp                                                                                         |\n\n\n### Download multiple-site flux/met data\n\nThe following downloads AmeriFlux flux/met data from multiple sites. \nThe downloaded files are organized by sites, with one zipped file for\neach site, similar to single-site download.\n\n``` r\namf_download_base(user_id = \"my_user\",\n                  user_email = \"my_email@mail.com\",\n                  site_id = c(\"US-CRT\", \"US-WPT\", \"US-Oho\"),\n                  data_product = \"BASE-BADM\",\n                  data_policy = \"CCBY4.0\",\n                  agree_policy = TRUE,\n                  intended_use = \"model\",\n                  intended_use_text = \"Data-driven modeling, for training models and cross-validation\",\n                  verbose = TRUE,\n                  out_dir = tempdir())\n\n```\n### Additional functionalities\n\n* [Site Selection Vignette](https://chuhousen.github.io/amerifluxr/articles/site_selection.html)\ndemonstrates examples to query a list of target sites based on\nsites' general information and availability of metadata and data. \n\n* [Data Import Vignette](https://chuhousen.github.io/amerifluxr/articles/data_import.html)\ndemonstrates examples to import data and metadata downloaded from\nAmeriFlux, and parse and clean data for further use. \n\n## Citation\n\nChu, Housen, and Hufkens, Koen. \"amerifluxr v1.0.0.\" Computer software. May 10, 2021. https://github.com/chuhousen/amerifluxr. https://doi.org/10.11578/dc.20210730.2.\n\n## Acknowledgement\n\nWe thank the AmeriFlux site teams for sharing their data and \nmetadata with the network. Funding for these flux sites is \nacknowledged in the site data DOI on \n[AmeriFlux website](https://ameriflux.lbl.gov/).\nThis package was supported in part by funding provided to the\nAmeriFlux Management Project by the U.S. Department of Energy’s\nOffice of Science under Contract No. DE-AC0205CH11231.\nWe also thank Adam Young, Minkyu Moon, Erica Orcutt, Manuel Helbig\nfor testing the package and providing valuable feedback.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuhousen%2Famerifluxr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuhousen%2Famerifluxr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuhousen%2Famerifluxr/lists"}