Skip to content

Commit

Permalink
README tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Jan 13, 2024
1 parent e789149 commit f0e0152
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 22 deletions.
18 changes: 7 additions & 11 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@ library(drawr)
# Graphic of matrix data structure using base R graphics
draw_matrix(mat_3x5)
# Disable showing the cell indices
draw_matrix(mat_3x5, show_cell_indices = FALSE)
# Disable showing any indices
draw_matrix(
mat_3x5,
show_row_indices = TRUE, show_column_indices = TRUE,
show_cell_indices = FALSE)
# 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_cells = mat_3x5 > 4)
draw_matrix(mat_3x5, highlight_area = mat_3x5 > 4)
```

We can achieve similar results with the `ggplot2` function.
Expand All @@ -86,9 +83,8 @@ We can achieve similar results with the `ggplot2` function.
#| results: 'markup'
# Graphic of matrix data structure using base R graphics
gdraw_matrix(mat_3x5)
# Highlight cells over a specific value
gdraw_matrix(mat_3x5, highlight_cells = mat_3x5 > 4)
# Highlight cells in specific columns
gdraw_matrix(mat_3x5, highlight_area = highlight_columns(mat_3x5, columns = 2:4))
```


Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,22 @@ draw_matrix(mat_3x5)
<img src="man/figures/README-base-example-1.png" width="100%" />

``` r
# Disable showing the cell indices
draw_matrix(mat_3x5, show_cell_indices = FALSE)
# Show the cell indices
draw_matrix(mat_3x5, show_cell_indices = TRUE)
```

<img src="man/figures/README-base-example-2.png" width="100%" />

``` r
# Disable showing any indices
draw_matrix(
mat_3x5,
show_row_indices = TRUE, show_column_indices = TRUE,
show_cell_indices = FALSE)
# Show the row and column indices
draw_matrix(mat_3x5, show_row_indices = TRUE, show_column_indices = TRUE)
```

<img src="man/figures/README-base-example-3.png" width="100%" />

``` r
# Highlight cells over a specific value
draw_matrix(mat_3x5, highlight_cells = mat_3x5 > 4)
draw_matrix(mat_3x5, highlight_area = mat_3x5 > 4)
```

<img src="man/figures/README-base-example-4.png" width="100%" />
Expand All @@ -95,9 +92,8 @@ gdraw_matrix(mat_3x5)
<img src="man/figures/README-ggplot2-example-1.png" width="100%" />

``` r

# Highlight cells over a specific value
gdraw_matrix(mat_3x5, highlight_cells = mat_3x5 > 4)
# Highlight cells in specific columns
gdraw_matrix(mat_3x5, highlight_area = highlight_columns(mat_3x5, columns = 2:4))
```

<img src="man/figures/README-ggplot2-example-2.png" width="100%" />
Binary file modified man/figures/README-base-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-base-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-base-example-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-ggplot2-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-ggplot2-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f0e0152

Please sign in to comment.