I recently wrote about the release of tidytext 0.2.1, and one of the most useful new features in this release is a couple of helper functions for making plots with ggplot2. These helper functions address a class of challenges that often arises when dealing with text data, so we’ve included them in the tidytext package. Let’s work through an example To show how to use these new functions, let’s wal
どーも。ggplot2は空手の一種として知られているので(要出典)普段の稽古が欠かせまん。今年を振り返り、ggplot2での作図について、いくつかの知見を共有します(書いている余裕がなかったんや...) library(magrittr) library(jpndistrict) ## Loading required package: jpmesh ## This package provide map data is based on the Digital Map ## 25000(Map Image) published by Geospatial Information Authorityof ## Japan (Approval No.603FY2017 information usage ## <http://www.gsi.go.jp>) library(sf) ## Li
English version: abrahamcow.hatenablog.com github.com ggtetrisって名前にしようかと思ったんだけど、もうある(GitHub - EmilHvitfeldt/ggtetris: Create Tetris Chart Visualizations in R)みたいなので、ggbrickにしました。 brickはレンガっていう意味らしいです。 マニュアルは気が向いたときにちょっとずつ書きます。 インストールは devtools::install_github("abikoushi/ggbrick") で多分いけます。 入ってる関数は基本的にはgeom_brickだけです。 気が向いたら触ってみて変なところを教えていただけると嬉しいです。 以下デモです。 基本的な使い方はこう。 library(ggplot2) library(ggbr
“…make both calculations and graphs. Both sorts of output should be studied; each will contribute to understanding.” F.J. Anscombe, 1973 Anscombe’s Quartet It can be difficult to demonstrate the importance of data visualization. Some people are of the impression that charts are simply “pretty pictures,” while all important information can be divined through statistical analysis. An effective (and
ggplot2で可視化しようとして、データ系列が多すぎてこんなもじゃもじゃになってしまう、みたいなことないでしょうか。 これを、一部だけを色付けしてこんな感じのプロットにしてくれるパッケージをつくりました。 インストール GitHub上からインストールできます。 devtools::install_github("yutannihilation/gghighlight") gghiglightがやっていること gghiglightの説明をする前に、まずは上のグラフが何をしているのか、まずはふつうのtidyverseでやってみます。 データはこんな感じのやつです。 library(dplyr, warn.conflicts = FALSE) set.seed(1) d <- tibble( idx = 1:10000, value = runif(idx, -1, 1), type = sa
追記(2017/05/04): gridExtraのwikiのURLが変わっていたので修正しました。 久々にggplot2のIssueを眺めてたら、gridExtraの作者が超有用ドキュメントを書いてるのを見つけたのでメモ。 ちなみに、元はこのIssueで見つけました: gridパッケージとは gridパッケージは、デフォルトでインストールされているパッケージで、グラフィカルな出力に関する低レベルな操作ができます。ggplot2とかlatticeはこのシステムを使って作られています。 grid is a low-level graphics system which provides a great deal of control and flexibility in the appearance and arrangement of graphical output. grid does
Tutorial R Tutorial ggplot2 ggplot2 Short Tutorial ggplot2 Tutorial 1 - Intro ggplot2 Tutorial 2 - Theme ggplot2 Tutorial 3 - Masterlist ggplot2 Quickref Foundations Linear Regression Statistical Tests Missing Value Treatment Outlier Analysis Feature Selection Model Selection Logistic Regression Advanced Linear Regression Advanced Regression Models Advanced Regression Models Time Series Time Serie
ggplot2にはデータを分割プロットする「facet_wrap」や「facet_grid」コマンドが収録されています。これらコマンドは非常に便利ですが、分割前のプロットは別途コマンド実行が必要です。本パッケージには分割前と指定したグループを拡大表示してくれる「facet_zoom」コマンドが収録されています。「facet_wrap」や「facet_grid」コマンドと使用目的が異なりますが便利なので紹介します。 なお、「facet_zoom」コマンドの例は散布図ですが箱ひげ図や折れ線グラフなども適応可能です。 パッケージバージョンは0.4.1。実行コマンドはwindows 11のR version 4.2.1で確認しています。 パッケージのインストール下記コマンドを実行してください。 #パッケージのインストール install.packages("ggforce")実行コマンドの紹介詳細
ggplot2の体裁をインタラクティブに操作可能なパッケージの紹介です。操作後に体裁を適応したggplot2のコードが出力されますので何かの参考になると思います。 ・パッケージ利用に必須なRStudio公式ホームページ https://www.rstudio.com/ パッケージバージョンは0.1.5。実行コマンドはRStudioのRStudio Desktop 2021.09.2+382、windows 11のR version 4.1.3で確認しています。 パッケージのインストール下記コマンドを実行してください。 #パッケージのインストール install.packages("ggThemeAssist")実行コマンド詳細はコマンド内を確認ください。 #パッケージの読み込み library("ggThemeAssist") #tidyverseパッケージがなければインストール if(!
複数のggplot2のオブジェクトを簡単にプロットできるパッケージの紹介です。プロット領域と体裁さえ決めてしまえば、定型的な繰り返しの出力に便利だと思います。 パッケージバージョンは0.0.0.9000。実行コマンドはR version 4.2.2で確認しています。 パッケージのインストール下記、コマンドを実行してください。ggplot2パッケージの最新バージョンをインストールしています。 #パッケージのインストール install.packages("devtools") devtools::install_github("zaczap/bluepRint")実行コマンド詳細はコメント、パッケージのヘルプを確認してください。 #パッケージの読み込み library("bluepRint") ###データ例の作成##### n <- 30 TestData <- data.frame(Gr
I look at differences in a side-by-side, from a practitioner’s perspective. In R, the open source statistical computing language, there are a lot of ways to do the same thing. Especially with visualization. R comes with built-in functionality for charts and graphs, typically referred to as base graphics. Then there are R packages that extend functionality. Although there are many packages, ggplot2
geom_lineするとき、NAが入っているとそこで線が途切れてしまう。 library("ggplot2") smp <- data.frame(x = 1:5, y = c(1:3, NA, 5)) ggplot(smp, aes(x = x, y = y, group = 1)) + geom_line() + geom_point() あらかじめNAを除いておけば、線をつないでくれる。 ggplot(subset(smp, !is.na(y)), aes(x = x, y = y, group = 1)) + geom_line() + geom_point() なんだか毎回やり方を調べてる気がするのでメモ。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く