Save R function to a text file latex…

Save R function to a text file

latex.code <- function(){
   cat("\\begin{align}\n")
   cat("[X'X]^{-1}X'y\n")
   cat("\\end{align}\n")
}
sink(file='ols.txt')
latex.code()
sink()

http://stackoverflow.com/questions/6222565/how-can-i-save-text-to-a-file-in-r

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *