2010-02-09

LyX and Sweave with R on Windows XP or Vista

Jeff Laake contributed instructions on how to setup LyX to work with Sweave on Windows XP or Vista so that others might benefit. I did not read the instructions thorougly! He expanded the work of Murat. As far as I understand, in comparison to my approach they avoid the need for unix shell, which is nice!

P.S. (2010-04-01) See also LyX Wiki


2010-02-08

LyX-Sweave - use of Ctrl+Enter

Yihui writes:
I have been wondering if it is possible to use Enter instead of Ctrl+Enter in the Sweave code chunk in LyX. It is not quite convenient to press Ctrl+Enter, what's more, we are not able to copy R code and paste it into LyX from other editors (vice versa). I see we are allowed to use a single carriage return in LaTeX code embedded in LyX. Why must Sweave code use Ctrl+Enter? Thanks!
My reply:
LyX prohibits the use of enter key for anything else than starting a new paragraph - this is default behaviour which is great for writing, but notorious for using Sweave with LyX. When you press enter you get a new paragraph, which would start a new chunk of code or is it new paragraph with default style - I do not remember the details at the moment. I agree that this is far from handy, but I was not able to find a solution for this. However, as you mention, it is possible to use ERT LaTeX boxes, to overcome this.

2010-01-29

LyX-Sweave on Ubuntu (Karmic)

Bret Collier sends the following install instructions for LyX-Sweave combination that worked for him on his Ubuntu (Karmic) setup.



Nothing was wrong with your instructions at http://www.bioconductor.org/CRAN/contrib/extra/lyx under install from what I can tell (other than where I put noweb.sty).

Here are the install steps I used (which basically follow the ones you provide on CRAN but I tried to list exactly what I did) to install Lyx 1.6.4 on my Linux Ubuntu Karmic Dual Core 32bit laptop with R v2.10.1 (2009-12-14). Note there are some minor differences with my install routine and what I found at- http://blog.nextbiomotif.com/2009/10/primer-to-sweave-with-lyx.html. Location of Sweave.sty is different.


1: I used Synaptic package manager to install Lyx and LaTex (tex-live). I updated R using sudo apt-get install and sudo apt-get install r-base before anything else.

2. Find the so-called LyX user directory or LyX library directory via the Help -> About LyX menu within LyX (mine was /usr/share/lyx/)

3. Save the 'preferences' file from CRAN (I saved unedited) into- /usr/share/lyx/

4. I saved all the literate-*.* files from CRAN to the layouts sub-directory of the Lyx user directory- /usr/share/lyx/layouts/

5. I put noweb.sty into- /usr/share/texmf/tex/latex/

6. I put Sweave.sty into- /usr/share/texmf/

7. I put any other .sty into- /usr/share/texmf/tex/latex/

8. I used texhash (or sudo texhash) to make sure all the .sty are located.

9. I made sure R was in the path (opened Terminal and typed in "R")

10. I used sudo lyx to open Lyx, then I went Tools->Reconfigure, got the reconfigure successful window, then I closed Lyx

11: Then I opened Lyx and everything was working on the Lyx end.

2010-01-21

R AnalyticFlow

R AnalyticFlow seems to be a nice tool to have a good overview over the analysis. The same kind of mode is available in Orange and SAS Enterprise Guide. I have not tried it yet, though. Does anyone have any experiences with it?

Update on 2010-07-31: there is also Red-R, which is a "sort of mixture" of R and Orange.




2009-12-13

Galton's quincunx in R

Andrej Blejec has a very nice R demo of Galton's quincunx (link1, link2). It is a bit tedious to copy the code from PDF to R console, but it is worth the effort as the demo simulation clearly shows the nature of quincunx. After a bit of search I also found a similar function quincunx in the animation R package by Yihui Xi.


Image source: Wolfram MathWorld

2009-11-20

Components of genetic improvement

I caught a quote (by Blasco) at the ACTEON maling list: "The genetic improvement applied is 15% science and 85% sociology." - translated by Google

2009-11-16

Phenotype MicroArrays - building the hierarchy in biology

I got an e-mail in my box about the presentation of Phenotype MicroArrays (PM) at our department. I will not be able to attend it, but this site describes the idea behind it. This "tool" is a nice addition to a set of DNA/RNA and protein arrays. Adding PM means that we can move one layer above the gene-protein layer. However, as my interest often lies in ultimate phenotype of an individual that we observe, we are still some layers far from deciphering the role of genes on the ultimate phenotype.



Source: http://www.biolog.com

2009-11-15

Slick correlation "plots"

Slick correlation "plots" in Wikipedia entry for correlation. I just wonder if correlation should really be zero for the (3,2)-th case. I woukd say it should be slightly more than zero.

2009-11-12

Sweave-Lyx from terminal on Mac

Mark Heckmann writes:
In your paper "Using Sweave with Lyx" (great work bty) you pointed out that one can see the sweave error code when processing when starting lyx from the terminal. I just changed from Windows to Mac so that's new for me. Could you send me a few lines how to do that, that is how to operate lyx from terminal and sweave the content from the terminal.
I am not familiar with Mac, though would be happy to own one;) Since Mac OS is build on top of some linux/unix like system you need to start the terminal (console) with shell and find the lyx binary. Perhaps something like this on my linux box (text following $ are shell commands)

# Find the lyx binary
$ which lyx
/usr/bin/lyx

# Start lyx from console
$ lyx&