[R] problems when installing R in Fedora core 4

2005-08-18 Thread Peter Yang
Hi, I got a problem when installing R in Fedora core 4. When I ran .configure, it gave the following error message: configure: error: --with-x=yes (default) and X11 headers/libs are not available Could anyone tell me what's wrong? Am I missing some package in Fedora? Thanks a lot for your help.

[R] how to use the function from another package

2005-08-09 Thread Peter Yang
Hi, I am trying to write a package(A) for myself and need to use a function from another package(B) which is in R already(need to install it before use). Could anyone tell me how to implement that? Also I hope that my package gives an ERROR message(something like STOP, please install package B

[R] coefficient of polynomial expansion

2005-08-08 Thread Peter Yang
Hi, I would like to get the coefficient of polynomial expansion. For example, (1+ x)^2 = 1 + 2x + x^2, and the coefficients are 1, 2 and 1. (1 + x + x^2)^3 = 1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6, and the coefficients are 1, 3, 6, 7, 6, 3, and 1. I know that we can use polynom library.

[R] How to simulate quadratic phase couplilng

2005-01-31 Thread Peter Yang
Hi, I need to simulate the following two time series, 1. X=cos(omega1*t+phi1)+cos(omega2*t+phi2)+cos(omega3+phi3) 2. Y=cos(omega1*t+phi1)+cos(omega2*t+phi2)+cos(omega3+phi1+phi2) where omega3=omega1+omega2 and phi1, phi2, phi3 are independent uniform random variables from 0 to 2pi. Question 1:

[R] how can I get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3

2004-12-03 Thread Peter Yang
Hi, I would like to get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3. The result should be 1, 3, 6, 7, 6, 3, 1; How can I calculate in R? You help will be greatly appreciated. Peter [[alternative HTML version deleted]]

[R] How to plot a 3D picture

2004-11-29 Thread Peter Yang
Hi, Suppose I have a 4 by 4 matrix as following: 10 6 3 1 8 4 3 2 6 2 4 3 9 3 4 2 The x axis is the column index of the matrix, the y axis is the row index of the matrix and the z axis is the value in the corresponding position of the matrix. I tried to use contour and