+
+
+ Generate a matrix with active areas.
+
+
+
+
+ Usage
+highlight_data(x, rows = NULL, columns = NULL, locations = NULL)
+
+highlight_rows(x, rows = NULL)
+
+highlight_columns(x, columns = NULL)
+
+highlight_locations(x, locations = NULL)
+
+ Arguments
+- x +
A matrix.
+
+
+- rows +
An interger vector with valid row index locations.
+
+
+- columns +
An integer vector containing valid column indexlocations.
+
+
+- locations +
An m by 2 matrix with points listed in x, y format.
+
+
+
+
+ Value
+ + +A logical matrix with the required rows and/or columns or points set to
+TRUE
. All other values are given as FALSE
.
+
+
+ Examples
+# Example data
+x = matrix(1:12, nrow = 4)
+
+# Highlight points using an x, y pairing
+locations = rbind(
+ c(1, 3),
+ c(2, 2),
+ c(4, 1)
+)
+highlight_locations(x, locations)
+#> [,1] [,2] [,3]
+#> [1,] FALSE FALSE TRUE
+#> [2,] FALSE TRUE FALSE
+#> [3,] FALSE FALSE FALSE
+#> [4,] TRUE FALSE FALSE
+
+# Highlight entries only in the 1st and 3rd rows.
+highlight_rows(x, rows = c(1, 3))
+#> [,1] [,2] [,3]
+#> [1,] TRUE TRUE TRUE
+#> [2,] FALSE FALSE FALSE
+#> [3,] TRUE TRUE TRUE
+#> [4,] FALSE FALSE FALSE
+
+# Highlight entries only in the first two rows:
+highlight_rows(x, rows = 1:2)
+#> [,1] [,2] [,3]
+#> [1,] TRUE TRUE TRUE
+#> [2,] TRUE TRUE TRUE
+#> [3,] FALSE FALSE FALSE
+#> [4,] FALSE FALSE FALSE
+
+# Highlight entries in the last column
+highlight_columns(x, columns = ncol(x))
+#> [,1] [,2] [,3]
+#> [1,] FALSE FALSE TRUE
+#> [2,] FALSE FALSE TRUE
+#> [3,] FALSE FALSE TRUE
+#> [4,] FALSE FALSE TRUE
+
+# Highlight entries in the first column
+highlight_columns(x, columns = 1)
+#> [,1] [,2] [,3]
+#> [1,] TRUE FALSE FALSE
+#> [2,] TRUE FALSE FALSE
+#> [3,] TRUE FALSE FALSE
+#> [4,] TRUE FALSE FALSE
+
+# Highlight entries in the first column or first row.
+highlight_data(x, rows = 1, columns = 1)
+#> [,1] [,2] [,3]
+#> [1,] TRUE TRUE TRUE
+#> [2,] TRUE FALSE FALSE
+#> [3,] TRUE FALSE FALSE
+#> [4,] TRUE FALSE FALSE
+