remove_matrix {matrixset}R Documentation

Remove one or more matrices of the matrixset object

Description

This is a special case of the [ method, with the benefit of being explicit about what action is taken.

Usage

remove_matrix(.ms, matrix)

Arguments

.ms

A matrixset object. Leave empty only if remove_matrix() is used inside mutate_matrix().

matrix

index specifying matrix or matrices to remove. Index is posivie numeric or character vectors. Tidy select is also supported .Leave empty only if remove_matrix() is used inside mutate_matrix().

Value

A matrixset with updated matrices.

Usage inside mutate_matrix()

In most cases, both arguments of the function are mandatory. However, if you want to declare that a matrix should be removed via the mutate_matrix() function, the remove_matrix() must be called without arguments. There is an example that illustrates that.

Examples

ms1 <- remove_matrix(student_results, "remedial")
ms2 <- remove_matrix(student_results, 2)
ms3 <- mutate_matrix(student_results, remedial = remove_matrix())


[Package matrixset version 0.3.0 Index]