Skip to content

Commit c275e3c

Browse files
packages in vignette
1 parent f380521 commit c275e3c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

vignettes/matrix_multiplication.Rmd

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ Matrix operations are central to `macpan2` models. The engine supports four ways
3030
- Elementwise multiplication with recycling (`*`)
3131
- Left sparse matrix multiplication (`sparse_mat_mult()`)
3232

33-
This vignette introduces each operation and illustrates typical use cases.
33+
This vignette introduces each operation and illustrates typical use cases. It depends on the following packages.
34+
35+
```{r pkg}
36+
library(macpan2)
37+
library(dplyr)
38+
library(ggplot2)
39+
library(splines)
40+
```
3441

3542
## Standard Matrix Multiplication (`%*%`)
3643

@@ -242,7 +249,7 @@ n_steps <- 100
242249
time_points <- seq(0, 1, length.out = n_steps)
243250
244251
# Create a cubic B-spline basis with 8 degrees of freedom
245-
B_dense <- bs(time_points, df = 8, degree = 3, intercept = TRUE)
252+
B_dense <- splines::bs(time_points, df = 8, degree = 3, intercept = TRUE)
246253
247254
# Convert basis to sparse form with small tolerance
248255
B_sparse <- sparse_matrix_notation(B_dense

0 commit comments

Comments
 (0)