is_something_in_this_matrix: Is something in a matrix? Let's check!

View source: R/NMFSReports.R

is_something_in_this_matrixR Documentation

Is something in a matrix? Let's check!

Description

This function searches to see if item 'search_for' is within the matrix 'x' and returns a respective TRUE (T) and FALSE (F). This can be useful for adding footnotes, adding conditional text to your document, and much more!

Usage

is_something_in_this_matrix(x, search_for)

Arguments

x

The matrix that needs to be searched.

search_for

Items to be searched for in matrix x.

Value

TRUE or FALSE

Examples

x = data.frame(matrix(1:9, nrow = 3, ncol = 3))
x
is_something_in_this_matrix(x,
                       search_for = 9)
x = data.frame(matrix(LETTERS[1:9], nrow = 3, ncol = 3))
is_something_in_this_matrix(x,
                       search_for = "J")

EmilyMarkowitz-NOAA/NMFSReports documentation built on March 26, 2023, 1:08 a.m.