is_square: Check if number, vector, or matrix is 'square'

Description Usage Arguments Value

View source: R/is_square.R

Description

is_square(x) checks if a scalar value is a perfect square. is_square_mat(x) checks if a matrix x is square (n by n). is_square_vec(x) and is_square_tri(x) work on vectors. is_square_vec(x) tests if the vector could be from/formed into a vectorized square matrix (i.e., all elements), whereas is_square_tri(x) tests if the vector could be from a triangle of a square matrix (using quadratic formula).

Usage

1
2
3
4
5
6
7

Arguments

x

vector or matrix

Value

boolean


mcfreund/mfutils documentation built on Feb. 6, 2022, 4:57 a.m.