Skip to content

Commit

Permalink
ups
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkunst committed Jul 24, 2023
1 parent 2e040a0 commit 7fbcda7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-list
</div>
</div>
<div class="list grid quarto-listing-cols-3">
<div class="g-col-1" data-index="0" data-categories="minipost,ggplot2,dont-forget" data-listing-date-sort="1690084800000" data-listing-file-modified-sort="1690212687202" data-listing-reading-time-sort="11.225">
<div class="g-col-1" data-index="0" data-categories="minipost,ggplot2,dont-forget" data-listing-date-sort="1690084800000" data-listing-file-modified-sort="1690215187847" data-listing-reading-time-sort="11.235">
<a href="./posts/2023-07-10-my-favorite-ggplot2-packages-with-examples/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand Down
3 changes: 1 addition & 2 deletions docs/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@
<ul>
<li>
<a href="https://ggforce.data-imaginist.com">ggforce</a> takes annotations to the next level.</li>
<li>Not only annotation. Other funcionalities like.</li>
<li>Hig</li>
<li>A lot of other functionalities like new geoms, new facets!</li>
</ul>
<div class="cell">
<details open=""><summary>Code</summary><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="kw" style="color: #003B4F;"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op" style="color: #5E5E5E;">(</span><span class="va" style="color: #111111;"><a href="https://ggforce.data-imaginist.com">ggforce</a></span><span class="op" style="color: #5E5E5E;">)</span></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ <h1 class="title">My favorite <code>ggplot2</code> packages with examples</h1>
<ul>
<li>
<a href="https://ggforce.data-imaginist.com">ggforce</a> takes annotations to the next level.</li>
<li>Not only annotation. Other funcionalities like.</li>
<li>Hig</li>
<li>A lot of other functionalities like new geoms, new facets!</li>
</ul>
<div class="cell">
<details open=""><summary>Code</summary><div class="sourceCode" id="cb7"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://ggforce.data-imaginist.com">ggforce</a></span><span class="op">)</span></span>
Expand Down
2 changes: 1 addition & 1 deletion docs/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@
"href": "posts/2023-07-10-my-favorite-ggplot2-packages-with-examples/index.html#ggforce",
"title": "My favorite ggplot2 packages with examples",
"section": "{ggforce}",
"text": "{ggforce}\nSource: https://ggforce.data-imaginist.com/.\n\n\nggforce takes annotations to the next level.\nNot only annotation. Other funcionalities like.\nHig\n\n\nCodelibrary(ggforce)\n\np1 +\n geom_mark_hull(\n aes(filter = mpg > 30, label = \"Interesting\"),\n description = \"Lightweight vehicles have high performance.\",\n color = \"gray70\",\n fill = \"gray90\",\n concavity = 5,\n # control width text\n label.minwidth = unit(100, \"mm\"),\n # how much distance before show legend\n label.buffer = unit(2.5, \"mm\"),\n label.colour = \"gray30\",\n label.family = \"ibm\"\n ) +\n # use circle for points\n geom_mark_circle(\n aes(filter = wt > 3.75, label = NULL, description = name),\n color = \"gray70\",\n fill = \"transparent\",\n label.fontsize = 10,\n label.family = \"ibm\"\n )\n\n\n\n\nAnd other geom_mark_* like hull, circle, ellpse, rect.\n\nCodep2 + \n geom_mark_ellipse(\n aes(fill = species, label = species),\n alpha = 0.1,\n color = \"transparent\", # a nice touch sometimes! (imho)\n label.colour = \"gray30\",\n label.family = \"ibm\",\n label.fontsize = 8,\n # label.fontface = \"plain\",\n # this is just for blogpost\n expand = unit(-5, \"mm\"),\n radius = unit(5, \"mm\")\n ) +\n geom_mark_circle(\n aes(\n filter = coalesce(bill_length_mm, 0) == max(bill_length_mm, na.rm = TRUE),\n label = NULL, \n description = \"A rare penguin!\"\n ),\n color = \"gray70\",\n fill = \"transparent\",\n label.fontsize = 8,\n label.family = \"ibm\"\n ) +\n theme(legend.position = \"none\") +\n labs(x = NULL, y = NULL)\n\n\n\n\n\n\n\nNow imagine we used a \\(K\\)-means algorithm:\n\nCodedcenters <- penguins |>\n select(species, bill_length_mm, bill_depth_mm) |> \n filter(!is.na(bill_length_mm)) |> \n filter(!is.na(bill_depth_mm)) |> \n group_by(species) |> \n summarise(across(everything(), median)) |> \n select(-species) |> \n mutate(cluster = as.character(row_number()))\n\ndcenters\n\n# A tibble: 3 × 3\n bill_length_mm bill_depth_mm cluster\n <dbl> <dbl> <chr> \n1 38.8 18.4 1 \n2 49.6 18.4 2 \n3 47.4 15 3 \n\nCodebnd <- penguins |>\n summarise(\n min(bill_length_mm, na.rm = TRUE) - 1,\n max(bill_length_mm, na.rm = TRUE) + 1,\n min(bill_depth_mm, na.rm = TRUE) - 1,\n max(bill_depth_mm, na.rm = TRUE) + 1\n ) |> \n as.list() |> \n unlist() |> \n as.vector()\n\np2 +\n geom_voronoi_tile(\n aes(fill = cluster, group = -1),\n data = dcenters, alpha = 0.2, bound = bnd\n ) +\n geom_voronoi_segment(\n aes(group = -1),\n data = dcenters, color = \"gray90\", bound = bnd\n ) +\n xlim(bnd[1], bnd[2]) + \n ylim(bnd[3], bnd[4]) +\n scale_fill_viridis_d(direction = -1, option = \"C\") +\n # its better put point over all layers\n geom_point(\n aes(color = species), \n size = 2,\n shape = 21, \n color = \"gray90\"\n ) +\n theme(legend.position = \"right\")"
"text": "{ggforce}\nSource: https://ggforce.data-imaginist.com/.\n\n\nggforce takes annotations to the next level.\nA lot of other functionalities like new geoms, new facets!\n\n\nCodelibrary(ggforce)\n\np1 +\n geom_mark_hull(\n aes(filter = mpg > 30, label = \"Interesting\"),\n description = \"Lightweight vehicles have high performance.\",\n color = \"gray70\",\n fill = \"gray90\",\n concavity = 5,\n # control width text\n label.minwidth = unit(100, \"mm\"),\n # how much distance before show legend\n label.buffer = unit(2.5, \"mm\"),\n label.colour = \"gray30\",\n label.family = \"ibm\"\n ) +\n # use circle for points\n geom_mark_circle(\n aes(filter = wt > 3.75, label = NULL, description = name),\n color = \"gray70\",\n fill = \"transparent\",\n label.fontsize = 10,\n label.family = \"ibm\"\n )\n\n\n\n\nAnd other geom_mark_* like hull, circle, ellpse, rect.\n\nCodep2 + \n geom_mark_ellipse(\n aes(fill = species, label = species),\n alpha = 0.1,\n color = \"transparent\", # a nice touch sometimes! (imho)\n label.colour = \"gray30\",\n label.family = \"ibm\",\n label.fontsize = 8,\n # label.fontface = \"plain\",\n # this is just for blogpost\n expand = unit(-5, \"mm\"),\n radius = unit(5, \"mm\")\n ) +\n geom_mark_circle(\n aes(\n filter = coalesce(bill_length_mm, 0) == max(bill_length_mm, na.rm = TRUE),\n label = NULL, \n description = \"A rare penguin!\"\n ),\n color = \"gray70\",\n fill = \"transparent\",\n label.fontsize = 8,\n label.family = \"ibm\"\n ) +\n theme(legend.position = \"none\") +\n labs(x = NULL, y = NULL)\n\n\n\n\n\n\n\nNow imagine we used a \\(K\\)-means algorithm:\n\nCodedcenters <- penguins |>\n select(species, bill_length_mm, bill_depth_mm) |> \n filter(!is.na(bill_length_mm)) |> \n filter(!is.na(bill_depth_mm)) |> \n group_by(species) |> \n summarise(across(everything(), median)) |> \n select(-species) |> \n mutate(cluster = as.character(row_number()))\n\ndcenters\n\n# A tibble: 3 × 3\n bill_length_mm bill_depth_mm cluster\n <dbl> <dbl> <chr> \n1 38.8 18.4 1 \n2 49.6 18.4 2 \n3 47.4 15 3 \n\nCodebnd <- penguins |>\n summarise(\n min(bill_length_mm, na.rm = TRUE) - 1,\n max(bill_length_mm, na.rm = TRUE) + 1,\n min(bill_depth_mm, na.rm = TRUE) - 1,\n max(bill_depth_mm, na.rm = TRUE) + 1\n ) |> \n as.list() |> \n unlist() |> \n as.vector()\n\np2 +\n geom_voronoi_tile(\n aes(fill = cluster, group = -1),\n data = dcenters, alpha = 0.2, bound = bnd\n ) +\n geom_voronoi_segment(\n aes(group = -1),\n data = dcenters, color = \"gray90\", bound = bnd\n ) +\n xlim(bnd[1], bnd[2]) + \n ylim(bnd[3], bnd[4]) +\n scale_fill_viridis_d(direction = -1, option = \"C\") +\n # its better put point over all layers\n geom_point(\n aes(color = species), \n size = 2,\n shape = 21, \n color = \"gray90\"\n ) +\n theme(legend.position = \"right\")"
},
{
"objectID": "posts/2023-07-10-my-favorite-ggplot2-packages-with-examples/index.html#ggfittext",
Expand Down
4 changes: 2 additions & 2 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://jkunst.com/blog/index.html</loc>
<lastmod>2023-07-24T15:34:18.039Z</lastmod>
<lastmod>2023-07-24T16:13:46.784Z</lastmod>
</url>
<url>
<loc>https://jkunst.com/blog/about.html</loc>
Expand Down Expand Up @@ -102,7 +102,7 @@
</url>
<url>
<loc>https://jkunst.com/blog/posts/2023-07-10-my-favorite-ggplot2-packages-with-examples/index.html</loc>
<lastmod>2023-07-24T15:34:31.399Z</lastmod>
<lastmod>2023-07-24T16:14:03.847Z</lastmod>
</url>
<url>
<loc>https://jkunst.com/blog/posts/my-favorite-ggplot2-packages-with-examples/index.html</loc>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ p1 +
Source: [https://ggforce.data-imaginist.com/](https://ggforce.data-imaginist.com/).

- `{ggforce}` takes annotations to the next level.
- Not only annotation. Other funcionalities like.
- Hig
- A lot of other functionalities like new geoms, new facets!

```{r}
library(ggforce)
Expand Down

0 comments on commit 7fbcda7

Please sign in to comment.