row_names_are_equal: Check row names

Description Usage Arguments Value Examples

Description

Check whether all matrices have row names equal to the standard.

Usage

1
row_names_are_equal(row_names, list_of_matrices_to_check)

Arguments

row_names

Character vector of row names to use as the standard.

list_of_matrices_to_check

List containing the matrices for which the row names should be checked. NULL elements in the list are ignored.

Value

TRUE if the row names of all the matrices are equal to row_names, including the order; FALSE otherwise.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ShadowCAT:::row_names_are_equal(c("a", "b", "c"), 
                                list("matrix1" = matrix(1:3, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL)),
                                     "matrix2" = matrix(2:4, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL)),
                                     "matrix3" = matrix(3:5, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL)),
                                     "matrix4" = NULL))
ShadowCAT:::row_names_are_equal(c("a", "b", "c"), 
                                list("matrix1" = matrix(1:3, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL)),
                                     "matrix2" = matrix(2:4, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL)),
                                     "matrix3" = matrix(3:4, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b"), NULL)),
                                     "matrix4" = NULL))
ShadowCAT:::row_names_are_equal(c("a", "b", "c"), 
                                list("matrix1" = matrix(1:3, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL)),
                                     "matrix2" = matrix(2:4, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "c", "b"), NULL)),
                                     "matrix3" = matrix(3:5, 
                                                        ncol = 1, 
                                                        dimnames = list(c("a", "b", "c"), NULL))))

Karel-Kroeze/ShadowCAT documentation built on May 7, 2019, 12:28 p.m.