Skip to content

Commit 8eb5f99

Browse files
committed
use only subset of pkgs for meta analysis
Signed-off-by: Aritra Dey <adey01027@gmail.com>
1 parent 542e49f commit 8eb5f99

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

documentation/tutorials/Demo_03_Meta_Analysis/meta_analysis.qmd

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,18 @@ In this specific demo, we are performing a meta-analysis for the **temperate con
3939

4040
Before running this notebook, make sure you have:
4141

42-
* **PEcAn packages installed**: You can install all PEcAn packages and their dependencies by running the following command in the root of your PEcAn repository:
43-
44-
```r
45-
# Enable repository from pecanproject
46-
options(repos = c(
47-
pecanproject = 'https://pecanproject.r-universe.dev',
48-
CRAN = 'https://cloud.r-project.org'))
49-
# Download and install PEcAn.all in R
50-
install.packages('PEcAn.all')
51-
```
52-
42+
* **PEcAn packages installed**:
43+
* **For this demo**: You only need a subset of PEcAn packages to run the meta-analysis.
44+
```r
45+
# Enable repository from pecanproject
46+
options(repos = c(
47+
pecanproject = 'https://pecanproject.r-universe.dev',
48+
CRAN = 'https://cloud.r-project.org'))
49+
50+
# Install core packages for meta-analysis
51+
install.packages(c('PEcAn.MA', 'PEcAn.settings', 'PEcAn.utils', 'PEcAn.logger'))
52+
```
53+
5354
* **A valid `pecan.xml` configuration file**: Start with the example at `pecan/documentation/tutorials/Demo_03_Meta_Analysis/pecan.xml`.
5455
* **SIPNET binary**: While not strictly used for the meta-analysis calculation itself, it is part of the broader workflow context.
5556
* **Pre-generated Data**: This demo relies on `trait.data.Rdata` and `prior.distns.Rdata` files which are included in the `pft/temperate.coniferous` directory.
@@ -79,8 +80,12 @@ source(
7980
First, we need to load the PEcAn R packages. These packages provide all the functions we'll use to run the workflow.
8081

8182
```{r libraries}
82-
# Load the PEcAn.all package, which includes all necessary PEcAn functionality
83-
library("PEcAn.all")
83+
# Load necessary PEcAn packages
84+
# library("PEcAn.all") # Alternatively, load all packages if installed
85+
library("PEcAn.settings")
86+
library("PEcAn.MA")
87+
library("PEcAn.utils")
88+
library("PEcAn.logger")
8489
```
8590

8691
# Load PEcAn Settings File
@@ -256,7 +261,11 @@ If you encounter a problem with PEcAn that’s not covered in the documentation,
256261
### PEcAn package versions.
257262

258263
```{r version-info}
259-
PEcAn.all::pecan_version()
264+
if (requireNamespace("PEcAn.all", quietly = TRUE)) {
265+
PEcAn.all::pecan_version()
266+
} else {
267+
print("PEcAn.all not installed. See sessionInfo() below for package versions.")
268+
}
260269
```
261270

262271
### R session information:

0 commit comments

Comments
 (0)