So then the problem isn't with inefficient matrix computations but with the language itself. On that I can wholehearted agree. I would say though, IMHO Matlab isn't much better, and in fact can be much much worse. I tend to try to avoid R but it is a very powerful language once you get the basics. What you might consider doing is dealing with data frames and then converting into matrices. R is essentially a data frame language with some stuff stapled on the side, like python is a dictionary language with some stuff stapled on the side. Matlab is strange with most variables being fully scoped and that drives me crazy. Honestly, in the long run you will get many benefits with R that you won't get with Matlab. I recommend picking it up. Also, I wouldn't expect any proprietary software to be compatible with lyx. That sort of development is very difficult.
What I would recommend doing is using whatever language you want and saving whatever it is as a CSV. From there, I would write a script which will automatically spit out the middle part of a table. Something along the lines of Header 1 & 1 & 2 & 3 \\ & (1) & (2) & (3) \\ Header 2 & 1 & 2 & 3 \\ & (1) & (2) & (3) \\ etc. Then all that is required for you to do is start the tabular environment: \begin{tabular}{l>m{.25cm}...} <Your output here> \end{tabular} The hardest part that lyx and most automated table generators have (including and especially R and Stata) is the header which defines how your table should look and feel. If your table is long, it should use longtable. If you want table notes, you need to use three part table. Do you want it to look nice and want full control over line widths and line placement? Use booktabs. These are highly context dependent and really up to the end user, making them very difficult to automate leaving someone like you and me with the requirement to learn how to typeset tables manually. Look at booktabs and threeparttable for guides. Making a good table takes a very long time and requires you to become good with typesetting. Choosing to read in a CSV and export a latex table middle will allow you to use quite literally whatever software you want, as long as it can produce a CSV. Actually, if it would help, I might be able to whip up a script sometime soon in python. It will not be the most robust script in the whole of scripting, but should at least be usable. I don't really deal with lyx/python interactions as I prefer to leave the two separate. Perhaps though, with the script, it might not be so bad and something worth considering. ~Ben On Sun, Jan 25, 2015 at 4:38 PM, Francesco Menoncin < francesco.menon...@unibs.it> wrote: > Hello Benedict, > thank you for your answer. > I give you an example about how R is difficult for dealing with matrices: > if in Matlab (or Scilab or Octave or simila) I write: > > x(2,2)=10 > > the following matrix is automatically created: > > [0 0 > 0 2] > > while in R > > x[2,2]=10 > > gives an error because I first have to declare to R that x is a matrix > and, furthermore, give it the right dimension. > If, afterward, I want to add an element to the matrix x, in Matlab I > simply write: > > x(3,1)=5 > > and I obtain the matrix: > > [0 0 > 0 10 > 5 0] > > while in R I cannot do that, because x has already been defined as a 2 by > 2 matrix. > I find all this very inefficient for dealig with matrices. > This is my point :-) > > Francesco > > Il 25/01/2015 22:25, Benedict Holland ha scritto: > > R is not so easy to use for big matrix computations? This is a first for > me. R is extremely efficient at dealing with matrices. If you have huge > matrices, I don't think it would perform much better than anything else. If > you need sparse matrix functionality, R comes with it built in. Python is > actually horrible for mathematical computations since it basically runs > everything in FORTRAN and C. The overhead to manipulate the data to call > these libraries is enormous. R might actually be doing the same. Matlab > does this as well. > > Honestly, what I have found is that printing tables and results is best > done by manually coding latex using booktabs and three part table. It isn't > that hard to do either. Write your results as a CSV and if you are good at > scripting, just separate the csv from the data frame into rows. Add a > header and you are good to go. This way, any time you have a CSV, you can > easily get it into tabular format and all you have to do is specify the > header and footer, something that is notoriously difficult to automate. > Trust me, I have tried a dozen or more times and it never just works. > > ~Ben > > On Sun, Jan 25, 2015 at 3:35 PM, Steve Burnham <dan...@gmail.com> wrote: > >> There is a package on CTAN called pythontex that allows you to run >> python from within a document. I know LyX heavily relies on Python as well >> and I think I have seen mention of people using python code in their >> documents. I used to use Matlab for data processing but have completely >> switched over to python so I’m pretty sure you could do everything you want >> to do in python. >> >> >> -Steve >> >> On January 25, 2015 at 7:00:05 AM, Francesco Menoncin ( >> francesco.menon...@unibs.it) wrote: >> >> Dear LyXers, >> I use and I like very much the package Knitr for executing R commands in >> LyX. Nevertheless, R is not so easy to use for big matrix computation. I >> wonder whether there exists a project similar to Knitr but allowing to >> code in LyX in other languages like Scilab, or Octave, or Matlab. >> >> Thank you >> >> Francesco >> >> -- >> --- >> Francesco Menoncin >> Associate Professor >> University of Brescia >> Department of Economics and Management >> E-mail: francesco.menon...@unibs.it >> Tel. 0039-0302988806 >> Fax. 0039-0302988836 >> https://sites.google.com/site/francescomenoncin/ >> http://www.eco.unibs.it/~menoncin/ >> >> >> -- >> Informativa sulla Privacy: http://www.unibs.it/node/8155 >> >> > > -- > --- > Francesco Menoncin > Associate Professor > University of Brescia > Department of Economics and Management > E-mail: francesco.menon...@unibs.it > Tel. 0039-0302988806 > Fax. > 0039-0302988836https://sites.google.com/site/francescomenoncin/http://www.eco.unibs.it/~menoncin/ > > > Informativa sulla Privacy: http://www.unibs.it/node/8155 >