1
0
mirror of https://github.com/msberends/AMR.git synced 2026-06-29 18:16:20 +02:00

improve top_n_microorganisms(): add property_for_each, fix property=NULL, enforce rank order (#297)

This commit is contained in:
Matthijs Berends
2026-06-26 21:40:11 +02:00
committed by GitHub
parent 02bd9a71c1
commit f7d353361c
15 changed files with 143 additions and 95 deletions

View File

@@ -85,6 +85,27 @@ _pkgdown.yml # pkgdown website configuration
- `translate.R` — 28-language translation system
- `ggplot_sir.R` / `ggplot_pca.R` / `plotting.R` — visualisation functions
## Code Style
Follow the [tidyverse style guide](https://style.tidyverse.org/) precisely. Key rules:
- 2-space indentation; no tabs
- `<-` for assignment, not `=`
- Spaces around all binary operators and after commas; no spaces inside parentheses
- When a function call must break across lines, place the first argument on a new line indented by 2 spaces, and put the closing `)` on its own line — **never align arguments to the opening parenthesis** (no hanging/forced mid-line indentation)
```r
# good
stop_(
"some long message part one ",
"part two"
)
# bad — forces indentation to match the opening parenthesis
stop_("some long message part one ",
"part two")
```
## Custom S3 Classes
The package defines five S3 classes with full print/format/plot/vctrs support: