Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-13 Thread Rich Shepard
On Sat, 11 Jul 2015, Rich Shepard wrote: As I wrote above, each gray box with "Chunk n" inside has a unique number visible. I see this unnamed-chunk as the name for the first figure. It's in the /figure subdirectory as unnamed-chunk-7.1.pdf Because that figure is in what LyX shows as Chunk 8 I

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Rich Shepard
On Sat, 11 Jul 2015, Liviu Andronic wrote: Not necessarily. There are LaTeX labels associated with figures; and knitr labels associated with chunks. The latter MUST be unique for figure chunks, while fig.lp seems to affect the former. To be on the safe side, just manually ensure you have unique

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Liviu Andronic
On Sat, Jul 11, 2015 at 11:12 PM, Rich Shepard wrote: > On Sat, 11 Jul 2015, Liviu Andronic wrote: > >> Knitr seems to be picky about label names of figure chunks to be unique. >> Check this. Also, to be safe, keep to one figure per chunk. > > > Liviu, > > Yes, I read about naming lables; that's

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Rich Shepard
On Sat, 11 Jul 2015, Liviu Andronic wrote: Knitr seems to be picky about label names of figure chunks to be unique. Check this. Also, to be safe, keep to one figure per chunk. Liviu, Yes, I read about naming lables; that's why knitr has the lp option for label prefix. In my case, one lable

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Liviu Andronic
On Sat, Jul 11, 2015 at 9:48 PM, Rich Shepard wrote: > On Sat, 11 Jul 2015, Liviu Andronic wrote: > >> Another way to do this is to keep figure floats, labels and cross-refs >> exclusively in LyX. So the chunk would simply output a graph, and you >> place the chunk within a LyX float (with associa

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Rich Shepard
On Sat, 11 Jul 2015, Liviu Andronic wrote: Another way to do this is to keep figure floats, labels and cross-refs exclusively in LyX. So the chunk would simply output a graph, and you place the chunk within a LyX float (with associated caption and label). Then use normal LyX workflow. Might

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Liviu Andronic
On Sat, Jul 11, 2015 at 6:53 PM, Rich Shepard wrote: >> http://yihui.name/knitr/options/ > > > Liviu, > > I'm becoming more comfortable with knitr in lyx, yet cannot find answers > to some questions in the above page. For example, in a figure chunk I create > an option box and enter fig.cap='som

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Scott Kostyshak
On Sat, Jul 11, 2015 at 12:53 PM, Rich Shepard wrote: >> http://yihui.name/knitr/options/ > > > Liviu, > > I'm becoming more comfortable with knitr in lyx, yet cannot find answers > to some questions in the above page. For example, in a figure chunk I create > an option box and enter fig.cap='so

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-11 Thread Rich Shepard
http://yihui.name/knitr/options/ Liviu, I'm becoming more comfortable with knitr in lyx, yet cannot find answers to some questions in the above page. For example, in a figure chunk I create an option box and enter fig.cap='some caption text' and fig.lp=1 as the lable prefix. What I have not f

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Liviu Andronic wrote: While not developed much these days, Sweave has the merit of being stable and mostly ironed out; updating your installation is unlikely to break your documents. Makes sense. knitr on the other hand can be a moving target, and not always backwards c

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Liviu Andronic
On Fri, Jul 3, 2015 at 11:30 PM, Rich Shepard wrote: > On Fri, 3 Jul 2015, Scott Kostyshak wrote: > >> I would like to backtrack on this. Let's change "this is not just a >> personal preference" to "this is just a personal preference". Please >> google to read about the differences. > > > Scott, >

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Scott Kostyshak wrote: I would like to backtrack on this. Let's change "this is not just a personal preference" to "this is just a personal preference". Please google to read about the differences. Scott, Eh, semantics. From what I've read knitr is an augmented Sweave th

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Scott Kostyshak
On Fri, Jul 3, 2015 at 4:17 AM, Scott Kostyshak wrote: > On Thu, Jul 02, 2015 at 03:16:05PM -0700, Rich Shepard wrote: >> On Thu, 2 Jul 2015, Rich Shepard wrote: >> >> > How do I tell Sweave that the data frame, b.cast, is in the same directory >> >as the document? >> >> And, ... there is no Swe

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Liviu Andronic wrote: results="hide" or echo=FALSE Liviu, is your friend, depending on what you want to hide. Using LyX chunks, you would right-click in Chunk to insert Options argument, and insert the above in there. Thank you. A chunk MUST always be on its own par

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Liviu Andronic
On Fri, Jul 3, 2015 at 10:33 PM, Rich Shepard wrote: > On Fri, 3 Jul 2015, Liviu Andronic wrote: > >> It should. Try to inspect how the function is created, whether the >> function object exists, if the workspace is loaded as expected, etc. > > > Liviu, > > The function exists in the workspace.

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Scott Kostyshak wrote: I strongly agree. It takes a long time to get it right (and "right" is of course subjective and depends on your workflow). For me, a lot of it has to do with how long each chunk takes to run. If it is short, then it is in as a simple chunk. If it is lon

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Liviu Andronic wrote: It should. Try to inspect how the function is created, whether the function object exists, if the workspace is loaded as expected, etc. Liviu, The function exists in the workspace. But, I cannot list the workspace objects (see attached .pdf). Als

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Scott Kostyshak
On Fri, Jul 3, 2015 at 4:09 PM, Liviu Andronic wrote: > At the same time it can be a pain until you get the hang of it. Right > now I use a mix where I prepare the data and save it in the workspace, > load workspace, and run needed code from there. It's not reproducible > as purists will have it,

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Liviu Andronic
On Fri, Jul 3, 2015 at 9:29 PM, Rich Shepard wrote: > On Fri, 3 Jul 2015, Liviu Andronic wrote: > >> If you have the results already ready, then what you generally want to do >> is: load(".RData") > > > Liviu, > > For some reason this does not allow a function (saved in the current > workspace)

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Liviu Andronic wrote: If you have the results already ready, then what you generally want to do is: load(".RData") Liviu, For some reason this does not allow a function (saved in the current workspace) to be found and run in a knitr chunk in the lyx document. It does run

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Liviu Andronic
On Fri, Jul 3, 2015 at 2:59 PM, Rich Shepard wrote: > On Fri, 3 Jul 2015, Scott Kostyshak wrote: > >> Let's take this step-by-step. First, I strongly recommend using knitr over >> Sweave (this is not just a personal preference). If you go to Help > >> Specific Manuals > Knitr and compile, does it

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Scott Kostyshak
On Fri, Jul 03, 2015 at 05:59:44AM -0700, Rich Shepard wrote: > On Fri, 3 Jul 2015, Scott Kostyshak wrote: > > >Let's take this step-by-step. First, I strongly recommend using knitr over > >Sweave (this is not just a personal preference). If you go to Help > > >Specific Manuals > Knitr and compile

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Rich Shepard
On Fri, 3 Jul 2015, Scott Kostyshak wrote: Let's take this step-by-step. First, I strongly recommend using knitr over Sweave (this is not just a personal preference). If you go to Help > Specific Manuals > Knitr and compile, does it work? Scott, Interesting. I'll take a little time to try t

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-03 Thread Scott Kostyshak
On Thu, Jul 02, 2015 at 03:16:05PM -0700, Rich Shepard wrote: > On Thu, 2 Jul 2015, Rich Shepard wrote: > > > How do I tell Sweave that the data frame, b.cast, is in the same directory > >as the document? > > And, ... there is no Sweave article class; I've been using KOMA-article. > > Rich Hi

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, Rich Shepard wrote: How do I tell Sweave that the data frame, b.cast, is in the same directory as the document? And, ... there is no Sweave article class; I've been using KOMA-article. Rich

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, Rich Shepard wrote: Do I specify a fully qualified path within the .lyx document? Nope. That's not it. How do I tell Sweave that the data frame, b.cast, is in the same directory as the document? Rich

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, Rich Shepard wrote: Here's the view of the attempt to compile the document: Slight progress: I found how to define a chunk of R code within Lyx's ERT box: <>= code @ Modified my document and tried to compile it. This is the new failure thread:

Re: Using Sweave with LyX -- TeX Compilation Output

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, Rich Shepard wrote: 2.) If the document suffix is supposed to be .Rnw rather than .lyx, how do I open the .Rnw version in LyX since the menu allows only files with the .lyx suffix? Here's the view of the attempt to compile the document: 14:27:48.984: Exporting ... 14:27