【发布时间】:2020-12-15 21:16:02
【问题描述】:
我在 Rnw 文件中使用以下块。
<<scatter,dev='pdf',include=TRUE>>=
a <- rnorm(1e4)
b <- rnorm(1e4)
plot(a,b)
@
我分别在R3.6.3 和R4.0.2 下编织了相同的Rnw 文件。但是,R4.0.2 下生成的 PDF 图形比 R3.6.3 下生成的 PDF 图形大得多(约 8 倍)。
我想知道是否有办法(例如块选项)减少R4.0.2 下的 PDF 大小。
两个不同版本的R的会话信息如下所示。
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.29
loaded via a namespace (and not attached):
[1] compiler_4.0.2 magrittr_1.5 tools_4.0.2 stringi_1.4.6 highr_0.8 stringr_1.4.0
[7] xfun_0.16 evaluate_0.14
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.28
loaded via a namespace (and not attached):
[1] compiler_3.6.3 magrittr_1.5 tools_3.6.3 stringi_1.4.6 highr_0.8 stringr_1.4.0
[7] xfun_0.12 evaluate_0.14
【问题讨论】: