[R] knitr and functions generating latex

2013-10-09 Thread Daryl Morris

Hi,

I have what I think should be a basic question on knitr.  I am just 
moving to knitr, and previously I had created functions which 
automatically created latex wrappers for many (100s) figures.  I also 
have other functions which automatically create pages worth of latex tables.


The knitr method seems to be to write this figure code by hand.

Is there a way to use my pre-existing functions to output latex into the 
.Rnw document?  So far, everything I've tried isn't doing it. (I've been 
modifying the functions to output big strings of latex instead of 
writing files, and trying various methods to print that output into the 
.Rnw file).


It feels like this should be easy... the output of the R-block is latex.


thanks, Daryl

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] knitr and functions generating latex

2013-10-09 Thread Yihui Xie
I think in most cases you are probably on the wrong track if you have
to generate LaTeX code for figures from R code (LaTeX tables are
another story), but your case might be different. You did not give a
specific example on why you had to do that, so I cannot give any
advice for now.

My best guess is

results='asis'=
whatever_your_figure_functions_are()
@

So please provide a minimal example, and avoid indefinite descriptions
like seems or feels like (in particular, this should be easy
made me feel my IQ suddenly dropped by 50%).

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 9, 2013 at 10:36 PM, Daryl Morris dar...@uw.edu wrote:
 Hi,

 I have what I think should be a basic question on knitr.  I am just moving
 to knitr, and previously I had created functions which automatically created
 latex wrappers for many (100s) figures.  I also have other functions which
 automatically create pages worth of latex tables.

 The knitr method seems to be to write this figure code by hand.

 Is there a way to use my pre-existing functions to output latex into the
 .Rnw document?  So far, everything I've tried isn't doing it. (I've been
 modifying the functions to output big strings of latex instead of writing
 files, and trying various methods to print that output into the .Rnw file).

 It feels like this should be easy... the output of the R-block is latex.


 thanks, Daryl

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.