amerifluxr
An R programmatic interface for AmeriFlux data and metadata
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 3 committers (33.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.5%) to scientific vocabulary
Keywords
Repository
An R programmatic interface for AmeriFlux data and metadata
Basic Info
- Host: GitHub
- Owner: chuhousen
- License: other
- Language: R
- Default Branch: master
- Homepage: https://chuhousen.github.io/amerifluxr/
- Size: 54.2 MB
Statistics
- Stars: 23
- Watchers: 4
- Forks: 5
- Open Issues: 2
- Releases: 1
Topics
Metadata Files
README.md
amerifluxr 
An R programmatic interface for querying, downloading, and handling AmeriFlux data and metadata.
Installation
Stable release
To install the current stable release use a CRAN repository:
r
install.packages("amerifluxr")
library("amerifluxr")
Development release
To install the development releases of the package run the following commands:
r
if(!require(devtools)){install.packages("devtools")}
devtools::install_github("chuhousen/amerifluxr")
library("amerifluxr")
Vignettes are not rendered by default, if you want to include additional documentation please use:
r
if(!require(devtools)){install.packages("devtools")}
devtools::install_github("chuhousen/amerifluxr", build_vignettes = TRUE)
library("amerifluxr")
Use
Obtain an AmeriFlux site list
This function obtains the latest AmeriFlux site list and sites' general info through the AmeriFlux web service.
``` r site <- amfsiteinfo()
```
Download all-site metadata
Access to AmeriFlux data requires creating an AmeriFlux account first. Register an account through the link.
The following downloads a single file containing all AmeriFlux sites' metadata (i.e., BADM data product) for sites under the CC-BY-4.0 data use policy. The downloaded file is a Excel file saved to tempdir() (e.g., AMF_{SITES}_BIF_{POLICY}_{VERSION}.xlsx, SITES = AA-Net (all registered sites) or AA-Flx (all sites with flux/met data available); POLICY = CCBY4 (shared under AmeriFlux CC-BY-4.0 data use policy) or LEGACY (shared under AmeriFlux Legacy data use policy)).
For details about BADM data files, see AmeriFlux web page.
r
floc1 <- amf_download_bif(user_id = "my_user",
user_email = "my_email@mail.com",
data_policy = "CCBY4.0",
agree_policy = TRUE,
intended_use = "synthesis",
intended_use_text = "obtain AmeriFlux sites' geolocation, IGBP, and climate classification",
out_dir = tempdir(),
verbose = TRUE,
site_w_data = TRUE)
| Parameter | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| userid | AmeriFlux account username |
| useremail | AmeriFlux account user email |
| datapolicy | "CCBY4.0" or "LEGACY". AmeriFlux data are shared under two tiers of licenses as chosen by site's PI. |
| agreepolicy | Acknowledge you read and agree to the AmeriFlux Data use policy |
| intendeduse | The intended use category. It needs to be "synthesis", "model", "remotesensing","otherresearch", "education", or "other" |
| intendedusetext | Brief description of intended use.This will be recorded in the data download log and emailed to site's PI. |
| outdir | Output directory for downloaded data, default to tempdir() |
| verbose | Show feedback on download progress |
| sitewdata | Logical, download all registered sites (FALSE) or only sites with available BASE data (TRUE) |
The amfdownloadbif() returns the full file path to the downloaded file, which can be used to read the file into R.
``` r bif <- amfreadbif(file = floc1)
```
Download single-site flux/met data
The following downloads AmeriFlux flux/met data (aka BASE data product) from a single site. For details about BASE data files, see AmeriFlux BASE data page.
The downloaded file is a zipped file saved in tempdir() (e.g., AMF_{SITEID}_BASE-BADM_{VERSION}.zip), which contains a BASE data file (e.g., AMF_{SITEID}_BASE_{RESOLUTION}_{VERSION}.csv, RESOLUTION = HH (half-hourly) or HR (hourly)) and a BADM data file (e.g., AMF_{SITEID}_BIF_{VERSION}.xlsx). The BADM data file is a site subset of the all-site BADM downloaded through amfdownload_bif().
``` r floc2 <- amfdownloadbase(userid = "myuser", useremail = "myemail@mail.com", siteid = "US-CRT", dataproduct = "BASE-BADM", datapolicy = "CCBY4.0", agreepolicy = TRUE, intendeduse = "remotesensing", intendedusetext = "validate the model of GPP estimation", verbose = TRUE, out_dir = tempdir())
```
| Parameter | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| userid | AmeriFlux account username |
| useremail | AmeriFlux account user email |
| siteid | A scalar or vector of character specifying the AmeriFlux Site ID (CC-Sss) |
| dataproduct | AmeriFlux data product. Currently, only "BASE-BADM" is currently supported and used as default. |
| datapolicy | "CCBY4.0" or "LEGACY". AmeriFlux data are shared under two tiers of licenses as chosen by site's PI. |
| agreepolicy | Acknowledge you read and agree to the AmeriFlux Data use policy |
| intendeduse | The intended use category. It needs to be "synthesis", "model", "remotesensing","otherresearch", "education", or "other" |
| intendedusetext | Brief description of intended use.This will be recorded in the data download log and emailed to site's PI. |
| outdir | Output directory for downloaded data, default to tempdir() |
| verbose | Show feedback on download progress |
The amfdownloadbase() returns the full file path to the downloaded file, which can be used to read the file into R.
r
base <- amf_read_base(file = floc2,
unzip = TRUE,
parse_timestamp = TRUE)
| Parameter | Description | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | | file | file path | | unzip | logical, whether to unzip. Set TRUE if reading from a zipped file | | parse_timestamp | logical, whether to parse the timestamp |
Download multiple-site flux/met data
The following downloads AmeriFlux flux/met data from multiple sites. The downloaded files are organized by sites, with one zipped file for each site, similar to single-site download.
``` r amfdownloadbase(userid = "myuser", useremail = "myemail@mail.com", siteid = c("US-CRT", "US-WPT", "US-Oho"), dataproduct = "BASE-BADM", datapolicy = "CCBY4.0", agreepolicy = TRUE, intendeduse = "model", intendedusetext = "Data-driven modeling, for training models and cross-validation", verbose = TRUE, outdir = tempdir())
```
Additional functionalities
Site Selection Vignette demonstrates examples to query a list of target sites based on sites' general information and availability of metadata and data.
Data Import Vignette demonstrates examples to import data and metadata downloaded from AmeriFlux, and parse and clean data for further use.
Citation
Chu, 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.
Acknowledgement
We thank the AmeriFlux site teams for sharing their data and metadata with the network. Funding for these flux sites is acknowledged in the site data DOI on AmeriFlux website. This package was supported in part by funding provided to the AmeriFlux Management Project by the U.S. Department of Energy’s Office of Science under Contract No. DE-AC0205CH11231. We also thank Adam Young, Minkyu Moon, Erica Orcutt, Manuel Helbig for testing the package and providing valuable feedback.
Owner
- Name: Housen Chu
- Login: chuhousen
- Kind: user
- Website: https://sites.google.com/site/chuhousen/home
- Twitter: chuhousen
- Repositories: 2
- Profile: https://github.com/chuhousen
environmental scientist, studying plant-ecosystem-atmosphere interactions in natural and managed ecosystems
GitHub Events
Total
- Issues event: 1
- Watch event: 2
- Push event: 6
- Pull request event: 7
Last Year
- Issues event: 1
- Watch event: 2
- Push event: 6
- Pull request event: 7
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| chuhousen | c****n@g****m | 137 |
| khufkens | k****s@g****m | 26 |
| Eric Scott | e****t@a****u | 3 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 9
- Total pull requests: 100
- Average time to close issues: 2 months
- Average time to close pull requests: 2 days
- Total issue authors: 5
- Total pull request authors: 3
- Average comments per issue: 2.44
- Average comments per pull request: 0.15
- Merged pull requests: 95
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 9
- Average time to close issues: N/A
- Average time to close pull requests: 2 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- khufkens (5)
- istfer (1)
- chuhousen (1)
- changliao1025 (1)
Pull Request Authors
- chuhousen (96)
- khufkens (7)
- Aariq (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 221 last-month
- Total docker downloads: 62,285
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 14
(may contain duplicates) - Total versions: 2
- Total maintainers: 1
proxy.golang.org: github.com/chuhousen/amerifluxr
- Documentation: https://pkg.go.dev/github.com/chuhousen/amerifluxr#section-documentation
- License: other
-
Latest release: v1.0.0
published about 4 years ago
Rankings
cran.r-project.org: amerifluxr
Interface to 'AmeriFlux' Data Services
- Homepage: https://github.com/chuhousen/amerifluxr
- Documentation: http://cran.r-project.org/web/packages/amerifluxr/amerifluxr.pdf
- License: BSD_3_clause + file LICENSE
-
Latest release: 1.0.0
published about 4 years ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.6 depends
- RCurl * imports
- heatmaply * imports
- httr * imports
- jsonlite * imports
- memoise * imports
- readxl * imports
- tools * imports
- covr * suggests
- data.table * suggests
- knitr * suggests
- mockr * suggests
- pander * suggests
- qpdf * suggests
- remotes * suggests
- rmarkdown * suggests
- testthat * suggests
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite