Feature Request from Doug Martin and Tom Philips

Doug Martin martinrd3d at gmail.com
Tue Jan 19 17:03:01 UTC 2021


Scott (and all),

I have attached the LYX segment from one of our book chapters, along with a
page from the compiled pdf file that contains
the resulting Table TS-2.1.

This tiny example illustrates how we currently make most of our tables
using the kableExtra package (kable is included in knitr),
and if we had an R script to produce an LYX Table with the data frame (or
data.table) as input, we would surely use it.

FYI, in case you want to compile the LYX file, you just need to strip out
the Springer svmono (book templates) stuff, etc., in the
LaTeX preamble, install knitr and kableExtra from CRAN, and install the
optimalPsiRho package with:

devtools::install_github("kjellpk/optimalRhoPsi").

Just before sending this I noticed the several other emails on the topic,
and will take a look at them.

Thanks,
Doug

On Mon, Jan 18, 2021 at 11:27 AM Scott Kostyshak <skostysh at lyx.org> wrote:

> On Mon, Jan 18, 2021 at 11:03:49AM -0800, Doug Martin wrote:
> > On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak <skostysh at lyx.org>
> wrote:
> >
> > > On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
> > > > Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > > > > JMarc and all,
> > > > >
> > > > > Tom and I use knitr extensively for R code chunks, and we mostly
> use
> > > > > kable with kableExtra to make tables.
> > > > > The input to kable are R data frames, or data.tables, which are the
> > > > > result of model fitting and related calculations.
> > > > > But we like to put mathematical expressions in selected cells of
> > > tables,
> > > > > which is so easy with LYX tables, and we currently
> > > > > have to make the data entry into LYX by hand from data tables and
> > > > > data.tables in order to make use of that feature.
> > > > > So it would be great if we could import R data tables and
> data.tables
> > > > > into LYX tables, rather than using the kable/kableExtra
> > > > > solution for our tables  (maybe I didn't make that clear in my
> earlier
> > > > > email).  Then we would probably would drop use of
> > > > > kable/kableExtra.
> > > >
> > > > So you want to import as .tex the result of R processing. This can be
> > > done
> > > > via "Paste from LaTeX". What would be missing for your intended
> usage?
> > >
> > > From what I understand, they would like to import a .Rds file without
> > > having to manually convert it to LaTeX.
> > >
> >
> > Scott,
> >
> > Definitely correct on the "without" part.  But we want to directly import
> > an R object
> > of class data.frame or data.table into an LYX table.
> >
> > If we have to export such an object first, we would typically export it
> to
> > an .Rda object.
> > But it would be far more convenient to not have to do that.
>
> Thanks for the clarification, Doug. It might help us to have a complete,
> simple, example to play with. Can you give us the .lyx file and R
> code/file? To make things perfectly clear to us, it might help to give
> us a "before" version of the .lyx file and an "after" version of the
> .lyx file. To create the "after" version you would have to do the steps
> manually, but by seeing it we could make sure we understand what you
> want to automate and what you expect the result to be.
>
> Thanks for your patience,
>
> Scott
>


-- 
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/
University of Washington
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210119/f4ad8118/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mOptEstimatorEfficiency.lyx
Type: application/lyx
Size: 9703 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210119/f4ad8118/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mOptEstimatorEfficiency.pdf
Type: application/pdf
Size: 127405 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210119/f4ad8118/attachment-0001.pdf>


More information about the lyx-devel mailing list