Created
March 5, 2019 00:19
-
-
Save shanmdphd/aceac7d8bc9df68a2fa4808a63b16ec9 to your computer and use it in GitHub Desktop.
ggforce 패키지를 사용해서 여러 페이지가 있는 PDF 파일 만들기.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggforce) | |
# 함수 정의 ---- | |
plot_multiple <- function(page_num) { | |
Theoph %>% | |
ggplot(aes(Time, conc)) + | |
geom_point() + | |
geom_line(alpha = 0.1) + | |
ggforce::facet_wrap_paginate(~Subject, ncol = 2, nrow = 2, page = page_num) | |
} | |
# pdf 만들기 ---- | |
pdf('ggforce-multiple-pdf.pdf') | |
plot_multiple(1) | |
plot_multiple(2) | |
plot_multiple(3) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment