diff --git a/DESCRIPTION b/DESCRIPTION index e6ba458f..6bb1a0ad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,7 @@ Package: matlib Type: Package -Title: Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics +Title: Matrix Functions for Teaching and Learning Linear Algebra and + Multivariate Statistics Version: 0.4.1 Date: 2015-11-03 Authors@R: c(person(given = "Michael", family = "Friendly", role=c("aut", "cre"), email="friendly@yorku.ca"), @@ -8,15 +9,18 @@ Authors@R: c(person(given = "Michael", family = "Friendly", role=c("aut", "cre") person(given = "Georges", family = "Monette", role="ctb")) Author: Michael Friendly [aut, cre], John Fox [ctb], Georges Monette [ctb] Maintainer: Michael Friendly -Description: A collection of matrix functions for teaching and learning matrix linear algebra - as used in multivariate statistical methods. These functions are mainly for tutorial purposes - in learning matrix algebra ideas using R. In some cases, functions are provided for concepts available - elsewhere in R, but where the function call or name is not obvious. In other - cases, functions are provided to show or demonstrate an algorithm. +Description: A collection of matrix functions for teaching and learning matrix + linear algebra as used in multivariate statistical methods. These functions are + mainly for tutorial purposes in learning matrix algebra ideas using R. In some + cases, functions are provided for concepts available elsewhere in R, but where + the function call or name is not obvious. In other cases, functions are provided + to show or demonstrate an algorithm. License: GPL (>= 2) URL: https://github.com/friendly/matlib LazyData: TRUE -Suggests: MASS, +Suggests: + MASS, knitr, rmarkdown VignetteBuilder: knitr +RoxygenNote: 5.0.0 diff --git a/man/Ginv.Rd b/man/Ginv.Rd index aef9ac1e..d5b98a45 100644 --- a/man/Ginv.Rd +++ b/man/Ginv.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gaussian-elimination.R \name{Ginv} \alias{Ginv} @@ -36,6 +36,7 @@ B <- matrix(1:9, 3, 3) # a singular matrix B Ginv(B, fractions=TRUE) # a generalized inverse of B B \%*\% Ginv(B) \%*\% B # check + } \seealso{ \code{\link[MASS]{ginv}} for a more generally usable function diff --git a/man/Inverse.Rd b/man/Inverse.Rd index 49ebb1ba..bf2ca1aa 100644 --- a/man/Inverse.Rd +++ b/man/Inverse.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gaussian-elimination.R \name{Inverse} \alias{Inverse} @@ -26,7 +26,7 @@ The method is purely didactic: The identity matrix, \eqn{I}, is appended to \eqn to \eqn{X^{-1}} is returned. } \examples{ -A <- matrix(c(2, 1, -1, + A <- matrix(c(2, 1, -1, -3, -1, 2, -2, 1, 2), 3, 3, byrow=TRUE) Inverse(A) diff --git a/man/QR.Rd b/man/QR.Rd index 949299a9..894a9b36 100644 --- a/man/QR.Rd +++ b/man/QR.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/QR.R \name{QR} \alias{QR} diff --git a/man/R.Rd b/man/R.Rd index 5e24b24f..a3ef1aae 100644 --- a/man/R.Rd +++ b/man/R.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/matlib.R \name{R} \alias{R} diff --git a/man/SVD.Rd b/man/SVD.Rd index 801f904b..771018cc 100644 --- a/man/SVD.Rd +++ b/man/SVD.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eig.R \name{SVD} \alias{SVD} diff --git a/man/cholesky.Rd b/man/cholesky.Rd index 183de39b..89bd14f8 100644 --- a/man/cholesky.Rd +++ b/man/cholesky.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gaussian-elimination.R \name{cholesky} \alias{cholesky} @@ -23,6 +23,7 @@ C <- matrix(c(1,2,3,2,5,6,3,6,10), 3, 3) # nonsingular, symmetric C cholesky(C) cholesky(C) \%*\% t(cholesky(C)) # check + } \references{ Kennedy W.J. Jr, Gentle J.E. (1980). \emph{Statistical Computing}. Marcel Dekker. diff --git a/man/cofactor.Rd b/man/cofactor.Rd index 2b4d899f..a5d35e07 100644 --- a/man/cofactor.Rd +++ b/man/cofactor.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/determinants.R \name{cofactor} \alias{cofactor} @@ -27,6 +27,7 @@ M <- matrix(c(4, -12, -4, cofactor(M, 1, 1) cofactor(M, 1, 2) cofactor(M, 1, 3) + } \author{ Michael Friendly @@ -34,7 +35,7 @@ Michael Friendly \seealso{ \code{\link{row_cofactors}} for all cofactors of a given row -Other determinants: \code{\link{minor}}; - \code{\link{row_cofactors}}; \code{\link{row_minors}} +Other determinants: \code{\link{minor}}, + \code{\link{row_cofactors}}, \code{\link{row_minors}} } diff --git a/man/echelon.Rd b/man/echelon.Rd index 7dfa5ea9..b6cd31b6 100644 --- a/man/echelon.Rd +++ b/man/echelon.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gaussian-elimination.R \name{echelon} \alias{echelon} @@ -43,5 +43,6 @@ B echelon(B) echelon(B, b) echelon(B, diag(3)) + } diff --git a/man/eig.Rd b/man/eig.Rd index 0d5350f0..d581f91a 100644 --- a/man/eig.Rd +++ b/man/eig.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eig.R \name{eig} \alias{eig} diff --git a/man/gaussianElimination.Rd b/man/gaussianElimination.Rd index 6cd6fb66..0a17326f 100644 --- a/man/gaussianElimination.Rd +++ b/man/gaussianElimination.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gaussian-elimination.R \name{gaussianElimination} \alias{gaussianElimination} @@ -30,12 +30,14 @@ systems of linear equations of the form \eqn{A x = B}. Optional arguments \code{ and \code{fractions} may be used to see how the algorithm works. } \examples{ -A <- matrix(c(2, 1, -1, + A <- matrix(c(2, 1, -1, -3, -1, 2, -2, 1, 2), 3, 3, byrow=TRUE) b <- c(8, -11, -3) gaussianElimination(A, b) gaussianElimination(A, b, verbose=TRUE, fractions=TRUE) + + } \author{ John Fox diff --git a/man/gsorth.Rd b/man/gsorth.Rd index 77349629..f0271159 100644 --- a/man/gsorth.Rd +++ b/man/gsorth.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gsorth.R \name{gsorth} \alias{gsorth} diff --git a/man/minor.Rd b/man/minor.Rd index b5390d11..dc4c2cf4 100644 --- a/man/minor.Rd +++ b/man/minor.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/determinants.R \name{minor} \alias{minor} @@ -34,7 +34,7 @@ Michael Friendly \seealso{ \code{\link{row_minors}} for all minors of a given row -Other determinants: \code{\link{cofactor}}; - \code{\link{row_cofactors}}; \code{\link{row_minors}} +Other determinants: \code{\link{cofactor}}, + \code{\link{row_cofactors}}, \code{\link{row_minors}} } diff --git a/man/mpower.Rd b/man/mpower.Rd index b9b2030f..f2c2e46c 100644 --- a/man/mpower.Rd +++ b/man/mpower.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mpower.R \name{mpower} \alias{mpower} diff --git a/man/plotEqn.Rd b/man/plotEqn.Rd index 6d60908d..b733b142 100644 --- a/man/plotEqn.Rd +++ b/man/plotEqn.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plotEqn.R \name{plotEqn} \alias{plotEqn} diff --git a/man/proj.Rd b/man/proj.Rd index f3445867..ce5c51fc 100644 --- a/man/proj.Rd +++ b/man/proj.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/matlib.R \name{proj} \alias{proj} diff --git a/man/row_cofactors.Rd b/man/row_cofactors.Rd index 90cd7f2d..a9a268dc 100644 --- a/man/row_cofactors.Rd +++ b/man/row_cofactors.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/determinants.R \name{row_cofactors} \alias{row_cofactors} @@ -29,6 +29,7 @@ row_cofactors(M, 1) det(M) # expansion by cofactors of row 1 M[1,] \%*\% row_cofactors(M,1) + } \author{ Michael Friendly @@ -36,7 +37,7 @@ Michael Friendly \seealso{ \code{\link[base]{det}} for the determinant -Other determinants: \code{\link{cofactor}}; - \code{\link{minor}}; \code{\link{row_minors}} +Other determinants: \code{\link{cofactor}}, + \code{\link{minor}}, \code{\link{row_minors}} } diff --git a/man/row_minors.Rd b/man/row_minors.Rd index 7d99fa53..a223d7e0 100644 --- a/man/row_minors.Rd +++ b/man/row_minors.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/determinants.R \name{row_minors} \alias{row_minors} @@ -30,7 +30,7 @@ row_minors(M, 1) Michael Friendly } \seealso{ -Other determinants: \code{\link{cofactor}}; - \code{\link{minor}}; \code{\link{row_cofactors}} +Other determinants: \code{\link{cofactor}}, + \code{\link{minor}}, \code{\link{row_cofactors}} } diff --git a/man/rowadd.Rd b/man/rowadd.Rd index baf37725..d671b6f0 100644 --- a/man/rowadd.Rd +++ b/man/rowadd.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rowops.R \name{rowadd} \alias{rowadd} @@ -44,11 +44,12 @@ Ab <- cbind(A, b) # Could continue to reduce above diagonal to zero echelon(A, b, verbose=TRUE, fractions=TRUE) + } \seealso{ \code{\link{echelon}}, \code{\link{gaussianElimination}} -Other elementary row operations: \code{\link{rowmult}}; +Other elementary row operations: \code{\link{rowmult}}, \code{\link{rowswap}} } diff --git a/man/rowmult.Rd b/man/rowmult.Rd index 9b7607c1..285da906 100644 --- a/man/rowmult.Rd +++ b/man/rowmult.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rowops.R \name{rowmult} \alias{rowmult} @@ -34,11 +34,12 @@ Ab <- cbind(A, b) # multiply to make diagonals = 1 (Ab <- rowmult(Ab, 1:3, c(1/2, 2, -1))) # The matrix is now in triangular form + } \seealso{ \code{\link{echelon}}, \code{\link{gaussianElimination}} -Other elementary row operations: \code{\link{rowadd}}; +Other elementary row operations: \code{\link{rowadd}}, \code{\link{rowswap}} } diff --git a/man/rowswap.Rd b/man/rowswap.Rd index 8d104624..7aafcd3e 100644 --- a/man/rowswap.Rd +++ b/man/rowswap.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rowops.R \name{rowswap} \alias{rowswap} @@ -24,7 +24,7 @@ This elementary row operation corresponds to interchanging two equations. \seealso{ \code{\link{echelon}}, \code{\link{gaussianElimination}} -Other elementary row operations: \code{\link{rowadd}}; +Other elementary row operations: \code{\link{rowadd}}, \code{\link{rowmult}} } diff --git a/man/showEqn.Rd b/man/showEqn.Rd index 160b01a0..8ee9a147 100644 --- a/man/showEqn.Rd +++ b/man/showEqn.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/showEqn.R \name{showEqn} \alias{showEqn} @@ -23,7 +23,7 @@ Shows what matrices \eqn{A, b} look like as the system of linear equations, \eqn as a set of equations. } \examples{ -A <- matrix(c(2, 1, -1, + A <- matrix(c(2, 1, -1, -3, -1, 2, -2, 1, 2), 3, 3, byrow=TRUE) b <- c(8, -11, -3) diff --git a/man/tr.Rd b/man/tr.Rd index 45ab11a7..0064f205 100644 --- a/man/tr.Rd +++ b/man/tr.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tr.R \name{tr} \alias{tr} @@ -18,5 +18,6 @@ Calculates the trace of a numeric matrix, i.e., the sum of its diagonal elements \examples{ X <- matrix(1:9, 3, 3) tr(X) + }