lower.tri(x, diag = FALSE)
The lower.tri()
function takes the following parameter values:
x
: This is the matrix object. It is a required parameter.diag
: This takes a logical value indicating whether the diagonal should be included or not. This is an optional parameter.# creating a matrix Objectmymatrix <- matrix ( rep(12, 3*5),nrow = 5)mymatrix# implementing the lower.tri() functionlower.tri(mymatrix)# including a diagonallower.tri(mymatrix, diag="TRUE")
mymatrix
, using the matrix()
function.mymatrix
.lower.tri()
function and passed mymatrix
as its argument. We print the result to the console.lower.tri()
function and pass the mymatrix
as its argument. We also include the diagonal by setting the diag
as TRUE
. We print the result to the console.