Increment version number to 0.5.0.9000
Highlight geoms in ggplot2.
install.packages("gghighlight") # Or the development version from GitHub: # install.packages("devtools") devtools::install_github("yutannihilation/gghighlight")
(For the full version, please refer to Introduction to gghighlight).
Suppose we have a data that has so many series that it is hard to identify them by their colours as the differences are so subtle.
library(ggplot2) ggplot(d) + geom_line(aes(idx, value, colour = type))
With gghighlight(), we can highlight the lines whose max values are larger than 20:
gghighlight()
library(gghighlight) p <- ggplot(d) + geom_line(aes(idx, value, colour = type)) + gghighlight(max(value) > 20) #> label_key: type p
The result is a usual ggplot object, so it is fully customizable. For example, it can be used with custom themes and facets.
p + theme_minimal()
p + theme_minimal() + facet_wrap(~ type)
gghighlight() can highlight almost any geoms. For more details, please read Introduction to gghighlight.
用于在ggplot2图形中高亮显示特定数据子集的R语言扩展包
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
gghighlight
Highlight geoms in ggplot2.
Installation
Example
(For the full version, please refer to Introduction to gghighlight).
Suppose we have a data that has so many series that it is hard to identify them by their colours as the differences are so subtle.
With
gghighlight(), we can highlight the lines whose max values are larger than 20:The result is a usual ggplot object, so it is fully customizable. For example, it can be used with custom themes and facets.
gghighlight()can highlight almost any geoms. For more details, please read Introduction to gghighlight.