yihui / animation

A gallery of animations in statistics and utilities to create animations
https://yihui.org/animation/
206 stars 60 forks source link

use shQuote to solve the special characters problem in filename #110 #111

Closed yulijia closed 6 years ago

yulijia commented 6 years ago

110 use shQuote to solve the special characters problem in filenames

I need test it when I find pdftk package for my OS..

yulijia commented 6 years ago

Test is fine

demo

library(devtools)
install_github("yulijia/animation")
library(animation)

pdf("huge-'plot.pdf")
plot(rnorm(50000))
dev.off()
pdftk("huge-'plot.pdf", output = "huge-plot1.pdf")

output

* Pdftk is running...
* 'pdftk' "huge-'plot.pdf"  output huge-plot1.pdf compress dont_ask
* done!

session info

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] animation_2.5   devtools_1.13.4

loaded via a namespace (and not attached):
[1] httr_1.3.1     compiler_3.4.3 R6_2.2.2       tools_3.4.3    withr_2.1.1
[6] curl_3.1       memoise_1.1.0  git2r_0.20.0   digest_0.6.13
yulijia commented 6 years ago

Okay, I will do this on next month.