0

I am not able to use is.square.matrix() function for my matrix in R.

library(tidyverse)
install.packages(c("readr", "dplyr", "haven"))
install.packages(c("psych"))
install.packages("matlib")

matr <- cov(na.omit(airquality))
is.square.matrix(matr)            

I am getting error for this function could not find is.square.matrix. Can someone help mw in figuring out what I am missing here?

  • Another method for finding it, in addition to akrun's mention of `??`: googling [`cran is.square.matrix`](https://www.google.com/search?q=cran+is.square.matrix) in this case returns `matrixcalc` among the top few results. – r2evans Sep 12 '21 at 00:27
  • 1
    To clarify my previous comment: googling for `R` is wildly unhelpful, so searching for R-related stuff is challenged. However, if what you are looking for is a CRAN-based package, then including "CRAN" (with or without "R") will likely reduce the search-domain significantly. If you really want to reduce it further, google `site:cran.r-project.org is.square.matrix` and it'll narrow it down much more. It doesn't always give you just one package, but it's a really good way to narrow down the otherwise-elusive "R" search. – r2evans Sep 12 '21 at 02:23

1 Answers1

0

is.square.matrix seems to be from matrixcalc package

# // if not installed, then install the package and load it
#install.packages('matrixcalc')

library(matrixcalc)
is.square.matrix(matr)
[1] TRUE

If we don't know from which package it is loaded, then use ?? to do the check on R console and then it opens a webpage with the help pages of similar/exact functions

??is.square.matrix

gives

enter image description here

akrun
  • 874,273
  • 37
  • 540
  • 662