Skip to main content

Separator Control

By default, a horizontal rule (<hr>) appears before the appendix to visually separate it from the main content. Setting show-separator: false removes this divider for a more seamless transition—useful when you prefer a continuous flow or are applying custom CSS styling.

extensions:
  regurgitate:
    show-separator: false

Working with Matrices

Matrix operations are fundamental in statistics and data science:

# Create and manipulate a matrix
A <- matrix(c(4, 2, 1, 3), nrow = 2, byrow = TRUE)
B <- matrix(c(1, 0, 2, 1), nrow = 2, byrow = TRUE)

cat("Matrix A:\n")
Matrix A:
print(A)
     [,1] [,2]
[1,]    4    2
[2,]    1    3
cat("\nMatrix B:\n")

Matrix B:
print(B)
     [,1] [,2]
[1,]    1    0
[2,]    2    1
cat("\nA × B (matrix multiplication):\n")

A × B (matrix multiplication):
print(A %*% B)
     [,1] [,2]
[1,]    8    2
[2,]    7    3
cat("\nDeterminant of A:", det(A), "\n")

Determinant of A: 10 

Look carefully at where this content ends and the appendix begins—there’s no horizontal line separating them, creating a smoother visual transition.

Code Appendix

extensions:
  regurgitate:
    show-separator: false
# Create and manipulate a matrix
A <- matrix(c(4, 2, 1, 3), nrow = 2, byrow = TRUE)
B <- matrix(c(1, 0, 2, 1), nrow = 2, byrow = TRUE)

cat("Matrix A:\n")
print(A)
cat("\nMatrix B:\n")
print(B)
cat("\nA × B (matrix multiplication):\n")
print(A %*% B)
cat("\nDeterminant of A:", det(A), "\n")
Matrix A:
     [,1] [,2]
[1,]    4    2
[2,]    1    3

Matrix B:
     [,1] [,2]
[1,]    1    0
[2,]    2    1

A × B (matrix multiplication):
     [,1] [,2]
[1,]    8    2
[2,]    7    3

Determinant of A: 10