[R] break up a string into strings with a fixed length

2009-10-02 Thread J Chen
dear all, I have some very long strings and would like to break up each long string into multiple strings with a fixed length, e.g. to break up abcdefghijkl into abc, def, ghi, jkl I tried a couple of commands but was not successful. Any help will be appreciated. Best, Jimmy -- View this

[R] {Lattice} cloud() help

2009-12-09 Thread J Chen
Dear all, I'm a lattice graphics newbie. I'm trying to make a cut through the 3D scatterplot with cloud(), so adding a partially transparent plate perpendicular to the z-axis in order to separate the cloud. code: library(lattice) cloud(Sepal.Width~Petal.Length*Petal.Width, data=iris) Could

[R] how to load only lines that start with a particular symbol

2009-09-15 Thread J Chen
Dear all, I have DNA sequence data which are fasta-formatted as gene A;. A T CCCTT gene B; C G I want to load only the lines that start with where the annotation information for the gene is contained. In principle, I can remove the sequences before

Re: [R] Rounding to the nearest 5

2009-09-15 Thread J Chen
hope this will help for (i in 1:10) { if (i%%52) { print((i%/%5+1)*5) } else { print((i%/%5)*5) } } Jimmy Chris Li wrote: Hi all, I want to round my values to the nearest 5. For example, if I have a value of 11, I want R to round it to 10. I have been

[R] Truncated plot in the output file

2009-09-20 Thread J Chen
Dear all, I made a large plot and wanted to save it as a tif file. I first opened and specified the size of the window. windows(12,17,rescale=fixed) Then I plot a heatmap using heatmap() when I saved the plot by using Save as in the file menu or savePlot(heatmap, type=tif), the plot in the