[R] How to draw a big heatmap?

2009-12-04 Thread Ning Ma
Hi everyone. How can I draw a big heatmaps? png(foo.png,1,1) heatmap(x) dev.off() where x is a big matrix, say 200*200. The code above generates a small heatmap in the middle of the png file and leaves big margins. I expect it to take up more space so that the labels are not

[R] turn off function output

2009-11-04 Thread Ning Ma
Hi, everybody Is there any way to turn off the output message of a function, maybe a result of cat() or print() command in that function. I only expected it to be executed quite and return a value. Any intermediate messages can be omitted. Thanks! Ma

[R] How to execute a funcition which name is stored in a string?

2009-11-01 Thread Ning Ma
Hi, everybody Is there any way to execute a function, which name is stored in a string. such as: a - ls() foo(a) ## same as ls() itself. Or, to execute a R command, which is stored in a string such as: a - m1 - matrix(1:9,3,3) foo(a) ## same as the assignment itself

[R] how to control the white space between sub figures

2009-10-24 Thread Ning Ma
Hi everybody, I use par(mfrow=c(2,2)) to draw 4 sub figures. The default white space between columns is a litte large. Is there any parameters to control it? Thanks in advance! Ma __ R-help@r-project.org mailing list

[R] text on a plot

2009-10-06 Thread Ning Ma
Hi, How can I put text in a figure which is not parallel to the axes,such as along the line x=2y. It seems that the function 'text' does not have such parameters. thanks in advance Ma __ R-help@r-project.org mailing list

[R] how to generate a random correlation matrix with restrictions

2009-08-28 Thread Ning Ma
Hi, How can I generate a random 100x100 correlation matrix, R={r_ij}, where about 10% of r_ij are greater than 0.9 Thanks in advance. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] how to index a list with a string?

2009-08-26 Thread Ning Ma
Hi, everybody. I have a list obj L, sth like $`aaa` [1] 5753 if the string 'aaa' is a returned value of a function foo(). what is the right syntax form of L$foo() I'm new to R, thanks in advance. __ R-help@r-project.org mailing list

[R] poly regression

2009-06-09 Thread Ning Ma
hi, I want to do a polynomial regression of y on x of degree 2, as following x-1:10 y-x^2 lm(y~poly(x,2)) Call: lm(formula = y ~ poly(x, 2)) Coefficients: (Intercept) poly(x, 2)1 poly(x, 2)2 38.5099.9122.98 Which is not what i had expected. If I wrote the

[R] evaluate a expression

2009-05-02 Thread Ning Ma
Hi, I am new to R. Can anyone tell me how to evaluate an expression stored in a string? such as: expr - 3*5 I want to get the result 15. Thanks in advance. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] evaluate a expression

2009-05-02 Thread Ning Ma
Thank you and Sunder! On Sat, May 2, 2009 at 8:49 PM, ronggui ronggui.hu...@gmail.com wrote: eval(parse(text=expr)) [1] 15 2009/5/2 Ning Ma pnin...@gmail.com: Hi, I am new to R. Can anyone tell me how to evaluate an expression stored in a string? such as: expr - 3*5 I want to get