Skip to content

Commit b24c845

Browse files
committed
upload site
0 parents  commit b24c845

65 files changed

Lines changed: 35999 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# R session files
2+
.Rproj.user
3+
.Rhistory
4+
.RData
5+
.Ruserdata
6+
7+
# Quarto build output (committed for GitHub Pages deployment)
8+
# docs/
9+
10+
# OS
11+
.DS_Store
12+
Thumbs.db
13+
14+
# Temporary / cache files
15+
*_cache/
16+
*_files/
17+
__pycache__/
18+
19+
/.quarto/

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Flax Growth Modelling — *Linum usitatissimum* L.
2+
3+
> **Logistic model reveals early sowing as key to maximizing flax vegetative growth under subtropical conditions**
4+
> *Submitted to Agronomy Journal (2025)*
5+
6+
## 📖 Overview
7+
8+
This repository contains all data, R code, and a Quarto-based website that fully reproduce the analyses presented in the manuscript.
9+
10+
Three vegetative growth traits — **leaf area**, **plant height**, and **leaf number** — were modelled as a function of accumulated growing degree-days (GDD) using three-parameter logistic functions, evaluated across two sowing seasons and two flax cultivars.
11+
12+
## 🌐 Website
13+
14+
The fully rendered analysis is available at:
15+
👉 **https://nepem-ufsc.github.io/paper_flax_growth**
16+
17+
## 📂 Repository structure
18+
19+
```
20+
paper_flax_growth/
21+
├── _quarto.yml # Quarto website configuration
22+
├── index.qmd # Landing page
23+
├── about.qmd # Research group & citation
24+
├── styles/
25+
│ └── custom.scss # Custom theme
26+
├── analysis/
27+
│ ├── 01_climate.qmd # Climate data import & GDD computation
28+
│ ├── 02_leaf_area.qmd # Leaf area logistic model
29+
│ ├── 03_plant_height.qmd # Plant height logistic model
30+
│ ├── 04_leaf_number.qmd # Leaf number logistic model
31+
│ └── 05_correlations.qmd # Pearson correlation matrix
32+
├── figs/ # Generated figures (auto-created on render)
33+
├── clima.csv # Hourly weather station data
34+
├── df_model_cresc.xlsx # Field measurements (raw plant data)
35+
└── df_model_cresc_medias.xlsx # Plot means
36+
```
37+
38+
## 🔁 Reproducing the analysis
39+
40+
### Prerequisites
41+
42+
- [R](https://www.r-project.org/) ≥ 4.3
43+
- [Quarto](https://quarto.org/) ≥ 1.4
44+
- R packages (install once):
45+
46+
```r
47+
install.packages(c(
48+
"rio", "tidyverse", "metan", "lubridate", "broom",
49+
"emmeans", "AgroR", "patchwork", "ggridges", "hydroGOF"
50+
))
51+
```
52+
53+
### Render the website locally
54+
55+
```bash
56+
quarto preview
57+
```
58+
59+
### Build for GitHub Pages
60+
61+
```bash
62+
quarto render
63+
```
64+
65+
Then push the `docs/` folder to GitHub and enable Pages from that directory.
66+
67+
## 📄 Citation
68+
69+
> **Authors.** (2025). Logistic model reveals early sowing as key to maximizing flax (*Linum usitatissimum* L.) vegetative growth under subtropical conditions. *Agronomy Journal*. doi: pending
70+
71+
## 📜 License
72+
73+
Code: [MIT](LICENSE) · Data: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

_quarto.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
project:
2+
type: website
3+
output-dir: docs
4+
5+
website:
6+
title: "Flax Growth Modelling"
7+
description: "Logistic model reveals early sowing as key to maximizing flax (Linum usitatissimum L.) vegetative growth under subtropical conditions"
8+
favicon: images/favicon.png
9+
site-url: https://nepem-ufsc.github.io/paper_flax_growth
10+
repo-url: https://github.com/nepem-ufsc/paper_flax_growth
11+
repo-actions: [issue]
12+
page-footer:
13+
left: |
14+
© 2025 NEPEM – Núcleo de Estudos em Pesquisa e Experimentação e Melhoramento Vegetal | UFSC
15+
right: |
16+
Built with [Quarto](https://quarto.org)  |  [Source](https://github.com/nepem-ufsc/paper_flax_growth)
17+
18+
navbar:
19+
logo: figs/logo_nepem.png
20+
logo-alt: "NEPEM logo"
21+
title: false
22+
background: "#1a1a2e"
23+
foreground: "#e8e8f0"
24+
pinned: true
25+
left:
26+
- text: "Home"
27+
href: index.qmd
28+
icon: house-fill
29+
- text: "Analysis"
30+
menu:
31+
- text: "1 · Climate Data"
32+
href: analysis/01_climate.qmd
33+
- text: "2 · Leaf Area"
34+
href: analysis/02_leaf_area.qmd
35+
- text: "3 · Plant Height"
36+
href: analysis/03_plant_height.qmd
37+
- text: "4 · Leaf Number"
38+
href: analysis/04_leaf_number.qmd
39+
- text: "5 · Correlations"
40+
href: analysis/05_correlations.qmd
41+
- text: "6 · Supplementary Tables"
42+
href: analysis/06_supplementary.qmd
43+
- text: "About"
44+
href: about.qmd
45+
right:
46+
- icon: github
47+
href: https://github.com/nepem-ufsc/paper_flax_growth
48+
aria-label: GitHub
49+
50+
sidebar: false
51+
52+
format:
53+
html:
54+
theme:
55+
light: [cosmo, styles/custom.scss]
56+
dark: [darkly, styles/custom.scss]
57+
toc: true
58+
toc-depth: 3
59+
toc-title: "On this page"
60+
code-fold: true
61+
code-summary: "Show code"
62+
code-tools: true
63+
code-copy: true
64+
code-overflow: wrap
65+
number-sections: false
66+
highlight-style: github
67+
fig-align: center
68+
fig-cap-location: bottom
69+
df-print: paged
70+
smooth-scroll: true
71+
72+
execute:
73+
echo: true
74+
warning: false
75+
message: false
76+
cache: true
77+
78+
knitr:
79+
opts_chunk:
80+
comment: "##"
81+
collapse: true

about.qmd

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "About"
3+
description: "Research group, authors, and funding information."
4+
toc: false
5+
---
6+
7+
## Research group
8+
9+
This work was developed at the **NEPEM – Núcleo de Estudos em Pesquisa e
10+
Experimentação com Milho** (Study Group on Research and Experimentation), within
11+
the Department of Plant Science (*Departamento de Fitotecnia*) of the
12+
**Federal University of Santa Catarina (UFSC)**, Florianópolis, Brazil.
13+
14+
## Study location
15+
16+
Experiments were conducted at the **Centro de Ciências Agrárias (CCA/UFSC)**,
17+
Florianópolis, Santa Catarina, Brazil (27°35'S, 48°31'W; 2 m a.s.l.).
18+
The subtropical climate of the region is classified as Cfa (Köppen) —
19+
humid subtropical with hot summers and mild winters — making it an important
20+
testbed for cool-season crops such as flax.
21+
22+
## Citation
23+
24+
> **Authors.** (2025). Logistic model reveals early sowing as key to maximizing
25+
> flax (*Linum usitatissimum* L.) vegetative growth under subtropical conditions.
26+
> *Agronomy Journal*. doi: [pending]()
27+
28+
## Reproducibility
29+
30+
All analyses were performed in **R** (R Core Team, 2024) using a fully
31+
reproducible Quarto workflow. Source code and data are publicly available at:
32+
33+
🔗 [github.com/nepem-ufsc/paper_flax_growth](https://github.com/nepem-ufsc/paper_flax_growth)
34+
35+
Key R packages used:
36+
37+
| Package | Purpose | Reference |
38+
|---------|---------|-----------|
39+
| `metan` | Multi-environment trial analysis, `doo()`, `corr_plot()` | Olivoto & Lúcio (2020) |
40+
| `AgroR` | Agricultural ANOVA, `FAT2DBC()` | Olivoto et al. (2022) |
41+
| `broom` | Tidy NLS output | Robinson et al. (2023) |
42+
| `hydroGOF` | Goodness-of-fit metrics (R², RMSE) | Zambrano-Bigiarini (2023) |
43+
| `ggplot2` | Data visualisation | Wickham (2016) |
44+
| `patchwork` | Multi-panel figures | Pedersen (2024) |
45+
| `ggridges` | Ridge density plots | Wilke (2024) |
46+
47+
## Contact
48+
49+
For questions or collaborations, please open an
50+
[Issue](https://github.com/nepem-ufsc/paper_flax_growth/issues) on GitHub.

analysis/01_climate.qmd

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
---
2+
title: "Climate Data Processing"
3+
description: "Import and summarise hourly climate records; compute daily temperatures and growing degree-days (GDD) per sowing season."
4+
---
5+
6+
```{r setup, include=FALSE}
7+
knitr::opts_chunk$set(
8+
cache = FALSE,
9+
comment = "##",
10+
collapse = TRUE,
11+
warning = FALSE,
12+
message = FALSE
13+
)
14+
```
15+
16+
## Overview
17+
18+
This section imports hourly weather station data, aggregates it to daily summaries,
19+
and derives the **accumulated growing degree-days (GDD)** used as the thermal-time
20+
variable for all subsequent growth models.
21+
22+
::: {.callout-note}
23+
GDD is calculated as the mean daily temperature minus a base temperature of 5 °C,
24+
which is commonly adopted for flax (*Linum usitatissimum* L.).
25+
:::
26+
27+
## Required packages
28+
29+
```{r libraries}
30+
library(rio) # Flexible data import (import())
31+
library(tidyverse) # Data manipulation and visualisation (dplyr, ggplot2, …)
32+
library(lubridate) # Date parsing helpers (dmy(), ymd())
33+
library(ggridges) # Ridge/density plots (geom_density_ridges_gradient())
34+
```
35+
36+
## Import and structure climate data
37+
38+
```{r import-climate}
39+
# Import the raw CSV file.
40+
# 'dec = ","' handles the Brazilian decimal comma format.
41+
dft <-
42+
import("../clima.csv", dec = ",") |>
43+
# The 'hora' column stores date as "DD/MM/YYYY HH:MM" → split into parts
44+
separate(hora, into = c("dia", "mes", "ano")) |>
45+
# Rebuild a single date string and parse it with lubridate
46+
unite("data", dia, mes, ano, sep = "/") |>
47+
mutate(data = dmy(data))
48+
```
49+
50+
## Daily temperature summary
51+
52+
```{r daily-summary}
53+
# Aggregate hourly records to daily statistics.
54+
# Variables:
55+
# tmin / tmed / tmax : minimum, mean, maximum temperature (°C)
56+
# prec : daily rainfall (mm)
57+
# ur : mean relative humidity (%)
58+
# gd : growing degree-days via mean temperature (Tmean – 5)
59+
# gd2 : growing degree-days via Tmax+Tmin average ((Tmax+Tmin)/2 – 5)
60+
dftemp <-
61+
dft |>
62+
group_by(data) |>
63+
summarise(
64+
tmin = min(tmin),
65+
tmed = mean(tmed),
66+
tmax = max(tmax),
67+
prec = sum(prec),
68+
ur = mean(ur)
69+
) |>
70+
mutate(
71+
gd = tmed - 5, # GDD method 1: mean temperature
72+
gd2 = ((tmax + tmin) / 2) - 5 # GDD method 2: (Tmax + Tmin) / 2
73+
) |>
74+
mutate(data = ymd(data))
75+
```
76+
77+
## Split data by sowing season
78+
79+
```{r sowing-seasons}
80+
# Season E1: rows 1–79 (first sowing date)
81+
dftempe1 <-
82+
dftemp |>
83+
slice(1:79) |>
84+
mutate(season = "E1")
85+
86+
# Season E2: rows 79–148 (second sowing date, one row overlap ensures continuity)
87+
dftempe2 <-
88+
dftemp |>
89+
slice(79:148) |>
90+
mutate(season = "E2")
91+
92+
# Combine seasons and compute cumulative GDD within each season
93+
dftemp2 <-
94+
bind_rows(dftempe1, dftempe2) |>
95+
relocate(season, .before = data) |>
96+
group_by(season) |>
97+
mutate(
98+
gda = cumsum(gd), # Cumulative GDD – method 1
99+
gda2 = cumsum(gd2) # Cumulative GDD – method 2
100+
) |>
101+
# Reformat the date for display (DD/MM)
102+
separate(data, into = c("ano", "mes", "dia")) |>
103+
unite("data", dia, mes, sep = "/")
104+
105+
dftemp2 |> group_by(season) |> summarise(sum(prec))
106+
```
107+
108+
## Ridge plot – temperature distribution by month
109+
110+
```{r ridge-plot, fig.cap="Distribution of maximum daily temperatures by month. Higher temperatures in summer months (Dec–Feb) contrast with cooler autumn/winter records."}
111+
dft |>
112+
# Extract month from the date column for grouping on the y-axis
113+
separate(data, into = c("ano", "mes", "dia")) |>
114+
ggplot(aes(x = tmax, y = mes, fill = after_stat(x))) +
115+
geom_density_ridges_gradient() +
116+
scale_fill_viridis_c() +
117+
labs(
118+
x = "Maximum temperature (°C)",
119+
y = "Month of the year",
120+
fill = "Max. temperature\n(°C)"
121+
) +
122+
theme_bw(base_size = 14)
123+
```
124+
125+
## Temperature and rainfall overview
126+
127+
```{r temp-rain-plot, fig.cap="Daily maximum (red) and minimum (blue) temperatures with LOESS smoothing, and daily rainfall (sky-blue bars) across the study period.", out.width="100%"}
128+
ggplot() +
129+
# Rainfall bars (scaled to secondary axis: raw mm × 30/100)
130+
geom_bar(
131+
dftemp,
132+
mapping = aes(x = data, y = prec * 30 / 100),
133+
stat = "identity",
134+
fill = "skyblue"
135+
) +
136+
# Raw daily Tmax and Tmin lines (transparent)
137+
geom_line(dftemp, mapping = aes(x = data, y = tmax, colour = "red"), linewidth = 1, alpha = 0.1) +
138+
geom_line(dftemp, mapping = aes(x = data, y = tmin, colour = "blue"), linewidth = 1, alpha = 0.1) +
139+
# LOESS smoothed trends for Tmax and Tmin
140+
geom_smooth(dftemp, mapping = aes(x = data, y = tmax, colour = "red"), linewidth = 1, se = FALSE) +
141+
geom_smooth(dftemp, mapping = aes(x = data, y = tmin, colour = "blue"), linewidth = 1, se = FALSE) +
142+
# X-axis: dates every 15 days
143+
scale_x_date(
144+
date_breaks = "15 days",
145+
date_labels = "%d/%m",
146+
expand = expansion(c(0, 0))
147+
) +
148+
# Primary Y-axis: temperature; secondary Y-axis: rainfall (rescaled back to mm)
149+
scale_y_continuous(
150+
name = expression("Temperature (" ~ degree ~ "C)"),
151+
sec.axis = sec_axis(~ . * 100 / 30, name = "Rainfall (mm)")
152+
) +
153+
# Colour legend with descriptive labels
154+
scale_color_identity(
155+
breaks = c("red", "blue"),
156+
labels = c("Maximum temperature (°C)", "Minimum temperature (°C)"),
157+
guide = "legend"
158+
) +
159+
labs(
160+
x = "Day of the year",
161+
color = ""
162+
) +
163+
theme_bw(base_size = 16) +
164+
theme(
165+
panel.grid.major = element_blank(),
166+
legend.background = element_rect(fill = "transparent"),
167+
legend.position = "bottom",
168+
axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)
169+
)
170+
171+
ggsave("../figs/temperature.jpg", width = 12, height = 6)
172+
```

0 commit comments

Comments
 (0)