Skip to content

Commit

Permalink
improve DOcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Aug 1, 2024
1 parent 2683bdb commit afcec3e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
11 changes: 7 additions & 4 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -609,17 +609,20 @@ <h2 id="installation">Installation</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="co"># install.packages(&quot;devtools&quot;)</span></span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a>pak<span class="sc">::</span><span class="fu">pkg_install</span>(<span class="st">&quot;Yunuuuu/ggalign&quot;</span>)</span></code></pre></div>
<h1 id="ggalign">ggalign</h1>
<p>This package is an extension of ggplot2 that aligns multiple ggplot
objects along their axes in the same order. It is highly beneficial for
organizing plots that involve changing the order of data.</p>
<p>This package extends ggplot2 and provides numerous benefits for
organizing and arranging plots. It is specifically designed to align a
specific axis of multiple ggplot objects in a consistent order. This
functionality is particularly useful for plots that require manipulation
of data order. A common plot combination that can be effectively
organized using this package includes a dendrogram and a heatmap.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a><span class="fu">library</span>(ggalign)</span>
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a><span class="co">#&gt; Loading required package: ggplot2</span></span></code></pre></div>
<p>Let’s begin by creating some example data</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">123</span>)</span>
<span id="cb3-2"><a href="#cb3-2" tabindex="-1"></a>small_mat <span class="ot">&lt;-</span> <span class="fu">matrix</span>(<span class="fu">rnorm</span>(<span class="dv">81</span>), <span class="at">nrow =</span> <span class="dv">9</span>)</span>
<span id="cb3-3"><a href="#cb3-3" tabindex="-1"></a><span class="fu">rownames</span>(small_mat) <span class="ot">&lt;-</span> <span class="fu">paste0</span>(<span class="st">&quot;row&quot;</span>, <span class="fu">seq_len</span>(<span class="fu">nrow</span>(small_mat)))</span>
<span id="cb3-4"><a href="#cb3-4" tabindex="-1"></a><span class="fu">colnames</span>(small_mat) <span class="ot">&lt;-</span> <span class="fu">paste0</span>(<span class="st">&quot;column&quot;</span>, <span class="fu">seq_len</span>(<span class="fu">ncol</span>(small_mat)))</span></code></pre></div>
<p><code>ggalign</code> provids two layout to build plots:</p>
<p><code>ggalign</code> provids two layouts to build plots:</p>
<ul>
<li><code>layout_heatmap</code>: heatmap layout</li>
<li><code>layout_stack</code>: align plots vertically or
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ pak::pkg_install("Yunuuuu/ggalign")

# ggalign

This package is an extension of ggplot2 that aligns multiple ggplot
objects along their axes in the same order. It is highly beneficial for
organizing plots that involve changing the order of data.
This package extends ggplot2 and provides numerous benefits for
organizing and arranging plots. It is specifically designed to align a
specific axis of multiple ggplot objects in a consistent order. This
functionality is particularly useful for plots that require manipulation
of data order. A common plot combination that can be effectively
organized using this package includes a dendrogram and a heatmap.

``` r
library(ggalign)
Expand All @@ -31,7 +34,7 @@ rownames(small_mat) <- paste0("row", seq_len(nrow(small_mat)))
colnames(small_mat) <- paste0("column", seq_len(ncol(small_mat)))
```

`ggalign` provids two layout to build plots:
`ggalign` provids two layouts to build plots:

- `layout_heatmap`: heatmap layout
- `layout_stack`: align plots vertically or horizontally
Expand Down
11 changes: 7 additions & 4 deletions vignettes/Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ knitr::opts_chunk$set(
```

# ggalign
This package is an extension of ggplot2 that aligns multiple ggplot objects
along their axes in the same order. It is highly beneficial for organizing plots
that involve changing the order of data.
This package extends ggplot2 and provides numerous benefits for organizing and
arranging plots. It is specifically designed to align a specific axis of
multiple ggplot objects in a consistent order. This functionality is
particularly useful for plots that require manipulation of data order. A common
plot combination that can be effectively organized using this package includes a
dendrogram and a heatmap.

```{r setup}
library(ggalign)
Expand All @@ -32,7 +35,7 @@ rownames(small_mat) <- paste0("row", seq_len(nrow(small_mat)))
colnames(small_mat) <- paste0("column", seq_len(ncol(small_mat)))
```

`ggalign` provids two layout to build plots:
`ggalign` provids two layouts to build plots:

- `layout_heatmap`: heatmap layout
- `layout_stack`: align plots vertically or horizontally
Expand Down

0 comments on commit afcec3e

Please sign in to comment.