Last active
December 10, 2015 19:58
-
-
Save haven-jeon/4485043 to your computer and use it in GitHub Desktop.
knitr 사용을 위한 함수
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
#' run like this "require(devtools);source_gist("https://gist.github.com/4485043");" | |
compile_pdf<- function(filename, typeset="pdflatex"){ | |
require(knitr) | |
prev_enc <- getOption("encoding") | |
options(encoding="UTF-8") | |
rnw <- knit(filename, envir=new.env()) | |
system(paste(typeset, rnw)) | |
options(encoding=prev_enc) | |
} | |
knit_ko_win <- function(filename, ...){ | |
require(knitr) | |
prev_enc <- getOption("encoding") | |
options(encoding="UTF-8") | |
rnw <- knit(filename, envir=new.env(),...) | |
options(encoding=prev_enc) | |
return(rnw) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment