giovedì 24 maggio 2007

What I want to be able to do is to place text on a background of arbitrary(but known RGB) colour so that the text is legible.I guess that this is better described as a "contrasting" than a "complementary" colour.Since luminance contrasts are necessary and sufficient for readable text,you could use white for dark colors and black for light colors.Luminance is roughly proportional to 0.2*(R^2.4)+0.6*(G^2.4),suggesting something like

lightdark rgb L ifelse(L >= 0.2, "#000060", "#FFFFA0")}

This uses a pale yellow for dark backgrounds and a dark blue for lightbackgrounds, and it seems to work reasonably well.

sabato 19 maggio 2007

The output file lists the commands from the script file and their outputs. If no outfile is specified, the name used is that of 'infile' and '.Rout' is appended to outfile. To stop all the usual R command line information from being written to the outfile, add this as first line to my_script.R file: 'options(echo=FALSE)'. If the command is run like this 'R CMD BATCH --no-save my_script.R', then nothing will be saved in the .Rdata file which can get often very large. More on this can be found on the help pages: '$ R CMD BATCH --help' or '> ?BATCH'.

This script doesn't need to have executable permissons. Use the following 'qsub' command to send this shell script to the Linux cluster from the directory where the R script 'my_script.R' is located. To utilize several CPUs on the Linux cluster, one can divide the input data into several smaller subsets and execute for each subset a separate process from a dedicated directory.