Skip to content

Commit 0b25baf

Browse files
committed
rewrite readme with current table structure
1 parent 3210c15 commit 0b25baf

1 file changed

Lines changed: 46 additions & 45 deletions

File tree

README.md

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,31 @@
1111

1212
| | |
1313
|---------------------------|------------------------------------------------------------------------|
14-
| **Primary Dataset** | `traitsview` - 43,532 trait and yield observations |
14+
| **Primary Table** | `traitsview` - 43,532 trait and yield observations |
1515
| **Support Tables** | 15 reference tables (species, sites, variables, citations, pfts, etc.) |
1616
| **Species Coverage** | ~9,000 plant species with emphasis on bioenergy crops |
1717
| **Geographic Scope** | Global, with concentration in North America and Europe |
18-
| **Temporal Range** | 1900 present |
18+
| **Temporal Range** | 1900 -- present |
1919
| **Top Genera** | *Miscanthus*, *Panicum*, *Populus*, *Salix*, *Saccharum* |
20-
| **Data License** | [ODC-By-1.0](https://opendatacommons.org/licenses/by/1-0/) |
2120
| **Frictionless Metadata** | [`inst/metadata/datapackage.json`](inst/metadata/datapackage.json) |
2221

2322
---
2423

25-
## Datasets
24+
## Tables
2625

27-
This package provides 16 datasets exported from BETYdb:
26+
This package provides a dataset with 16 tables exported from BETYdb.
2827

29-
### Primary Dataset
28+
### Primary Table
3029

31-
| Dataset | Rows | Columns | Description |
30+
| Table | Rows | Columns | Description |
3231
|---------------|--------|---------|----------------------------------------------|
33-
| `traitsview` | 43,532 | 36 | Denormalized view of plant traits and yields |
34-
| Dataset | Description |
32+
| `traitsview` | 43,532 | 35 | Denormalized view of plant traits and yields |
33+
34+
### Metadata Tables
35+
36+
These tables provide reference data for species, sites, variables, and other entities linked to the trait observations.
37+
38+
| Table | Description |
3539
|---------------|---------------------------------------------------------------|
3640
| `species` | Plant taxonomy (genus, species, common names) |
3741
| `sites` | Research site locations with coordinates and climate data |
@@ -47,7 +51,9 @@ This package provides 16 datasets exported from BETYdb:
4751

4852
### Relationship Tables
4953

50-
| Dataset | Description |
54+
These junction tables connect entities in many-to-many relationships. Use `pfts_species` to find which species belong to a Plant Functional Type, or `managements_treatments` to link management practices to experimental treatments.
55+
56+
| Table | Description |
5157
|----------------------------|--------------------------------|
5258
| `pfts_species` | PFT <-> species mapping |
5359
| `pfts_priors` | PFT <-> prior mapping |
@@ -73,20 +79,20 @@ R CMD INSTALL betydata
7379
## Quick Start
7480
```r
7581
library(betydata)
82+
library(dplyr)
7683

77-
# Load the primary dataset
78-
data(traitsview)
79-
80-
# Explore structure
81-
str(traitsview)
82-
head(traitsview)
84+
# Preview the primary table (columns are ordered for readability)
85+
traitsview
8386

8487
# Count observations by trait
85-
library(dplyr)
86-
traitsview |> count(trait, sort = TRUE)
87-
88-
# Count by genus (top bioenergy crops)
89-
traitsview |> count(genus, sort = TRUE) |> head(10)
88+
traitsview |>
89+
count(trait, sort = TRUE)
90+
91+
# Bioenergy crop yields
92+
bioenergy_genera <- c("Miscanthus", "Panicum", "Populus", "Salix", "Saccharum")
93+
traitsview |>
94+
filter(genus %in% bioenergy_genera) |>
95+
count(genus, sort = TRUE)
9096
```
9197

9298
---
@@ -103,35 +109,30 @@ All trait and yield data include a quality control flag:
103109
| `0` | Unchecked | Not yet reviewed |
104110
| `-1` | Flagged | Identified as incorrect (excluded from this package) |
105111

106-
**Note:** This package exports only `checked >= 0` data. Flagged records (`checked = -1`) are excluded during data preparation. For research requiring unchecked data, access the BETYdb PostgreSQL database directly.
107-
108-
### Access Levels
109-
110-
All data in this package is publicly available (`access_level = 4`). Restricted data (`access_level` 1–3) requires database access with appropriate permissions.
112+
This package exports only `checked >= 0` data. Flagged records (`checked = -1`) are excluded during data preparation. All data in this package is public (from BETYdb records with `access_level = 4`). For restricted or flagged data, access the BETYdb PostgreSQL database directly.
111113

112114
---
113115

114116
## Key Traits and Yields
115117

116-
The `traitsview` dataset contains measurements of ecophysiological traits and crop yields:
118+
The `traitsview` table contains measurements of ecophysiological traits and crop yields:
117119

118120
### Common Traits
119121

120-
* **SLA** - Specific Leaf Area (m2/kg)
121-
* **Vcmax** - Maximum carboxylation rate (umol/m2/s)
122-
* **leafN** - Leaf nitrogen content (%)
123-
* **height** - Plant height (m)
124-
* **LAI** - Leaf Area Index (m2/m2)
122+
* **SLA** -- Specific Leaf Area (m2/kg)
123+
* **Vcmax** -- Maximum carboxylation rate (umol/m2/s)
124+
* **leafN** -- Leaf nitrogen content (%)
125+
* **height** -- Plant height (m)
126+
* **LAI** -- Leaf Area Index (m2/m2)
125127

126128
### Yield Variables
127129

128-
* **Ayield** - Above-ground yield (Mg/ha)
129-
* **AGBiomass** - Above-ground biomass (Mg/ha)
130+
* **Ayield** -- Above-ground yield (Mg/ha)
131+
* **AGBiomass** -- Above-ground biomass (Mg/ha)
130132

131133
Use the `variables` table for complete definitions and units:
132134
```r
133-
data(variables)
134-
variables |>
135+
variables |>
135136
filter(name %in% c("SLA", "Vcmax", "Ayield")) |>
136137
select(name, description, units)
137138
```
@@ -142,9 +143,9 @@ variables |>
142143

143144
### .rda (Default)
144145

145-
Lazy-loaded R data objects, optimized for R workflows:
146+
Lazy-loaded R data objects, available after `library(betydata)`:
146147
```r
147-
data(traitsview)
148+
traitsview
148149
```
149150

150151
### Parquet (Alternative)
@@ -176,12 +177,12 @@ Machine-readable metadata following the Frictionless data standard:
176177

177178
Detailed tutorials are available as package vignettes:
178179

179-
| Vignette | Description |
180-
|----------------|----------------------------------------------------------|
181-
| `orientation` | Overview of package structure and data relationships |
182-
| `sql-analogs` | Migrate BETYdb SQL queries to R with dplyr |
183-
| `pfts-priors` | Working with PFTs and prior distributions |
184-
| `manuscript` | Reproduce analyses from LeBauer et al. (2018) |
180+
| Vignette | Description |
181+
|---------------------|----------------------------------------------------------|
182+
| `getting_started` | Overview of package structure and data relationships |
183+
| `common_analyses` | Common analysis patterns with dplyr |
184+
| `pfts-priors` | Working with PFTs and prior distributions |
185+
| `manuscript` | Reproduce analyses from LeBauer et al. (2018) |
185186
```r
186187
browseVignettes("betydata")
187-
```
188+
```

0 commit comments

Comments
 (0)