diff --git a/pkgdown.yml b/pkgdown.yml index 1dc675c..62dd25e 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 2.19.2 pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2024-01-14T06:34Z +last_built: 2024-01-15T10:45Z urls: reference: http://r-pkg.thecoatlessprofessor.com/drawr/reference article: http://r-pkg.thecoatlessprofessor.com/drawr/articles diff --git a/reference/Rplot004.png b/reference/Rplot004.png index 8568d17..ac48675 100644 Binary files a/reference/Rplot004.png and b/reference/Rplot004.png differ diff --git a/reference/Rplot008.png b/reference/Rplot008.png index 7e5fd4e..cb652bf 100644 Binary files a/reference/Rplot008.png and b/reference/Rplot008.png differ diff --git a/reference/draw-matrix-4.png b/reference/draw-matrix-4.png index feda6cf..937821f 100644 Binary files a/reference/draw-matrix-4.png and b/reference/draw-matrix-4.png differ diff --git a/reference/draw-matrix-8.png b/reference/draw-matrix-8.png index 76dfb1e..d069269 100644 Binary files a/reference/draw-matrix-8.png and b/reference/draw-matrix-8.png differ diff --git a/reference/draw-vector-1.png b/reference/draw-vector-1.png index d47f15a..a3ca042 100644 Binary files a/reference/draw-vector-1.png and b/reference/draw-vector-1.png differ diff --git a/reference/draw-vector.html b/reference/draw-vector.html index 5fd5500..948d48a 100644 --- a/reference/draw-vector.html +++ b/reference/draw-vector.html @@ -51,9 +51,12 @@

Usage
draw_vector(
   data,
   layout = c("vertical", "horizontal"),
-  show_cell_indices = FALSE,
+  show_indices = c("none", "inside", "outside"),
   highlight_area = rep(FALSE, length(data)),
-  highlight_color = "lemonchiffon"
+  highlight_color = "lemonchiffon",
+  graph_title = paste0("Data Object: ", deparse(substitute(data))),
+  graph_subtitle = paste0("Length: ", paste(length(data), "elements"), " | ",
+    "Data Type: ", paste0(class(data), collapse = ", "))
 )
@@ -67,8 +70,9 @@

Arguments.

-
show_cell_indices
-

Display cell indices inside the matrix cell, e.g. [i]. Default: FALSE

+
show_indices
+

Display data indices either: "inside", "outside", or "none" +the vector cell, e.g. [i]. Default: "none"

highlight_area
@@ -79,6 +83,15 @@

Arguments diff --git a/search.json b/search.json index af7d7b0..728f402 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"James Joseph Balamuta. Author, maintainer.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Balamuta J (2024). drawr: Create Graphics 'R' Data Structures. R package version 0.0.1, https://r-pkg.thecoatlessprofessor.com/drawr/, https://github.com/coatless-rpkg/drawr.","code":"@Manual{, title = {drawr: Create Graphics of 'R' Data Structures}, author = {James Joseph Balamuta}, year = {2024}, note = {R package version 0.0.1, https://r-pkg.thecoatlessprofessor.com/drawr/}, url = {https://github.com/coatless-rpkg/drawr}, }"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"drawr","dir":"","previous_headings":"","what":"Create Graphics of R Data Structures","title":"Create Graphics of R Data Structures","text":"goal drawr draw different R data structures graphs.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create Graphics of R Data Structures","text":"can install development version drawr GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"coatless-rpkg/drawr\")"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"design","dir":"","previous_headings":"","what":"Design","title":"Create Graphics of R Data Structures","text":"package designed take advantage base R graphics alongside ggplot2. ’re providing two different implementations system naming scheme : draw_*(): base R graphics gdraw_*(): ggplot2","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Create Graphics of R Data Structures","text":"Take instance matrix looks like : wanted see contents layed indices? can achieve similar results ggplot2 function.","code":"mat_3x5 = matrix( c( 1, NA, 3, 4, NaN, NA, 7, 8, -9, 10, -11, 12, -Inf, -14, NA ), ncol = 5, byrow = TRUE) mat_3x5 #> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 NA 3 4 NaN #> [2,] NA 7 8 -9 10 #> [3,] -11 12 -Inf -14 NA # Load the library library(drawr) # Graphic of matrix data structure using base R graphics draw_matrix(mat_3x5) # Show the cell indices draw_matrix(mat_3x5, show_cell_indices = TRUE) # Show the row and column indices draw_matrix(mat_3x5, show_row_indices = TRUE, show_column_indices = TRUE) # Highlight cells over a specific value draw_matrix(mat_3x5, highlight_area = mat_3x5 > 4) # Graphic of matrix data structure using base R graphics gdraw_matrix(mat_3x5) # Highlight cells in specific columns gdraw_matrix(mat_3x5, highlight_area = highlight_columns(mat_3x5, columns = 2:4))"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize Data Inside of a Matrix — draw_matrix","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"Generate graph showing contents matrix.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"","code":"draw_matrix( data, show_cell_indices = FALSE, show_row_indices = FALSE, show_column_indices = FALSE, highlight_area = matrix(FALSE, nrow(data), ncol(data)), highlight_color = \"lemonchiffon\" ) gdraw_matrix( data, show_cell_indices = FALSE, show_row_indices = FALSE, show_column_indices = FALSE, highlight_area = matrix(FALSE, nrow(data), ncol(data)), highlight_color = \"lemonchiffon\" )"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"data object class matrix. show_cell_indices Display cell indices inside matrix cell, e.g. [, j]. Default: FALSE show_row_indices Display row indices next matrix row, e.g. [, ]. Default: FALSE show_column_indices Display column indices next matrix column, e.g. [, j]. Default: FALSE highlight_area Matrix logical values provide mask cells filled. Default: None. highlight_color Color use fill background cell.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"","code":"# Base graphics # Visualize a 3x3 mat_3x3 = matrix(c(10, 200, -30, 40, 500, 30, 90, -55, 10), ncol = 3) draw_matrix(mat_3x3) # Show the indices draw_matrix(mat_3x3, show_cell_indices = TRUE) # Highlight a row mat_4x4 = matrix(seq_len(16), nrow = 4) draw_matrix( mat_4x4, show_row_indices = TRUE, highlight_area = highlight_rows(mat_4x4, rows = 1)) # Highlight values above 5 mat_2x4 = matrix(round(rnorm(16, 5, 2), 2), ncol = 4) draw_matrix(mat_2x4, highlight_area = mat_2x4 > 2) # ggplot2 graphics ---- # Visualize a 3x3 mat_3x3 = matrix(c(10, 200, -30, 40, 500, 30, 90, -55, 10), ncol = 3) gdraw_matrix(mat_3x3) # View the matrix without indices present gdraw_matrix(mat_3x3, highlight_area = FALSE) # Highlight a row mat_2x2 = matrix(c(1, 2, 3, 4), nrow = 2) mat_2x2_mask = matrix(c(TRUE, TRUE, FALSE, FALSE), nrow = 2) gdraw_matrix(mat_2x2, highlight_area = mat_2x2_mask) # Highlight values above 5 mat_3x5 = matrix(round(rnorm(15, 5, 2), 2), ncol = 5) gdraw_matrix(mat_3x5, highlight_area = mat_3x5 > 2)"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize Data Inside of a Vector — draw_vector","title":"Visualize Data Inside of a Vector — draw_vector","text":"Generate graph showing contents Vector","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize Data Inside of a Vector — draw_vector","text":"","code":"draw_vector( data, layout = c(\"vertical\", \"horizontal\"), show_cell_indices = FALSE, highlight_area = rep(FALSE, length(data)), highlight_color = \"lemonchiffon\" )"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize Data Inside of a Vector — draw_vector","text":"data object class vector. layout Orientation vector. Default: \"vertical\". show_cell_indices Display cell indices inside matrix cell, e.g. []. Default: FALSE highlight_area Vector logical values provide mask cells filled. Default: None. highlight_color Color use fill background cell.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize Data Inside of a Vector — draw_vector","text":"","code":"# Base graphics # Visualize a 3x3 vec_9 <- round(rnorm(5, 0, 4), 2) draw_vector(vec_9)"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/drawr-package.html","id":null,"dir":"Reference","previous_headings":"","what":"drawr: Create Graphics of 'R' Data Structures — drawr-package","title":"drawr: Create Graphics of 'R' Data Structures — drawr-package","text":"Visualize contents different 'R' data structures.","code":""},{"path":[]},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/drawr-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"drawr: Create Graphics of 'R' Data Structures — drawr-package","text":"Maintainer: James Joseph Balamuta james.balamuta@gmail.com (ORCID)","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":null,"dir":"Reference","previous_headings":"","what":"Highlight a matrix — highlight_data","title":"Highlight a matrix — highlight_data","text":"Generate matrix active areas.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Highlight a matrix — highlight_data","text":"","code":"highlight_data(x, rows = NULL, columns = NULL, locations = NULL) highlight_rows(x, rows = NULL) highlight_columns(x, columns = NULL) highlight_locations(x, locations = NULL)"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Highlight a matrix — highlight_data","text":"x matrix. rows interger vector valid row index locations. columns integer vector containing valid column indexlocations. locations m 2 matrix points listed x, y format.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Highlight a matrix — highlight_data","text":"logical matrix required rows /columns points set TRUE. values given FALSE.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Highlight a matrix — highlight_data","text":"","code":"# 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"}] +[{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"James Joseph Balamuta. Author, maintainer.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Balamuta J (2024). drawr: Create Graphics 'R' Data Structures. R package version 0.0.1, https://r-pkg.thecoatlessprofessor.com/drawr/, https://github.com/coatless-rpkg/drawr.","code":"@Manual{, title = {drawr: Create Graphics of 'R' Data Structures}, author = {James Joseph Balamuta}, year = {2024}, note = {R package version 0.0.1, https://r-pkg.thecoatlessprofessor.com/drawr/}, url = {https://github.com/coatless-rpkg/drawr}, }"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"drawr","dir":"","previous_headings":"","what":"Create Graphics of R Data Structures","title":"Create Graphics of R Data Structures","text":"goal drawr draw different R data structures graphs.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create Graphics of R Data Structures","text":"can install development version drawr GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"coatless-rpkg/drawr\")"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"design","dir":"","previous_headings":"","what":"Design","title":"Create Graphics of R Data Structures","text":"package designed take advantage base R graphics alongside ggplot2. ’re providing two different implementations system naming scheme : draw_*(): base R graphics gdraw_*(): ggplot2","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Create Graphics of R Data Structures","text":"Take instance matrix looks like : wanted see contents layed indices? can achieve similar results ggplot2 function.","code":"mat_3x5 = matrix( c( 1, NA, 3, 4, NaN, NA, 7, 8, -9, 10, -11, 12, -Inf, -14, NA ), ncol = 5, byrow = TRUE) mat_3x5 #> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 NA 3 4 NaN #> [2,] NA 7 8 -9 10 #> [3,] -11 12 -Inf -14 NA # Load the library library(drawr) # Graphic of matrix data structure using base R graphics draw_matrix(mat_3x5) # Show the cell indices draw_matrix(mat_3x5, show_cell_indices = TRUE) # Show the row and column indices draw_matrix(mat_3x5, show_row_indices = TRUE, show_column_indices = TRUE) # Highlight cells over a specific value draw_matrix(mat_3x5, highlight_area = mat_3x5 > 4) # Graphic of matrix data structure using base R graphics gdraw_matrix(mat_3x5) # Highlight cells in specific columns gdraw_matrix(mat_3x5, highlight_area = highlight_columns(mat_3x5, columns = 2:4))"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize Data Inside of a Matrix — draw_matrix","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"Generate graph showing contents matrix.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"","code":"draw_matrix( data, show_cell_indices = FALSE, show_row_indices = FALSE, show_column_indices = FALSE, highlight_area = matrix(FALSE, nrow(data), ncol(data)), highlight_color = \"lemonchiffon\" ) gdraw_matrix( data, show_cell_indices = FALSE, show_row_indices = FALSE, show_column_indices = FALSE, highlight_area = matrix(FALSE, nrow(data), ncol(data)), highlight_color = \"lemonchiffon\" )"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"data object class matrix. show_cell_indices Display cell indices inside matrix cell, e.g. [, j]. Default: FALSE show_row_indices Display row indices next matrix row, e.g. [, ]. Default: FALSE show_column_indices Display column indices next matrix column, e.g. [, j]. Default: FALSE highlight_area Matrix logical values provide mask cells filled. Default: None. highlight_color Color use fill background cell.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize Data Inside of a Matrix — draw_matrix","text":"","code":"# Base graphics # Visualize a 3x3 mat_3x3 = matrix(c(10, 200, -30, 40, 500, 30, 90, -55, 10), ncol = 3) draw_matrix(mat_3x3) # Show the indices draw_matrix(mat_3x3, show_cell_indices = TRUE) # Highlight a row mat_4x4 = matrix(seq_len(16), nrow = 4) draw_matrix( mat_4x4, show_row_indices = TRUE, highlight_area = highlight_rows(mat_4x4, rows = 1)) # Highlight values above 5 mat_2x4 = matrix(round(rnorm(16, 5, 2), 2), ncol = 4) draw_matrix(mat_2x4, highlight_area = mat_2x4 > 2) # ggplot2 graphics ---- # Visualize a 3x3 mat_3x3 = matrix(c(10, 200, -30, 40, 500, 30, 90, -55, 10), ncol = 3) gdraw_matrix(mat_3x3) # View the matrix without indices present gdraw_matrix(mat_3x3, highlight_area = FALSE) # Highlight a row mat_2x2 = matrix(c(1, 2, 3, 4), nrow = 2) mat_2x2_mask = matrix(c(TRUE, TRUE, FALSE, FALSE), nrow = 2) gdraw_matrix(mat_2x2, highlight_area = mat_2x2_mask) # Highlight values above 5 mat_3x5 = matrix(round(rnorm(15, 5, 2), 2), ncol = 5) gdraw_matrix(mat_3x5, highlight_area = mat_3x5 > 2)"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize Data Inside of a Vector — draw_vector","title":"Visualize Data Inside of a Vector — draw_vector","text":"Generate graph showing contents Vector","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize Data Inside of a Vector — draw_vector","text":"","code":"draw_vector( data, layout = c(\"vertical\", \"horizontal\"), show_indices = c(\"none\", \"inside\", \"outside\"), highlight_area = rep(FALSE, length(data)), highlight_color = \"lemonchiffon\", graph_title = paste0(\"Data Object: \", deparse(substitute(data))), graph_subtitle = paste0(\"Length: \", paste(length(data), \"elements\"), \" | \", \"Data Type: \", paste0(class(data), collapse = \", \")) )"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize Data Inside of a Vector — draw_vector","text":"data object class vector. layout Orientation vector. Default: \"vertical\". show_indices Display data indices either: \"inside\", \"outside\", \"none\" vector cell, e.g. []. Default: \"none\" highlight_area Vector logical values provide mask cells filled. Default: None. highlight_color Color use fill background cell. graph_title Title appear upper left hand corner graph. graph_subtitle Subtitle appear immediately graph title upper left hand side graph.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/draw-vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize Data Inside of a Vector — draw_vector","text":"","code":"# Base graphics # Visualize a 3x3 vec_9 <- round(rnorm(5, 0, 4), 2) draw_vector(vec_9)"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/drawr-package.html","id":null,"dir":"Reference","previous_headings":"","what":"drawr: Create Graphics of 'R' Data Structures — drawr-package","title":"drawr: Create Graphics of 'R' Data Structures — drawr-package","text":"Visualize contents different 'R' data structures.","code":""},{"path":[]},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/drawr-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"drawr: Create Graphics of 'R' Data Structures — drawr-package","text":"Maintainer: James Joseph Balamuta james.balamuta@gmail.com (ORCID)","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":null,"dir":"Reference","previous_headings":"","what":"Highlight a matrix — highlight_data","title":"Highlight a matrix — highlight_data","text":"Generate matrix active areas.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Highlight a matrix — highlight_data","text":"","code":"highlight_data(x, rows = NULL, columns = NULL, locations = NULL) highlight_rows(x, rows = NULL) highlight_columns(x, columns = NULL) highlight_locations(x, locations = NULL)"},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Highlight a matrix — highlight_data","text":"x matrix. rows interger vector valid row index locations. columns integer vector containing valid column indexlocations. locations m 2 matrix points listed x, y format.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Highlight a matrix — highlight_data","text":"logical matrix required rows /columns points set TRUE. values given FALSE.","code":""},{"path":"http://r-pkg.thecoatlessprofessor.com/drawr/reference/highlight-data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Highlight a matrix — highlight_data","text":"","code":"# 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"}]