Computer Science/R

[R package] ggplot 오브젝트를 쉽게 합쳐주는 patchwork

2023. 10. 9. 08:14

R에서 그림을 그릴 때 주로 ggplot2를 사용한다. 이때 다수의 그림을 그려야하는 상황에서 그림 하나씩을 따로 출력하거나 저장할 수도 있지만, 미리 합쳐두고 출력하거나 저장하면 더 간단히 자료 정리가 가능하다. 이럴 때 활용할 수 있는 패키지로 patchwork가 있다.

https://patchwork.data-imaginist.com/

 

The Composer of Plots

The ggplot2 package provides a strong API for sequentially building up a plot, but does not concern itself with composition of multiple plots. patchwork is a package that expands the API to allow for arbitrarily complex composition of plots by, among other

patchwork.data-imaginist.com

구체적인 사용 방법은 위 링크에서 확인할 수 있다.

개인적으로 여러 그림을 그려 정리해야하는 상황에서 크게 도움이 된 패키지였다.

728x90
반응형