기본적으로 슬라이드에 맞지 않으며 다른 방법으로도 인쇄하지 않습니다.R markdown, knitr, pandoc, beamer로 플롯 크기 및 해상도
다음은 .Rmd : 입니다. 편집 : 모든 청크에서 plot()을 사용해야합니다. 두 번째 줄이 이제 인쇄됩니다. RStudio에서
knit("test.Rmd")
system("pandoc -s -t beamer --slide-level 1 test.md -o test.tex")
열기 test.tex
클릭 "PDF를 컴파일"test.Rmd
그런 다음 빔 프로젝터를 사용하여 TEX에 컴파일 같은 것을
# Plot should show at high resolution
```{r echo=FALSE, comment = ""}
# load some data
require(plyr)
rbi <- ddply(baseball, .(year), summarise,
mean_rbi = mean(rbi, na.rm = TRUE))
```
```{r}
# plot
plot(mean_rbi ~ year, type = "l", data = rbi)
```
# Second attempt
```{r, fig.width = 2, fig.height = 2}
plot(mean_rbi ~ year, type = "l", data = rbi)
```
# Third attempt
```{r, out.width = 2, out.height = 2}
plot(mean_rbi ~ year, type = "l", data = rbi)
```
# Fourth attempt
```{r, out.width = '200px', out.height = '200px'}
plot(mean_rbi ~ year, type = "l", data = rbi)
```
# Fifth attempt
```{r, out.width = '\\maxwidth'}
plot(mean_rbi ~ year, type = "l", data = rbi)
```
저장.
나는 Yihui의 documentation을 읽었으며 정말 확실한 것을 놓치지 않았 으면 좋겠습니다.
편집 Yihui의 제안을 통합 한 새로운 코드.
R version 3.0.1 (16/05/2013)
Platform: x86_64-pc-linux-gnu (64-bit)
Local:
[1] LC_CTYPE = en_US.UTF-8 LC_NUMERIC = C LC_TIME = C LC_COLLATE = C
[5] LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] plyr_1.8 markdown_0.6 knitr_1.2 rCharts_0.3.51 slidify_0.3.52
loaded via a namespace (and not attached):
[1] RJSONIO_1.0-3 codetools_0.2-8 digest_0.6.3 evaluate_0.4.3 formatR_0.8
[6] grid_3.0.1 lattice_0.20-15 stringr_0.6.2 tools_3.0.1 whisker_0.3-2
[11] yaml_2.1.7
나는 게시물을 편집하고 'print (x)'를 삭제했습니다. 이는 의미가없고 오도하기 쉽기 때문입니다. 네가 괜찮 았으면 좋겠다. –