Re: [R] logging messages

2004-11-16 Thread Prof Brian Ripley
On Mon, 15 Nov 2004, Faber Fedor wrote:
Hi all,
I'm trying to learn R from an non-statistician's POV. I've got a
statistician who uses R, but I'm the schmuck who has to integrate his
R functions into an automated process.
Defining a POV (undefined, as is `schmuck') as `not something' is really 
non-communication.  Please do read the R posting guide and its references, 
and try to formulate questions in standard (and polite) English.  Also, 
check the correct list to use as described in that posting guide -- R-help 
is not intended for questions involving programming concepts (like 
`syslog', which needs explanation even there).

One of the things I would really like is the ability to log messages
to file, specifically using syslog on a Linux box.  (I also want to
write messages to STDOUT based on a command-line flag, but I figure
that can't be too hard to figure out. If it is too hard to figure out,
you'll be seeing another message from me shortly. :-)
It's not clear what you mean by this.  If you mean send warnings and 
messages to stdout (what is `STDOUT'?) then `why?'  You deal with this the 
same way as any other Linux application that uses stderr for warning/error 
messages.

To `tee' output, see ?sink, or indeed `man tee'.
R is principally an interactive program used for exploration.  You haven't 
told us what you are trying to do, and you may be better off embedding R 
in some other front end to give you more control.

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Pairwise Distances -- How to vectorize the loop

2004-11-16 Thread Petr Pikal
Hi

From what you write it seems to me a work for outer(). Did you 
try it?

Cheers
Petr


On 15 Nov 2004 at 22:26, Timothy W. Victor wrote:

 R-List,
 
 I'm trying to compute pairwise distances among pairs of observations,
 which each pair containing data from 2 groups. There are more than
 10 unique pairs. I have programmed a distance function that has
 three parameters, a vector of covariates from the ith observation in
 Group 1, a vector of covarites from the jth observation in Group 2,
 and a weighting matrix.
 
 I have used expand.grid to create a matrix containing all possible
 pairs of Keys (unique identifiers) from Group 1 and Group 2 and a
 placeholder for each pairwise distance in an effort to pre-allocate
 memory.
 
 The data containing the covariates are currently in a matrix that
 looks like:
 
 x1 x2 x3 ... xn Key Group
 
 where x1,...,xn are the covariates of interest. The Key values 
 correspond to the row number.
 
 I'm trying to figure out a way to calculate all of the distances by
 vectorizing a loop. I'm trying to avoid the nested-loop paradigm. I'm
 sure I'm missing something quite obvious.
 
 Any insights would be appreciated.
 
 Best,
 
 Tim
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

Petr Pikal
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Adding mean and SEM in Hmisc ecdf

2004-11-16 Thread Jean-Louis Abitbol
Dear R Gurus,

Sorry if this has been asked before but I did not find it in the
archives.

I would like to add a horizontal display of mean and SEM on Hmisc ecdf
plots done by group (ie variate~treatment).

Has anyone written some code to do that ?

Thanks and kind regards,

Jean-Louis

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how can draw probability density plot?

2004-11-16 Thread Ales Ziberna
I hope this is the direct operation you are looking for:

 curve(dnorm(x),from=-3,to=3)

Best regards,

Ales Ziberna

- Original Message - 
From: LONG Yu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 15, 2004 1:26 PM
Subject: [R] how can draw probability density plot?


Dear support,

I want to draw a probability density plot in R. For example, I provide the 
mean and variance of a normal distribution, then R can provide me the 
probability density plot. Now I always generate random numbers of normal 
distribution and calculate their dnorm(mu, var), finally plot them. I am 
eager to know some directly operation.

Thank you for your attention.

I am looking forward to hearing from you soon.



Best regards,

Long Yu







__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] question about AIC

2004-11-16 Thread dlavecchia
Hi everybody,
we are a pool of phd students and we have a question about AIC. We are 
interested
in calculating the AIC for a mixture model on galaxies data. So far we have
found AIC works only for regression models, whereas we need AIC for a mixture
of Normal with mean, sd and weights given by our  EM algorithm.
May you help us?
thanks in advance


__
Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.
http://abbonati.tiscali.it/adsl/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] From S-Plus to R?

2004-11-16 Thread Isabelle Braud
Dear collegues,
I am using S-Plus for many years and is thinking of moving to R.
In the FAQ I did not manage to find an answer to the following questions:
Is it easy to move and transform functions, written under S-plus to 
functions under R?

Furthermore, S-Plus has interesting functions to deal with regular and 
irregular times series (rts, its, ts.plot, ts.lines, ts.points, 
aggregate.rts, etc..) and the possibility to plot, on the same graphic, 
regular time series with different frequencies and even irregular time 
series. Is it still possible in R?

Thanks in advance for your answers.
Best wishes
Isabelle Braud
***
Isabelle BRAUD
Chargée de recherche au LTHE-Grenoble/CEMAGREF-Lyon
CEMAGREF
Unité de Recherche Hydrologie-Hydraulique
3 bis, Quai Chauveau, CP 220
69336 Lyon Cedex 9
Tel: 04 72 20 87 78 (from abroad 33 4 72 20 87 78)
Fax: 04 78 47 78 75 (from abroad 33 4 78 47 78 75)
E-mail: [EMAIL PROTECTED]
   ou [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multivariate Sampling

2004-11-16 Thread stefan . albrecht





Dear Ales,

I have found a matlab routine which does latin hypercube sampling
with random distributions. It seem to be quite straightforward to
transform it to R. If you or anybody else is interested - and it
works - I am happy to send the R version to him. The method is from
Iman and Conover and allows inducing rank correlation among input
variables, like you can do with @Risk, e.g. quite easily.

Many thanks and best regards,
Stefan





I do not belive (although I am not an expert) that such a pacake
exist in R.
You might try sampling first one variable and then the other
conditional on
the previous one?

I hope it helps;
Ales Ziberna

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 15, 2004 4:49 PM
Subject: [R] Multivariate Sampling






Dear all,

I am looking for routines which allow multi-variate sampling from
non-normal distributions (loglogistic) given correlations among the
variables.
Unfortunately, I could not find a suitable package for R. Does
anybody know one?

Many thanks and best regards,
Stefan Albrecht
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] question about AIC

2004-11-16 Thread Prof Brian Ripley
On Tue, 16 Nov 2004 [EMAIL PROTECTED] wrote:
we are a pool of phd students and we have a question about AIC. We are 
interested
in calculating the AIC for a mixture model on galaxies data. So far we have
found AIC works only for regression models, whereas we need AIC for a mixture
of Normal with mean, sd and weights given by our  EM algorithm.
What is the problem?  The concept AIC or the function AIC()?  If the 
concept, it was originally developed in the area of AR(p) time series 
models, using asymptotic theory for MLEs, and you need to check that the 
concepts apply to your situation (the original papers do not).

Note there are some fundamental problems here: the likelihood for a 
mixture of normals is unbounded, the MLE corresponding to degenerate 
(zero-variance) components.  And AIC is about maximized likelihoods, with 
maxima in the interior of the space.  So you need to take some 
professional statistical advice about the concepts.

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] question about AIC

2004-11-16 Thread Dimitris Rizopoulos
did you try google? e.g., with key word: `AIC mixture models'. 
Moreover, look at package `flexmix' (i.e., help(package=flexmix)) 
whose usage is illustrated in a recent article in JSS:

http://www.jstatsoft.org/v11/i08/v11i08.pdf
I hope it helps.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 10:12 AM
Subject: [R] question about AIC


Hi everybody,
we are a pool of phd students and we have a question about AIC. We 
are interested
in calculating the AIC for a mixture model on galaxies data. So far 
we have
found AIC works only for regression models, whereas we need AIC for 
a mixture
of Normal with mean, sd and weights given by our  EM algorithm.
May you help us?
thanks in advance

__
Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
navighi gratis fino al 31 dicembre 2004 e non paghi il costo di 
adesione.
http://abbonati.tiscali.it/adsl/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] From S-Plus to R

2004-11-16 Thread stefan . albrecht





Dear Isabelle,

for most of my work I have switched from S-Plus to R, because it is
easier to make scripts with due to the better documentation and some
other more reasonable implementations. And there was also a cost
issue with the S-Plus Server, which is not for free at all.
In R I use the its package for time series, which is quite sufficient
for my needs. The only problem I encountered was with computing time.
So I use R  matrixes as long as possible and not the its (S4)
objects, since this makes some commands very slow (like union).
There are also other packages like zoo, tsseries (I guess) and
certainly Rmetrics, which should have all you need

Most functions transform directely and easily. Among others, I missed
the numRows() and numCols() etc in R, but this can be redone quickly.

One big advantage of S-Plus is the possibility to edit graphics and
to make Powerpoints presentations very quickly. Also the Excel
interface is already build  in. In R you must always programm to
whole picture, which is ok if you are doing the same task often.

Best regards,
Stefan

---
Dr. Stefan Albrecht, CFA
Allianz Private Equity Partners GmbH
Giselastrasse 4
D-80802 Munich, Germany
Phone +49.89.38 00 - 18 317
Fax +49.89.38 00 - 818 317


Dear collegues,

I am using S-Plus for many years and is thinking of moving to R.
In the FAQ I did not manage to find an answer to the following
questions:
Is it easy to move and transform functions, written under S-plus to
functions under R?

Furthermore, S-Plus has interesting functions to deal with regular
and
irregular times series (rts, its, ts.plot, ts.lines, ts.points,
aggregate.rts, etc..) and the possibility to plot, on the same
graphic,
regular time series with different frequencies and even irregular
time
series. Is it still possible in R?

Thanks in advance for your answers.
Best wishes
Isabelle Braud
***
Isabelle BRAUD
Chargée de recherche au LTHE-Grenoble/CEMAGREF-Lyon

CEMAGREF
Unité de Recherche Hydrologie-Hydraulique
3 bis, Quai Chauveau, CP 220
69336 Lyon Cedex 9

Tel: 04 72 20 87 78 (from abroad 33 4 72 20 87 78)
Fax: 04 78 47 78 75 (from abroad 33 4 78 47 78 75)
E-mail: braud at lyon.cemagref.fr
ou Isabelle.Braud at hmg.inpg.fr
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] UML programming

2004-11-16 Thread wayne
hello,
I'd like to know if it is possible to use R in a UML way by creating classes, 
methods,etc...
If yes, can you please give me links for documentation and example ?

thanks

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] question about AIC

2004-11-16 Thread max.marinucci
I would also mention the mixreg package on CRAN.
Regards
m.

**
Massimiliano Marinucci
http://personales.ya.com/max_mar/
Ph.D Candidate in Economics
Fundamentos del Analisis Económico II
(Economía Cuantitativa)
Facultad de CC.EE.
Universidad Complutense Madrid
Campus de Somosaguas
Madrid - Spain
**

- Original Message -
From: Dimitris Rizopoulos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 10:35 AM
Subject: Re: [R] question about AIC


 did you try google? e.g., with key word: `AIC mixture models'.
 Moreover, look at package `flexmix' (i.e., help(package=flexmix))
 whose usage is illustrated in a recent article in JSS:

 http://www.jstatsoft.org/v11/i08/v11i08.pdf

 I hope it helps.

 Best,
 Dimitris

 
 Dimitris Rizopoulos
 Ph.D. Student
 Biostatistical Centre
 School of Public Health
 Catholic University of Leuven

 Address: Kapucijnenvoer 35, Leuven, Belgium
 Tel: +32/16/396887
 Fax: +32/16/337015
 Web: http://www.med.kuleuven.ac.be/biostat
  http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, November 16, 2004 10:12 AM
 Subject: [R] question about AIC


  Hi everybody,
  we are a pool of phd students and we have a question about AIC. We
  are interested
  in calculating the AIC for a mixture model on galaxies data. So far
  we have
  found AIC works only for regression models, whereas we need AIC for
  a mixture
  of Normal with mean, sd and weights given by our  EM algorithm.
  May you help us?
  thanks in advance
 
 
  __
  Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
  Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
  Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
  navighi gratis fino al 31 dicembre 2004 e non paghi il costo di
  adesione.
  http://abbonati.tiscali.it/adsl/
 
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
 

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] UML programming

2004-11-16 Thread A.J. Rossini
Sure, you could do it in a UML way.  But I know of no tools yet that
will, and more importantly, the object-orientation style (generic
functions, i.e. similar to CLOS) isn't the easiest to use in that way.


On Tue, 16 Nov 2004 11:03:28 +0100, wayne [EMAIL PROTECTED] wrote:
 hello,
 I'd like to know if it is possible to use R in a UML way by creating classes, 
 methods,etc...
 If yes, can you please give me links for documentation and example ?
 
 thanks
 
 Accdez au courrier lectronique de La Poste : www.laposte.net ;
 3615 LAPOSTENET (0,34/mn) ; tl : 08 92 68 13 50 (0,34/mn)
 
[[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


-- 

best,
-tony

---
A.J. Rossini
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to remove x, y labels from a plot

2004-11-16 Thread francoisromain
try :

plot(rnorm(20),rnorm(20),axes=F,xlab=,ylab=)


Selon [EMAIL PROTECTED]:

 Hi there,



 I need to plot an illustrative figure without ticks, x, y labels in R. I
 managed to get the ticks removed, but had no luck with x, y labels.



 Any suggestions would be much appreciated.



 Jin Li




   [[alternative HTML version deleted]]

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to remove x, y labels from a plot

2004-11-16 Thread Arne Henningsen
Hi Jin Li,

does
   plot( 1:100, rnorm(100), ann=FALSE, xaxt=n, yaxt=n )
produce what you want?

Arne


On Tuesday 16 November 2004 13:06, [EMAIL PROTECTED] wrote:
 Hi there,



 I need to plot an illustrative figure without ticks, x, y labels in R. I
 managed to get the ticks removed, but had no luck with x, y labels.



 Any suggestions would be much appreciated.



 Jin Li




   [[alternative HTML version deleted]]

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Barplot difficulties

2004-11-16 Thread Frank E Harrell Jr
Heather J. Branton wrote:
Hello. I am an R newbie struggling to learn and use R . I have read many 
portions of the R Reference Manual, as well as the FAQs. Given that I 
learn something new each time, I know I might be missing something 
obvious. But I appeal to your good nature to help me through this 
initial problem.

I have attached a pdf file to demonstrate what I desire and have listed 
what my data looks like in Excel (below). Following is the data and 
script I developed - which does not provide what I want.

Dear Heather - Please read Bill Cleveland's book The Elements of 
Graphing Data.  A MUCH better plot can be produced.  And let time be one 
of the first variables to vary.


--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Adding mean and SEM in Hmisc ecdf

2004-11-16 Thread Frank E Harrell Jr
Jean-Louis Abitbol wrote:
Dear R Gurus,
Sorry if this has been asked before but I did not find it in the
archives.
I would like to add a horizontal display of mean and SEM on Hmisc ecdf
plots done by group (ie variate~treatment).
Has anyone written some code to do that ?
Thanks and kind regards,
Jean-Louis
It is customary to show quantiles on ecdfs, and the functions make that 
easy.  You can add other points or reference lines to an existing plot 
easily if using the non-lattice ecdf.  To do it with the lattice version 
ecdf.formula you will have to change its default panel function.

--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] violinplot options

2004-11-16 Thread Tanja Zseby
Hi,
I am using the function  vioplot() to generate violin plots. Now I would 
like to add a label to the y axix and a title to the diagram.
Just setting ylab didnt work. Is it possible to set such options for the 
function ?
I tried also with the function simple.violinplot, but also with this I 
couldnt set the options.

Kind Regards
Tanja
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Simple plot() question

2004-11-16 Thread michael watson (IAH-C)
Hi

First a simple question to do with plot().  How do I change the x-axis
labels on a plot?

For example, I am plotting each row of a matrix, and I want each row to
be a line on my graph.  Simple really.  Eg:

plot(sg[1,], type=l)

When I do this, the x-axis is labelled 1:38, as I have 38 columns in my
matrix.  When I do:

plot(sg[1,order(sg[1,])], type=l)

Ideally I would like the x-axis labels to reflect the new order of the
columns, but they're still numbered 1:38... I've read the plot() docs
and the par() docs and can't figure it out - I know I'm missing
something obvious, but what?

Cheers

Mick

Michael Watson
Head of Informatics
Institute for Animal Health,
Compton Laboratory,
Compton,
Newbury,
Berkshire RG20 7NN
UK

Phone : +44 (0)1635 578411 ext. 2535
Mobile: +44 (0)7990 827831
E-mail: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Difference between two correlation matrices

2004-11-16 Thread michael watson (IAH-C)
Hi 

Now a more theoretical question.  I have two correlation matrices - one
of a set of variables under a particular condition, the other of the
same set of variables under a different condition.  Is there a
statistical test I can use to see if these correlation matrices are
different?

Thanks
Mick

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Simple plot() question

2004-11-16 Thread James W. MacDonald
michael watson (IAH-C) wrote:
Hi
First a simple question to do with plot().  How do I change the x-axis
labels on a plot?
For example, I am plotting each row of a matrix, and I want each row to
be a line on my graph.  Simple really.  Eg:
plot(sg[1,], type=l)
When I do this, the x-axis is labelled 1:38, as I have 38 columns in my
matrix.  When I do:
plot(sg[1,order(sg[1,])], type=l)
Ideally I would like the x-axis labels to reflect the new order of the
columns, but they're still numbered 1:38... I've read the plot() docs
and the par() docs and can't figure it out - I know I'm missing
something obvious, but what?
You want to add xaxt=n so the x-axis labels are not printed. Then add 
your new labels using axis(1, at=1:38, labels=some vector of label names)

HTH,
Jim

Cheers
Mick
Michael Watson
Head of Informatics
Institute for Animal Health,
Compton Laboratory,
Compton,
Newbury,
Berkshire RG20 7NN
UK
Phone : +44 (0)1635 578411 ext. 2535
Mobile: +44 (0)7990 827831
E-mail: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Simple plot() question

2004-11-16 Thread Dimitris Rizopoulos
try something like
plot(..., axes=FALSE)
axis(2); axis(1, labels=c(your labels))
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
- Original Message - 
From: michael watson (IAH-C) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 3:45 PM
Subject: [R] Simple plot() question


Hi
First a simple question to do with plot().  How do I change the 
x-axis
labels on a plot?

For example, I am plotting each row of a matrix, and I want each row 
to
be a line on my graph.  Simple really.  Eg:

plot(sg[1,], type=l)
When I do this, the x-axis is labelled 1:38, as I have 38 columns in 
my
matrix.  When I do:

plot(sg[1,order(sg[1,])], type=l)
Ideally I would like the x-axis labels to reflect the new order of 
the
columns, but they're still numbered 1:38... I've read the plot() 
docs
and the par() docs and can't figure it out - I know I'm missing
something obvious, but what?

Cheers
Mick
Michael Watson
Head of Informatics
Institute for Animal Health,
Compton Laboratory,
Compton,
Newbury,
Berkshire RG20 7NN
UK
Phone : +44 (0)1635 578411 ext. 2535
Mobile: +44 (0)7990 827831
E-mail: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Simple plot() question

2004-11-16 Thread Andy Bunn
Hi Mick:

I'm a little unsure if this is what you are after but does this do it?

foo.mat - matrix(rnorm(100), nrow = 10, ncol = 10)
plot(foo.mat[1,], type=l, xlab = Crud, ylab = More Crud)
plot(foo.mat[1,order(foo.mat[1,])], type=l, xaxt = n, xlab = Crud,
ylab = More Crud)
axis(1, at=1:length(foo.mat[1,]), labels= order(foo.mat[1,]))


Seems like a barplot might be a nice way to go too:
barplot(foo.mat[1,order(foo.mat[1,])], names.arg = order(foo.mat[1,]))


A reproducible example would help the list see what you are after as I might
be totally off on this.
HTH, Andy


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of michael watson
 (IAH-C)
 Sent: Tuesday, November 16, 2004 9:45 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Simple plot() question


 Hi

 First a simple question to do with plot().  How do I change the x-axis
 labels on a plot?

 For example, I am plotting each row of a matrix, and I want each row to
 be a line on my graph.  Simple really.  Eg:

 plot(sg[1,], type=l)

 When I do this, the x-axis is labelled 1:38, as I have 38 columns in my
 matrix.  When I do:

 plot(sg[1,order(sg[1,])], type=l)

 Ideally I would like the x-axis labels to reflect the new order of the
 columns, but they're still numbered 1:38... I've read the plot() docs
 and the par() docs and can't figure it out - I know I'm missing
 something obvious, but what?

 Cheers

 Mick

 Michael Watson
 Head of Informatics
 Institute for Animal Health,
 Compton Laboratory,
 Compton,
 Newbury,
 Berkshire RG20 7NN
 UK

 Phone : +44 (0)1635 578411 ext. 2535
 Mobile: +44 (0)7990 827831
 E-mail: [EMAIL PROTECTED]

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Difference between two correlation matrices

2004-11-16 Thread Marta Rufino
Hello,

I don't know if it is applicable in your case, but have you tried Mantel
test?
You can use it to determine significant correlation between two matrices,
using Pearsion, Spearman or Kendal correlation indices.

Hope it helps,
All the best,
Marta


- Original Message - 
From: michael watson (IAH-C) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 2:49 PM
Subject: [R] Difference between two correlation matrices


 Hi

 Now a more theoretical question.  I have two correlation matrices - one
 of a set of variables under a particular condition, the other of the
 same set of variables under a different condition.  Is there a
 statistical test I can use to see if these correlation matrices are
 different?

 Thanks
 Mick

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] deleting a file

2004-11-16 Thread Roger Gill
Dear all,

I have a very simple question.  Simple, that is, if you know the answer.

I wish to delete a file in a given directory after having first checked its
existence.  I issue the following commands

path-'c:example/R/'

Thus creating the directory.

indicator-length(grep(filename,path))

If indicator is greater than zero then the file exists.  Now I wish to
remove this file.  However, I would like to make the code compatible for
Linux/Windows and Macs.

In Linux I would issue the command

system('rm paste(path,'filename',sep='')')

and this works just fine.  It does not however work for windows, and I have
no idea whether it would work on a mac.

Is there a single command thay escapes me?

Best Wishes

Roger Gill

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] deleting a file

2004-11-16 Thread Jeff Gentry
 In Linux I would issue the command
 system('rm paste(path,'filename',sep='')')
 and this works just fine.  It does not however work for windows, and I have
 no idea whether it would work on a mac.
 Is there a single command thay escapes me?

Yes.

help(file.remove)

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] memory allocation

2004-11-16 Thread Massimiliano Copetti

Dear sirs,

I'm using the Splancs package to compute standard errors of the estimates of a 
spatio-temporal k function.
When I use as spatial and temporal distances too long vectors (respectively 60 
and 80 entries) for a dataset of 1000 observations, R gives me the message

Error: cannot allocate vector of size 18 Kb

Reached total allocation of 512 Mb.

I ran the function memory.size() and obtained 39200 more or less.

Can anyone help me? 

Thanks in advance.

Massimiliano Copetti



-- 
Massimiliano Copetti, PhD Student
Institute of Quantitative Methods
L.Bocconi University
Viale Isonzo 25
20135 Milano (Italy)
http://www.unibocconi.it
http://spazioinwind.libero.it/maxcop78

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] User package - Simple Ports

2004-11-16 Thread Keith J Sabol
R experts,

I created a package X for R 1.8 that I want to re-install for 2.0.1.  In
addition to downloading/installing Perl and Rtools as directed in the
README.packages file and ensuring that they appear in my path, I have
modified X's DESCRIPTION file to include all required fields.
Additionally I have deleted  the built line since the  make process
will add that.  The source contains no Fortran/C/C++ and resides in   .
R/rw2000/src/library

 

From .R/rw2000/src/gnuwin32  make X -X seems to run the make utility,
but the package is never installed.

 

In R 1.8  manually added the build line and copied the package directory
into the library tree and library(X) worked without a formal install (As
you would guess this was a work-around for my earlier and evidently
persistent lack of success in my package installation endeavors.).  The
same work-around approach seems not to work with 2.0.

 

Your suggestions are appreciated.

 

Thank you!

 

Keith Sabol


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] deleting a file

2004-11-16 Thread Roger D. Peng
You may be interested in one of dir.create(), file.exists(), or unlink().
-roger
Roger Gill wrote:
Dear all,
I have a very simple question.  Simple, that is, if you know the answer.
I wish to delete a file in a given directory after having first checked its
existence.  I issue the following commands
path-'c:example/R/'
Thus creating the directory.
indicator-length(grep(filename,path))
If indicator is greater than zero then the file exists.  Now I wish to
remove this file.  However, I would like to make the code compatible for
Linux/Windows and Macs.
In Linux I would issue the command
system('rm paste(path,'filename',sep='')')
and this works just fine.  It does not however work for windows, and I have
no idea whether it would work on a mac.
Is there a single command thay escapes me?
Best Wishes
Roger Gill
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Difference between two correlation matrices

2004-11-16 Thread Stephane DRAY
One solution is to use procruste analysis.
Perform a principal coordinate analysis on your data (cmdscale) to obtain 
two individuals by variables tables.
Then, you can perform procruste rotation and test to know if the two 
matrice tell the same thing. It is more powerful than mantel test.
As you have correlations, I suppose than you can consider your original 
variables rather than correlation and cmdscale


Functions are available in the ade4 package:
procuste(ade4)  Simple Procruste Rotation between two sets of
points
procuste.randtest(ade4)
Monte-Carlo Test on the sum of the singular
values of a procustean rotation (in C).
procuste.rtest(ade4)Monte-Carlo Test on the sum of the singular
values of a procustean rotation (in R).
A reference on the analysis:
http://www.steph280.freesurf.fr/files/articles/Ecosci2003.pdfS. Dray, D. 
Chessel, J. Thioulouse : Procrustean co-inertia analysis for the linking of 
ecological tables. 
Ecosciencehttp://www.steph280.freesurf.fr/files/articles/Ecosci2003.pdf, 
2003, vol. 10, 110-119.

available at :
http://www.steph280.freesurf.fr/files/articles/Ecosci2003.pdf
Hope this helps !

At 10:31 16/11/2004, Marta Rufino wrote:
Hello,
I don't know if it is applicable in your case, but have you tried Mantel
test?
You can use it to determine significant correlation between two matrices,
using Pearsion, Spearman or Kendal correlation indices.
Hope it helps,
All the best,
Marta
- Original Message -
From: michael watson (IAH-C) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 2:49 PM
Subject: [R] Difference between two correlation matrices
 Hi

 Now a more theoretical question.  I have two correlation matrices - one
 of a set of variables under a particular condition, the other of the
 same set of variables under a different condition.  Is there a
 statistical test I can use to see if these correlation matrices are
 different?

 Thanks
 Mick

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Stéphane DRAY
-- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
E-mail : [EMAIL PROTECTED]
-- 

Web  http://www.steph280.freesurf.fr/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Rggobi-color maps and colors

2004-11-16 Thread Aruna Buddana
Hello,
I was wondering if the function
get(set)ColorMap.ggobi() is working for anyone..
The function is not defined when I tried to work on it.
Also, I would really like to know, if I can increase the number of 
colors in any of the color scheme, if possible.
We only got 12 colors (maximum?) to look at the clusters, but what if I 
got as many as 25 clusters..
How do people look at many clusters?

Any help is appreciated.
Thank you
Sincerely
Aruna
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Fourier analysis

2004-11-16 Thread Marta Rufino
Dear colegues,

Is there any function in R for calculating the four coefficients of each
harmonic in fourier analysis, from a set of x,y coordinates is given? Is it
possible to do Fourier analysis?
Has anyone done contour analysis using R?

Any help wil be apretiated,

Thank you very much,
All the best,
Marta

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] memory allocation

2004-11-16 Thread Prof Brian Ripley
There is more to that message you have not reproduced.
I am pretty sure you are on Windows, and you need to read the rw-FAQ (as 
the posting guide asks you too).  See Q2.7.

On Tue, 16 Nov 2004, Massimiliano Copetti wrote:
I'm using the Splancs package to compute standard errors of the 
estimates of a spatio-temporal k function. When I use as spatial and 
temporal distances too long vectors (respectively 60 and 80 entries) for 
a dataset of 1000 observations, R gives me the message

Error: cannot allocate vector of size 18 Kb
Reached total allocation of 512 Mb.
I ran the function memory.size() and obtained 39200 more or less.
Yes, but see its help page for the relevant usage.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] deleting a file

2004-11-16 Thread Achim Zeileis
On Tue, 16 Nov 2004 15:43:12 - Roger Gill wrote:

 Dear all,
 
 I have a very simple question.  Simple, that is, if you know the
 answer.

Yes, look at
  ?file.remove
Z

 I wish to delete a file in a given directory after having first
 checked its existence.  I issue the following commands
 
 path-'c:example/R/'
 
 Thus creating the directory.
 
 indicator-length(grep(filename,path))
 
 If indicator is greater than zero then the file exists.  Now I wish to
 remove this file.  However, I would like to make the code compatible
 for Linux/Windows and Macs.
 
 In Linux I would issue the command
 
 system('rm paste(path,'filename',sep='')')
 
 and this works just fine.  It does not however work for windows, and I
 have no idea whether it would work on a mac.
 
 Is there a single command thay escapes me?
 
 Best Wishes
 
 Roger Gill
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Changing zeros to NAs in a data frame

2004-11-16 Thread Laura Holt
Dear R People:
I have a data frame with some columns that are numeric and some which are 
factors.

There are zeros in the numeric columns and I would like to change them to 
NAs.  However, there are zeros in some of the factor columns, and I would 
like them to be left alone.

Is there a global way to do this, please?  I was thinking about use the 
results from str but am not sure.

R Version 2.0.0 Windows.
Thanks in advance.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R 2.0.0 Installation Problem

2004-11-16 Thread David Rocke
I and my students have been having an odd problem with this release,
which is that packages are disappearing. After installation the
package is found with the library command, but later in the same
session or in a later session, the library command returns a not found
error. Then later it is back. Happening on both Windows and OS X,
mostly but not entirely with Bioconductor packages.

David


---
| David M. Rocke, Professor   Phone:  (530) 752-0510  |
| Division of Biostatistics (Medicine) and(530) 752-7368  |
| Department of Applied Science (Engineering) |
| Co-Director of IDAV FAX:(530) 752-8894  |
| University of California, Davis E-mail: [EMAIL PROTECTED] |
| Davis, CA 95616-8553 www.cipic.ucdavis.edu/~dmrocke |

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] changing character to a vector name

2004-11-16 Thread Laura Holt
Dear R People:
I would like to generate a vector/variable name from within a loop to be 
passed to a table
function.

This is what I have so far:
assign(p1,paste(raw3.df$,rw2$V1[3],sep=))
p1
[1] raw3.df$CITIZEN

Essentially, I want to use the raw3.df$CITIZEN along with another value to 
generate a table.

However, I'm stuck here.  I know this is incredibly stupid.
Thanks in advance.
Sincerely
Laura Holt
mailto: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R: Changing zeros to NAs in a data frame

2004-11-16 Thread Vito Ricci
Hi,

see this example. I hope I helped you a little bit.
Bye
Vito


dati
   X  YZ
1 10  0  0
2  0 20 60
3 30 40 50
4 11 12   3

 dati[dati==0]-NA
 dati

   X  YZ
1 10 NA  0
2 NA 20 60
3 30 40 50
4 11 12   3




=
Diventare costruttori di soluzioni
Became solutions' constructors

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese 
http://www.modugno.it/archivio/cat_palese.shtml

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] help on EM Algorithm for bivariate normal

2004-11-16 Thread p935460

Hi,
I woul like to know if it is possible to have a R code to generate EM
Algorithm for a normal bivariate mixture.
Best regard,
S.F.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Please help using SQL with R SQL Server

2004-11-16 Thread Bos, Roger
I cannot get a database connection in R to my MS SQL Server database.  In
S-Plus 6.2 I have used the following successfully:

rawdata - importData(type=DIRECT-SQL, user=xfl2,
password=xfl2, server=rinnycs0059, database=xf, table=,
sqlQuery=select * from testTbl)

In R I have tried both DBI and RSQLite, but have not had any luck.  It
always says cannot find driver.  All the examples use My SQL or some other
program.  I only have SQL Server by Microsoft.  I know R might not have a
native driver, but I have tried ODBC, too, without luck.  If anyone can
give me an example and hints on finding the driver that would be great!
Thanks.  Roger

** * This 
message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Changing zeros to NAs in a data frame

2004-11-16 Thread Sundar Dorai-Raj

Laura Holt wrote:
Dear R People:
I have a data frame with some columns that are numeric and some which 
are factors.

There are zeros in the numeric columns and I would like to change them 
to NAs.  However, there are zeros in some of the factor columns, and I 
would like them to be left alone.

Is there a global way to do this, please?  I was thinking about use 
the results from str but am not sure.

R Version 2.0.0 Windows.
Let x be your data.frame. Then use:
is.num - sapply(x, is.numeric)
x[is.num] - lapply(x[is.num], function(y) ifelse(y == 0, NA, y))
HTH,
--sundar
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] memory allocation

2004-11-16 Thread Roger Bivand
On Tue, 16 Nov 2004, Massimiliano Copetti wrote:

 
 Dear sirs,
 
 I'm using the Splancs package to compute standard errors of the
 estimates of a spatio-temporal k function. When I use as spatial and
 temporal distances too long vectors (respectively 60 and 80 entries) for
 a dataset of 1000 observations, R gives me the message

The memory demands arise in stvmat() called inside stsecal(), in which an 
(s*tm)*(s*tm) numeric matrix is allocated, described in the code as a 
full spacetime variance/covariance matrix, and which is necessarily 
large. In your case 2304 elements are used of 8 bytes each, so to do 
this in the way you describe you need more RAM - the matrix may be copied 
as well. The authors of the package and the underlying method did not 
anticipate needing this high degree of spatial and temporal resolution.

Roger Bivand

 
 Error: cannot allocate vector of size 18 Kb
 
 Reached total allocation of 512 Mb.
 
 I ran the function memory.size() and obtained 39200 more or less.
 
 Can anyone help me? 
 
 Thanks in advance.
 
 Massimiliano Copetti
 
 
 
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Changing zeros to NAs in a data frame

2004-11-16 Thread Andy Bunn
This isn't pretty but it's a way to do it:

foo - data.frame(x = c(1,0,1,1,0,2,4), y = as.factor(c(0,2,1,1,0,3,1)))
Zero2NA - function(x){
if(is.numeric(x)) { x[x == 0] - NA; }
return(x)
}
foo2 - as.data.frame(lapply(foo, Zero2NA))
foo
foo2

HTH, Andy


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Laura Holt
 Sent: Tuesday, November 16, 2004 11:31 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Changing zeros to NAs in a data frame


 Dear R People:

 I have a data frame with some columns that are numeric and some which are
 factors.

 There are zeros in the numeric columns and I would like to change them to
 NAs.  However, there are zeros in some of the factor columns, and I would
 like them to be left alone.

 Is there a global way to do this, please?  I was thinking about use the
 results from str but am not sure.

 R Version 2.0.0 Windows.

 Thanks in advance.
 Sincerely,
 Laura Holt
 mailto: [EMAIL PROTECTED]


 Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R help

2004-11-16 Thread gauri
Hi,
I was wondering as to how I could convert SPSS data imported to R into tabular 
form. In the sense, direct usage of read.table( ) doesnt help.
 
Thanks


-

 Meet the all-new My Yahoo! – Try it today! 
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Changing zeros to NAs in a data frame

2004-11-16 Thread Prof Brian Ripley
On Tue, 16 Nov 2004, Laura Holt wrote:
Dear R People:
I have a data frame with some columns that are numeric and some which are 
factors.

There are zeros in the numeric columns and I would like to change them to 
NAs.  However, there are zeros in some of the factor columns, and I would 
like them to be left alone.

Is there a global way to do this, please?  I was thinking about use the 
results from str but am not sure.
myDF - data.frame(a=0:4, b=letters[1:5], c=-2:2)
myDF[] - lapply(myDF, function(x) if(is.numeric(x)) {x[x==0] - NA; x} else x)
myDF
   a b  c
1 NA a -2
2  1 b -1
3  2 c NA
4  3 d  1
5  4 e  2
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] help on EM Algorithm for bivariate normal

2004-11-16 Thread max.marinucci
take a look at:

flexmix
mixreg
mclust

packages on CRAN

You may also define your own M-step in some of these packages...
EM is used to find the parameters of the mixture.
Ciao
M.


**
Massimiliano Marinucci
http://personales.ya.com/max_mar/
Ph.D Candidate in Economics
Fundamentos del Analisis Económico II
(Economía Cuantitativa)
Facultad de CC.EE.
Universidad Complutense Madrid
Campus de Somosaguas
Madrid - Spain
**
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 6:22 PM
Subject: [R] help on EM Algorithm for bivariate normal



 Hi,
 I woul like to know if it is possible to have a R code to generate EM
 Algorithm for a normal bivariate mixture.
 Best regard,
 S.F.

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] User package - Simple Ports

2004-11-16 Thread Liaw, Andy
If I'm not mistaken, I believe you need to do

make pkg-X

or

R CMD INSTALL X

Andy

 From: Keith J Sabol
 
 R experts,
 
 I created a package X for R 1.8 that I want to re-install for 
 2.0.1.  In
 addition to downloading/installing Perl and Rtools as directed in the
 README.packages file and ensuring that they appear in my path, I have
 modified X's DESCRIPTION file to include all required fields.
 Additionally I have deleted  the built line since the  make process
 will add that.  The source contains no Fortran/C/C++ and 
 resides in   .
 R/rw2000/src/library
 
  
 
 From .R/rw2000/src/gnuwin32  make X -X seems to run the 
 make utility,
 but the package is never installed.
 
  
 
 In R 1.8  manually added the build line and copied the 
 package directory
 into the library tree and library(X) worked without a formal 
 install (As
 you would guess this was a work-around for my earlier and evidently
 persistent lack of success in my package installation 
 endeavors.).  The
 same work-around approach seems not to work with 2.0.
 
  
 
 Your suggestions are appreciated.
 
  
 
 Thank you!
 
  
 
 Keith Sabol
 
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R help

2004-11-16 Thread Spencer Graves
 I don't understand your question. PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html;. In particular, have you 
read the R Data Import / Export documentation that some with R 
[available, from www.r-project.org - Manuals or R - help.start()]? 
Have you tried read.spss in library(foreign)? [help(package=foreign) 
provides additional documentation.] If you've tried all these without 
satisfaction, please explain what you've tried, the error message, the 
version of R, operating system, etc., as requested in the posting guide.

hope this helps.
spencer graves
gauri wrote:
Hi,
I was wondering as to how I could convert SPSS data imported to R into tabular 
form. In the sense, direct usage of read.table( ) doesnt help.
Thanks

-
Meet the all-new My Yahoo!  Try it today! 
	[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] problems with compiling a package

2004-11-16 Thread r . ghezzo

Hello, I am trying to compile packages for R2.0.0 patch in a win XP machine.
Most of the packages compile without problems, with C or FTG or only R.
Now some packeges give the following error which I do not understand how to
correct
...
preparing package xxx for lazy loading
Error in names - .default('*tmp*',value=c(R,Platform,Date,   :
  names attribute[4] must be the same length as the vector [3]
Execution halted
make: *** [lazyload] Error 1

Can somebody tell me how I can correct this error?

One other question, this npreparing package for lazy loading does not occur for
all packages, although their DESCRIPTION and folders are similar, When does a
package goes to lazy loading and when it does not?
Thanks
Heberto Ghezzo
McGill U
Montreal - Canada

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] help on EM Algorithm for bivariate normal

2004-11-16 Thread Tim F Liao
The three packages that someone else mentioned in response 
to your post

flexmix
mixreg
mclust

may be usefule in real applications.  On the other hand, if 
your interest is in teaching EM or developing your own EM by 
using a simple example, the most recent issue of The 
American Statistician has an article with a sample R code 
for the purpose.  Right now I'm away from my journal.  But 
if you would want further info, let me know and I can find 
it for you.

Tim Liao

 Original message 
Date: Tue, 16 Nov 2004 18:22:07 +0100
From: [EMAIL PROTECTED]  
Subject: [R] help on EM Algorithm for bivariate normal  
To: [EMAIL PROTECTED]


Hi,
I woul like to know if it is possible to have a R code to 
generate EM
Algorithm for a normal bivariate mixture.
Best regard,
S.F.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-
project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] problems with compiling a package

2004-11-16 Thread Prof Brian Ripley
On Tue, 16 Nov 2004 [EMAIL PROTECTED] wrote:
Hello, I am trying to compile packages for R2.0.0 patch in a win XP machine.
What exactly is `R2.0.0 patch'?  If you mean 2.0.0 patched, it has a date, 
and the date is crucial.

Most of the packages compile without problems, with C or FTG or only R.
Now some packeges give the following error which I do not understand how to
correct
...
preparing package xxx for lazy loading
Error in names - .default('*tmp*',value=c(R,Platform,Date,   :
 names attribute[4] must be the same length as the vector [3]
Execution halted
make: *** [lazyload] Error 1

Can somebody tell me how I can correct this error?
My guess is that this comes from tools:::.split_description which has
if(!is.na(Built - db[Built])) {
Built - as.list(strsplit(Built, ; )[[1]])
names(Built) - c(R, Platform, Date, OStype)
Built[[R]] - package_version(sub(^R ([0-9.]+), \\1,
Built[[R]]))
} else Built - NULL
so probably your DESCRIPTION file is faulty.  Did you have a Built: line
in it that you put there yourself?  I can reproduce this by doing so.
If so, `Writing R Extensions' does say
  There should be no @samp{Built} or @samp{Packaged} fields, as these are
  added by the package management tools.
and R CMD check on such package throws an immediate error.

One other question, this npreparing package for lazy loading does not occur for
all packages, although their DESCRIPTION and folders are similar, When does a
package goes to lazy loading and when it does not?
Please do read the NEWS (or ONEWS) file!  It says in the first 20 lines
Packages are by default installed using lazy loading if they
have more than 25Kb of R code and did not use a saved image.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] changing character to a vector name

2004-11-16 Thread Gabor Grothendieck
Laura Holt lauraholt_983 at hotmail.com writes:

. I would like to generate a vector/variable name from within a loop to be 
. passed to a table
. function.
. 
. This is what I have so far:
. assign(p1,paste(raw3.df$,rw2$V1[3],sep=))
. p1
. [1] raw3.df$CITIZEN
. 
. Essentially, I want to use the raw3.df$CITIZEN along with another value to 
. generate a table.

You can use eval and parse to parse and execute 
arbitrary R commands that you construct from strings.  The exec
function below is a one statement convenience function
that pastes its arguments together and executes them this way in
its parent's environment.  (Sometimes when one gets complex
requirements like this if one backs up a bit one discovers
that the requirements can be simplified and you might
consider whether that is the case here in which case you
might be able to disregard all this.)

R ### create some test data ###
R data(iris)
R irish - head(iris)
R irish
  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1  5.1 3.5  1.4 0.2  setosa
2  4.9 3.0  1.4 0.2  setosa
3  4.7 3.2  1.3 0.2  setosa
4  4.6 3.1  1.5 0.2  setosa
5  5.0 3.6  1.4 0.2  setosa
6  5.4 3.9  1.7 0.4  setosa

R ### this is the actual processing ###
R exec - function(...) eval.parent(parse(text = paste(..., collapse = )))
R exec(irish$Sepal.Length, -, irish$Sepal.Length, +1)
R irish
  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1  6.1 3.5  1.4 0.2  setosa
2  5.9 3.0  1.4 0.2  setosa
3  5.7 3.2  1.3 0.2  setosa
4  5.6 3.1  1.5 0.2  setosa
5  6.0 3.6  1.4 0.2  setosa
6  6.4 3.9  1.7 0.4  setosa

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] problems with compiling a package

2004-11-16 Thread Gabor Grothendieck
 r.ghezzo at staff.mcgill.ca writes:
: One other question, this npreparing package for lazy loading does not occur 
for
: all packages, although their DESCRIPTION and folders are similar, When does a
: package goes to lazy loading and when it does not?

You can use 

LazyLoad: no

in the DESCRIPTION file to prevent lazy loading.  
Alternately you can use the --no-lazy switch on 
R CMD install

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Difference between two correlation matrices

2004-11-16 Thread Patrick Burns
If you have the data that created the correlation matrices, then
you can do a permutation test.
The first question to ask is, What does 'different' mean?
Some choices include:
max(abs(cor1 - cor2))
max(abs(eigen(cor1 - cor2)$values))
Once you have decided what metric makes most sense, you can
perform the test. First pool all of the data (if you think that there
are different means in the two conditions, then remove the means
within each group before pooling).  Then perform a number of
random allocations of the pooled data  into two groups with the
number in each group equal to the original numbers.  The test
compares your statistic using the original correlation matrices to
the distribution of statistics of the correlations from the random
allocations.
Patrick Burns
Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)
michael watson (IAH-C) wrote:
Hi 

Now a more theoretical question.  I have two correlation matrices - one
of a set of variables under a particular condition, the other of the
same set of variables under a different condition.  Is there a
statistical test I can use to see if these correlation matrices are
different?
Thanks
Mick
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] gcrma package

2004-11-16 Thread [EMAIL PROTECTED]
Hi !

I would like to understand where do affinity.spline.coefs used in function 
compute.affinities come from ?

library(gcrma)
data(affinity.spline.coefs)
  affinity.spline.coefs
  X1  X2  X3  X4  X5  X1
-0.55004171 -0.58579091 -0.08870557 -0.47774242  0.23205570  0.58002746
  X2  X3  X4  X5  X1  X2
  0.61274425  0.10294309  0.57388808 -0.28334367  0.01350914 -0.02030805
  X3  X4  X5
-0.14747469  0.05436463 -0.10124882

Thank you in advance!

Julie AUBERT

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] CDs for R?

2004-11-16 Thread Ted Harding
Hi Folks,

I'm sure I'm speaking for more than a few (though
possibly a minority) here.

There's something of a hidden assumption that R users
can readily download whatever they need from CRAN.

Some of us are on narrow bandwidth dialup connections,
so downloading large quantities of stuff is out of the
question (e.g. at approx. 5min/MB, it would take over
2 days to download a single CD). The meat of CRAN
(including contributed packages and documentation)
is enough to fill 5 CDs, though one individual probably
wouldn't be interested in all of that.

(And, before anyone asks, no I won't be seeing broadband
in the foreseeable future!)

I've worked round this in various ways in the past.
Some Linux distributions (e.g. RedHat, SuSE) come with the
basics of R on their CDs, so when I've upgraded Linux
I've got a new R (though not the latest). Linux Emporium
once obligingly did me a custom CD very cheaply with the
contributed packages. A friend with high-bandwidth access
did me the 5 CDs in return for a pub lunch. And so on.
One can get round it by bothering someone.

What I'd like to suggest, for consideration, is that along
with the stirling work done at many centres to set up and
maintain mirrors of CRAN, some might consider offering also
the service of burning CDs on request, for a reasonable
charge. The difficulty, of course, is that it's going to
take someone's time om something which may well not be
their proper business.

(I'm prompted to think about this again by the emergence
of R-2 - 2.0.1 - one day soon? - 2.1. This is clearly
a major advance in R and changes several things, so I'm
looking at a major download operation, if not by me then
by somebody that I can get CDs from, if I'm to be sure
of being up to date on everything I'd like to have. And
I'm sure I'm not the only one.)

I'd be interested in people's comments on this proposal.

Best wishes to all,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 16-Nov-04   Time: 21:39:14
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] deleting a file

2004-11-16 Thread Uwe Ligges
Achim Zeileis wrote:
On Tue, 16 Nov 2004 15:43:12 - Roger Gill wrote:

Dear all,
I have a very simple question.  Simple, that is, if you know the
answer.

Yes, look at
  ?file.remove
Z
... and file.path() in order to specify the location in an OS 
independent way.

Uwe Ligges


I wish to delete a file in a given directory after having first
checked its existence.  I issue the following commands
path-'c:example/R/'
Thus creating the directory.
indicator-length(grep(filename,path))
If indicator is greater than zero then the file exists.  Now I wish to
remove this file.  However, I would like to make the code compatible
for Linux/Windows and Macs.
In Linux I would issue the command
system('rm paste(path,'filename',sep='')')
and this works just fine.  It does not however work for windows, and I
have no idea whether it would work on a mac.
Is there a single command thay escapes me?
Best Wishes
Roger Gill
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] gcrma package

2004-11-16 Thread Adaikalavan Ramasamy
This question is more for the BioConductor mailing list. 

If you type in 

library(gcrma)
help(affinity.spline.coefs)

at the command prompt, it suggests you to see compute.affinities. Doing
a help(compute.affinities), you will see under References section :

 Hekstra, D., Taussig, A. R., Magnasco, M., and Naef, F. (2003)
 Absolute mRNA concentrations from sequence-specific calibration of
 oligonucleotide array. Nucleic Acids Research, 31. 1962-1968.



On Tue, 2004-11-16 at 16:55, [EMAIL PROTECTED] wrote:
 Hi !
 
 I would like to understand where do affinity.spline.coefs used in function 
 compute.affinities come from ?
 
 library(gcrma)
 data(affinity.spline.coefs)
   affinity.spline.coefs
   X1  X2  X3  X4  X5  X1
 -0.55004171 -0.58579091 -0.08870557 -0.47774242  0.23205570  0.58002746
   X2  X3  X4  X5  X1  X2
   0.61274425  0.10294309  0.57388808 -0.28334367  0.01350914 -0.02030805
   X3  X4  X5
 -0.14747469  0.05436463 -0.10124882
 
 Thank you in advance!
 
 Julie AUBERT
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- 
Adaikalavan Ramasamy[EMAIL PROTECTED]
Centre for Statistics in Medicine   http://www.ihs.ox.ac.uk/csm/
Cancer Research UK  Tel : 01865 226 677
Old Road Campus, Headington, Oxford Fax : 01865 226 962

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] How to remove x, y labels from a plot

2004-11-16 Thread Jin.Li
Hi Arne,
It works. It produced what I wanted. 
y-rnorm(1000, 2, 0)
plot(density(y), ylab=Abundance of species, xlab=Environmental
gradient, main= , lty=2, col=4, xaxt=n, yaxt=n)
Thanks, Arne. And also thanks to other responses.
Regards,
Jin

-Original Message-
From: Arne Henningsen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 16 November 2004 10:33 P
To: [EMAIL PROTECTED]
Cc: Li, Jin (CSE, Atherton)
Subject: Re: [R] How to remove x, y labels from a plot

Hi Jin Li,

does
   plot( 1:100, rnorm(100), ann=FALSE, xaxt=n, yaxt=n )
produce what you want?

Arne


On Tuesday 16 November 2004 13:06, [EMAIL PROTECTED] wrote:
 Hi there,



 I need to plot an illustrative figure without ticks, x, y labels in R.
I
 managed to get the ticks removed, but had no luck with x, y labels.



 Any suggestions would be much appreciated.



 Jin Li




   [[alternative HTML version deleted]]

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] CDs for R?

2004-11-16 Thread David Whiting
(Ted Harding) [EMAIL PROTECTED] writes:

[...]

 There's something of a hidden assumption that R users
 can readily download whatever they need from CRAN.

[...]

 What I'd like to suggest, for consideration, is that along
 with the stirling work done at many centres to set up and
 maintain mirrors of CRAN, some might consider offering also
 the service of burning CDs on request, for a reasonable
 charge. The difficulty, of course, is that it's going to
 take someone's time om something which may well not be
 their proper business.

I have been in a similar situation a fair bit in the past and
understand your position.  Now I'm back in the UK and have a
reasonably fast broadband connection at home I'd be willing to help
out now and then. I guess that to make this work more generally we
would need to work out how to make sure that only the CDs get burned
and not the prospective customer or supplier. 

As for charges, I think I'd only be interested in covering costs of
the CDs and postage. I don't have industrial strength hardware so I
could not get into mass production.

Perhaps we could establish informal groups of R buddies where, for
example, I help you and a small number of other people out each time
there is an update and we establish some kind of trust between
ourselves, rather than new people coming to me each time. People could
sign up to be suppliers and be allocated or choose a group of people
they provide the service to.

I would feel comfortable with something like this working for people
who have been on the R-help list for a while and have some recgonised
identity, and something to lose in terms of reputation if they take
advantage. But, it is possible that new users might need it the most
and, by definition, we might not feel comfortable dealing with new
people.

Dave

-- 
David Whiting
University of Newcastle upon Tyne, UK

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] CDs for R?

2004-11-16 Thread Adaikalavan Ramasamy
There was a similar thread earlier this year 
http://tolstoy.newcastle.edu.au/R/help/04/03/1785.html

I think I previously made the suggestion that you could download this
from an internet cafe. I am not sure if these cafes allow you to plug in
your own laptop or burn it for you.

If you have a DVD readable CDROM and a DVD writer, you could opt for
that.

Failing that, you could see if someone in your local R-group or
university department has the latest R on disc.

But the real question is that if there are enough people on slow
connection that are interested in obtaining R.

Regards, Adai


On Tue, 2004-11-16 at 21:39, [EMAIL PROTECTED] wrote:
 Hi Folks,
 
 I'm sure I'm speaking for more than a few (though
 possibly a minority) here.
 
 There's something of a hidden assumption that R users
 can readily download whatever they need from CRAN.
 
 Some of us are on narrow bandwidth dialup connections,
 so downloading large quantities of stuff is out of the
 question (e.g. at approx. 5min/MB, it would take over
 2 days to download a single CD). The meat of CRAN
 (including contributed packages and documentation)
 is enough to fill 5 CDs, though one individual probably
 wouldn't be interested in all of that.
 
 (And, before anyone asks, no I won't be seeing broadband
 in the foreseeable future!)
 
 I've worked round this in various ways in the past.
 Some Linux distributions (e.g. RedHat, SuSE) come with the
 basics of R on their CDs, so when I've upgraded Linux
 I've got a new R (though not the latest). Linux Emporium
 once obligingly did me a custom CD very cheaply with the
 contributed packages. A friend with high-bandwidth access
 did me the 5 CDs in return for a pub lunch. And so on.
 One can get round it by bothering someone.
 
 What I'd like to suggest, for consideration, is that along
 with the stirling work done at many centres to set up and
 maintain mirrors of CRAN, some might consider offering also
 the service of burning CDs on request, for a reasonable
 charge. The difficulty, of course, is that it's going to
 take someone's time om something which may well not be
 their proper business.
 
 (I'm prompted to think about this again by the emergence
 of R-2 - 2.0.1 - one day soon? - 2.1. This is clearly
 a major advance in R and changes several things, so I'm
 looking at a major download operation, if not by me then
 by somebody that I can get CDs from, if I'm to be sure
 of being up to date on everything I'd like to have. And
 I'm sure I'm not the only one.)
 
 I'd be interested in people's comments on this proposal.
 
 Best wishes to all,
 Ted.
 
 
 
 E-Mail: (Ted Harding) [EMAIL PROTECTED]
 Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
 Date: 16-Nov-04   Time: 21:39:14
 -- XFMail --
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- 
Adaikalavan Ramasamy[EMAIL PROTECTED]
Centre for Statistics in Medicine   http://www.ihs.ox.ac.uk/csm/
Cancer Research UK  Tel : 01865 226 677
Old Road Campus, Headington, Oxford Fax : 01865 226 962

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] CDs for R?

2004-11-16 Thread Duncan Murdoch
On Tue, 16 Nov 2004 21:39:14 - (GMT), (Ted Harding)
[EMAIL PROTECTED] wrote:

Hi Folks,

I'm sure I'm speaking for more than a few (though
possibly a minority) here.

There's something of a hidden assumption that R users
can readily download whatever they need from CRAN.

Some of us are on narrow bandwidth dialup connections,
so downloading large quantities of stuff is out of the
question (e.g. at approx. 5min/MB, it would take over
2 days to download a single CD). The meat of CRAN
(including contributed packages and documentation)
is enough to fill 5 CDs, though one individual probably
wouldn't be interested in all of that.

(And, before anyone asks, no I won't be seeing broadband
in the foreseeable future!)

The tarballs for the base source installation are only around 10 MB.
That's only 50 minutes for you to do the main download. Then you can
pick and choose what other packages to install.  (It's 23 MB to
download the Windows binary; I don't know the size of the Linux
binaries.)

Is it really worth setting up a duplication service?  How much would
you think is reasonable to pay for a CD to be mailed to you?

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] beginner's problem in displaying large data

2004-11-16 Thread Terry Mu
I got a sample data (let's call it sample.data), which is about 2200 by 15.

I tried to take a look of all data

sample.data

It shows only a part of data that I thought was a corner. It does not
really affect my job, but I thought it is nice to have a look of all
data. I can see individual records and they are fine.

Is this normal because of buffer size or some reasons? Can I use other
commands or change some settings to display all data?

Thanks,
Terry

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] plot question

2004-11-16 Thread Apoian, Zack
Say y and z are two time series (functions of date).  What is the R
command to plot y and z together on a graph with date on the x-axis?



DISCLAIMER: This e-mail message and any attachments are inte...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] beginner's problem in displaying large data

2004-11-16 Thread Spencer Graves
 1.  Did you try dim(sample.data)?  Is it actually 2200 by 15?  
Or are you reading in just some subset of the data?  If it is 2200 by 
15, could you also please do class(sample.data)? 

 2.  I just got a full listing from the following: 

 (tst - data.frame(array(rnorm(2200), dim=c(2200, 15
 You might try this.  With R 2.0.0patched under Windows 2000, I got 
rows 1:2200 flying by 3 times, each with 5 columns. 

 3.  Have you considered doing plots (including qqnorm) of numeric 
variables and tables of character variables?  These can often reveal 
problems I might never see in a simple scan of numbers. 

 4.  PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html;.  At minimum, please tell 
us which version of R under which operating system, and specifically 
what you did to get it into R and how you know it's 2200 by 15. 

 hope this helps. 
 spencer graves

Terry Mu wrote:
I got a sample data (let's call it sample.data), which is about 2200 by 15.
I tried to take a look of all data
 

sample.data
   

It shows only a part of data that I thought was a corner. It does not
really affect my job, but I thought it is nice to have a look of all
data. I can see individual records and they are fine.
Is this normal because of buffer size or some reasons? Can I use other
commands or change some settings to display all data?
Thanks,
Terry
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Cross-correlated variables in kernel density estimation

2004-11-16 Thread Adam Gobena
Hi,
I am wondering if the kde2d 2-D kernel density estimation function in the
MASS package can take into account the effect of correlations between the
variables. I couldn't find any achieved information on this issue.
Unfortunately, I don't have the 2002 edition of Modern Applied Statistics
with S by Venables and Ripley in case it was described there. 

Thanks in advance.
Adam

Adam Kenea Gobena
Research Assistant, Water Resources Engineering
Department of Civil  Environmental Engineering
220 Civil/Electrical Eng Bldg
University of Alberta
Edmonton, AB
CANADA T6G 2G7

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Cross-correlated variables in kernel density estimation

2004-11-16 Thread Liaw, Andy
 From: Adam Gobena
 
 Hi,
 I am wondering if the kde2d 2-D kernel density estimation 
 function in the
 MASS package can take into account the effect of correlations 
 between the
 variables. I couldn't find any achieved information on this issue.
 Unfortunately, I don't have the 2002 edition of Modern 
 Applied Statistics
 with S by Venables and Ripley in case it was described there. 

The subject of your message doesn't seem to have much to do with your
question...  Also, it's not clear to me what you mean by taking into account
the effect of correlations between variables.  Do you mean a kernel function
that is something like a bivariate Gaussian density with non-diagonal
covariance matrix?  If so, ?kde2d in MASS says:

 Two-dimensional kernel density estimation with an axis-aligned
 bivariate normal kernel, evaluated on a square grid.

so the answer is no.  No other R packages that does 2D kernel density
estimation (that I know of, anyway) can do it, either, and probably for a
good reason.  Why would you need it?  If there are correlation structures in
the (X, Y) data, small enough bandwidths in both direction should give
satisfactory estimate of the density.

Andy
 
 Thanks in advance.
 Adam
 --
 --
 Adam Kenea Gobena
 Research Assistant, Water Resources Engineering
 Department of Civil  Environmental Engineering
 220 Civil/Electrical Eng Bldg
 University of Alberta
 Edmonton, AB
 CANADA T6G 2G7
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] about 2 color variance stabilization

2004-11-16 Thread
Hello sir:
A paper of you namedExact and Approximate Variance-Stabilizing Transformations 
for Two-Color Microarrays is very helpful for my work.
A question which needs your help.Thanks a lot.
For instance,cy3~control  cy5~treatment
And after calculating the htransformation for each channel,we can get h(cy3) 
and h(cy5).But obviously,each h value isn't calculated individually ,but 
through the information of the all 2 channels.I wanna know how the all 2 
channels's information is included in h transformation.
By using the vsnpackage under R environment,if I enter only 1 channel(i.e. 
just 1 column data for gene expression),the system gives warning which notice 
me that I must enter at least 2 channels(i.e. 2 column data for gene 
expression).If I enter to channel,I can get the h value for each of the 2 
channels.So I wanna know how to use the all 2 channels's imformation for the 
h transformation.
Thanks again.
 
My best regards!

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] plot question

2004-11-16 Thread Gabor Grothendieck
Apoian, Zack Zack.Apoian at sac.com writes:

 Say y and z are two time series (functions of date).  What is the R
 command to plot y and z together on a graph with date on the x-axis?

There are several time series classes (ts, zoo in zoo, irts
in tseries, its in its, timeDate in fBasics) and its also possible 
to plot a numeric vector against a vector of dates.

Here is an example using zoo which also illustrates the case
where the times are not the same:


library(zoo)

# -- test data --
# y is over today and next 4 days. 
# z over today and next 9 days.
y - zoo(11:15, Sys.Date() + 0:4)
z - zoo(21:30, Sys.Date() + 0:9)

plot(merge(y,z), plot.type = single, ylim = range(c(y,z)),
col = c(green, red))

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Non-Linear Regression on a Matrix

2004-11-16 Thread Diana Abdueva
Hi, I'm terribly sorry for submitting my primitive question, I'm a
beginner in R and was hoping to get some help re: non-linear fit.

I have a 2D data with the following structure:

A BC
1  1  111
1  2  121
1  3  131
2  1  141
2  2  151
2  3  161
3  1  171
3  2  181
3  3  191

I'm trying to fit C = non-linear function (A,B). I was wondering if
there's a package that would save my time of doing direct least square
estimation.

Thank you,
Diana

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Cross-correlated variables in kernel density estimation

2004-11-16 Thread Adam Gobena
Hi Andy,
Sorry about the vague subject line. I think I overlooked a lot of things
including the description of the function itself. Anyway, you have got the
essence of my question. Thanks for the reply. 

I am using kernel density estimation to estimate the pdf some data. The pdf
estimation is an intermediate step in a modeling work. So, I can work with
one variable at a time and combine the final results from my model in some
way but I thought it would be good to look at the joint PDF. The problem is,
my (X,Y) data have a correlation structure.  

Thanks,
Adam


Adam K. Gobena
Research Assistant, Water Resources Engineering
Department of Civil  Environmental Engineering
220 Civil/Electrical Eng Bldg
University of Alberta
Edmonton, AB
CANADA T6G 2G7
 

-Original Message-
From: Liaw, Andy [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 16, 2004 6:06 PM
To: 'Adam Gobena'; [EMAIL PROTECTED]
Subject: RE: [R] Cross-correlated variables in kernel density estimation

 From: Adam Gobena
 
 Hi,
 I am wondering if the kde2d 2-D kernel density estimation 
 function in the
 MASS package can take into account the effect of correlations 
 between the
 variables. I couldn't find any achieved information on this issue.
 Unfortunately, I don't have the 2002 edition of Modern 
 Applied Statistics
 with S by Venables and Ripley in case it was described there. 

The subject of your message doesn't seem to have much to do with your
question...  Also, it's not clear to me what you mean by taking into account
the effect of correlations between variables.  Do you mean a kernel function
that is something like a bivariate Gaussian density with non-diagonal
covariance matrix?  If so, ?kde2d in MASS says:

 Two-dimensional kernel density estimation with an axis-aligned
 bivariate normal kernel, evaluated on a square grid.

so the answer is no.  No other R packages that does 2D kernel density
estimation (that I know of, anyway) can do it, either, and probably for a
good reason.  Why would you need it?  If there are correlation structures in
the (X, Y) data, small enough bandwidths in both direction should give
satisfactory estimate of the density.

Andy
 
 Thanks in advance.
 Adam
 --
 --
 Adam Kenea Gobena
 Research Assistant, Water Resources Engineering
 Department of Civil  Environmental Engineering
 220 Civil/Electrical Eng Bldg
 University of Alberta
 Edmonton, AB
 CANADA T6G 2G7
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 



--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Non-Linear Regression on a Matrix

2004-11-16 Thread apjaworski





If your non-linear function (A, B) is parametric nls should do it for
you.  If you have R version 2 (perhaps even 1.9) do ?nls to see the help
page.  Older versions of R require library(nls) first.

Hope this helps,

Andy

__
Andy Jaworski
518-1-01
Process Laboratory
3M Corporate Research Laboratory
-
E-mail: [EMAIL PROTECTED]
Tel:  (651) 733-6092
Fax:  (651) 736-3122


   
 Diana Abdueva 
 [EMAIL PROTECTED] 
 ail.com   To 
 Sent by:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]  cc 
 at.math.ethz.ch   
   Subject 
   [R] Non-Linear Regression on a  
 11/16/2004 08:33  Matrix  
 PM
   
   
 Please respond to 
   Diana Abdueva   
 [EMAIL PROTECTED] 
 ail.com  
   
   




Hi, I'm terribly sorry for submitting my primitive question, I'm a
beginner in R and was hoping to get some help re: non-linear fit.

I have a 2D data with the following structure:

A BC
1  1  111
1  2  121
1  3  131
2  1  141
2  2  151
2  3  161
3  1  171
3  2  181
3  3  191

I'm trying to fit C = non-linear function (A,B). I was wondering if
there's a package that would save my time of doing direct least square
estimation.

Thank you,
Diana

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] how to estimate conditional density

2004-11-16 Thread Yulei He
Hi, there.

Suppose I have a bivariate data set y1 and y2. Can anybody tell me how to
estimate the conditional density of f(y1|y2) and vice versa? Thanks.

Yulei


$$$
Yulei He
1586 Murfin Ave. Apt 37
Ann Arbor, MI 48105-3135
[EMAIL PROTECTED]
734-647-0305(H)
734-763-0421(O)
734-763-0427(O)
734-764-8263(fax)
$$

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] CDs for R?

2004-11-16 Thread Dirk Eddelbuettel
Ted,

On Tue, Nov 16, 2004 at 09:39:14PM -, Ted Harding wrote:
 Hi Folks,
 
 I'm sure I'm speaking for more than a few (though
 possibly a minority) here.
 
 There's something of a hidden assumption that R users
 can readily download whatever they need from CRAN.
 
 Some of us are on narrow bandwidth dialup connections,
 so downloading large quantities of stuff is out of the
 question (e.g. at approx. 5min/MB, it would take over
 2 days to download a single CD). The meat of CRAN
 (including contributed packages and documentation)
 is enough to fill 5 CDs, though one individual probably
 wouldn't be interested in all of that.

I'll cc this reply to Mark Walker. His shop, budgetlinuxcds.com / blcds.com,
is one of the resellers of my Quantian 'scientific / cluster-computing
workstation on a bootable dvd' Linux distribution / environment
(see http://dirk.eddelbuettel.com/quantian for more on this).

Mark has been consistently responsive while offering a low-cost cd/dvd
service (of which I receive no cut, in case you're wondering about
disclaimers).  I think he'd be happy to add regular snapshots of certain
portions of http://cran.r-project.org/src/, maybe for the sources and/or
windows binaries, for his failry reasonable fees. 

 (And, before anyone asks, no I won't be seeing broadband
 in the foreseeable future!)
 
 I've worked round this in various ways in the past.
 Some Linux distributions (e.g. RedHat, SuSE) come with the
 basics of R on their CDs, so when I've upgraded Linux

I cannot resist mentioning that Debian will almost surely have the best R
coverage with R, several dozen CRAN packages, ESS and many other goodies.
Debian may well not be for everyone, but maybe Ubuntu will make the initial
experience more pleasant.

Hope this helps, Dirk



 I've got a new R (though not the latest). Linux Emporium
 once obligingly did me a custom CD very cheaply with the
 contributed packages. A friend with high-bandwidth access
 did me the 5 CDs in return for a pub lunch. And so on.
 One can get round it by bothering someone.
 
 What I'd like to suggest, for consideration, is that along
 with the stirling work done at many centres to set up and
 maintain mirrors of CRAN, some might consider offering also
 the service of burning CDs on request, for a reasonable
 charge. The difficulty, of course, is that it's going to
 take someone's time om something which may well not be
 their proper business.
 
 (I'm prompted to think about this again by the emergence
 of R-2 - 2.0.1 - one day soon? - 2.1. This is clearly
 a major advance in R and changes several things, so I'm
 looking at a major download operation, if not by me then
 by somebody that I can get CDs from, if I'm to be sure
 of being up to date on everything I'd like to have. And
 I'm sure I'm not the only one.)
 
 I'd be interested in people's comments on this proposal.
 
 Best wishes to all,
 Ted.
 
 
 
 E-Mail: (Ted Harding) [EMAIL PROTECTED]
 Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
 Date: 16-Nov-04   Time: 21:39:14
 -- XFMail --
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
If your hair is standing up, then you are in extreme danger.
  -- http://www.usafa.af.mil/dfp/cockpit-phys/fp1ex3.htm

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Search engine for LINUX MOZILLA

2004-11-16 Thread Yuandan Zhang
Hi,

I am looking for help on searc engine at R htmlhelp page. Here is the system 
settings:

R 2.0.0 (2004-10-04).

Installed at Linux RH 9.0 (kernal 2.4.20-8) and FC2 (kernal 2.5.8). 

The web broswer is 
Mozilla 1.7
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

From help.start(), web broswer started ok. However, the search engine does not 
respond. The status bar only shows done. In Windows settings, it shows Applet 
started  or something similar.

I tried a few plugins, did not work.

Any suggest?

Yuandan

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] persp grid

2004-11-16 Thread Joel Bremson
I've got a 4x4 matrix of points from a 2-way ANOVA I'd like to plot.

The x,y correspond to the treatment groups and look like this
((1,1),(1,2),(1,3),(1,4),(2,1),...).

The z is the 4x4 matrix.

How can I get persp to grid the x,y axis with only the numbers 1-4 on both?

Regards,

Joel Bremson
UC Davis Statistics Dept.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] CDs for R?

2004-11-16 Thread Jari Oksanen
On 16 Nov 2004, at 23:39, (Ted Harding) wrote:
Some of us are on narrow bandwidth dialup connections,
so downloading large quantities of stuff is out of the
question (e.g. at approx. 5min/MB, it would take over
2 days to download a single CD). The meat of CRAN
(including contributed packages and documentation)
is enough to fill 5 CDs, though one individual probably
wouldn't be interested in all of that.
5 CDs sounds 4 too many. I once burnt CDs for my students, and they 
fitted nicely in one CD (Windows binaries, all packages as Windows 
binaries and sources, contributed documents).  I guess you can fit 
Windows, Mac and some Linux binaries all in one CD.

Now comes my suggestion to CRAN maintainer: this all would be easier, 
if you would produce a CD image file ('iso') that would contain a 
snapshot of the latest version: main binaries, all contributed 
packages, and docs. Getting somebody to help downloading this iso would 
be much easier than trying to collect all first and then make up your 
own cd image.

Actually, only Windows and Mac users need binary versions of packages. 
The former because they don't have tools to install from source, the 
latter because they don't know that they have the tools (being command 
line challenged).

To Dirk Eddelbuettel: Yes indeed, Ubuntu gives human face to Debian and 
is a much more pleasant experience. However, changing OS for R may be 
asking too much. Further, Ubuntu/Debian comes with a tiny and biased 
selection of packages, and if that's not your kind of bias, you have 
got to go to the Internet again. Further, Ubuntu (and other Linuxes) 
lag behind R. The current Ubuntu release comes with R 1.9.1, and it 
won't be upgraded but in the next release scheduled for April 2005 (and 
just in the same time as the next R, so that Ubuntu will be one R 
version off again). I guess the lag is even worse in packages.

cheers, jari oksanen
--
Jari Oksanen, Oulu, Finland
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How to plot this

2004-11-16 Thread Jin.Li
Hi there,

 

I produced a plot using the following codes:

 

y-rnorm(1000, 2, 0)

x0-c(0, 0)

y0-c(0, 0)

y1-c(0, 1)

x1-c(0, 4)

plot(density(y), ylab=Abundance of species, xlab=Environmental
gradient, main= , 

   xlim=c(0, 4), ylim=c(0, 1), lty=2, col=4, xaxt=n, yaxt=n,
frame.plot=F)

lines(x0, y1) # add an axis

lines(x1, y0) # add an axis

arrows(3.95, 0, 4, 0,  angle = 15, length = 0.1)

arrows(0, 0.98, 0, 1,  angle = 15, length = 0.1)

 

Please help me to remove the grey horizontal line and put the axis
labels closer to the axes. And also appreciate any suggestions on how to
make those arrows look nicer, e.g. a filled small arrow for each axis,
like what from points(0, 1,   pch=17), but a slightly narrowed one.
Thanks.

 

Regards,

 

Jin Li



Jin Li, PhD

Climate Impacts Modeller

CSIRO Sustainable Ecosystems

Atherton, QLD 4883, Australia



 


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: variations on the theme of survSplit

2004-11-16 Thread David Duffy
Danardono [EMAIL PROTECTED] wrote:

 While waiting for 2.1, for those who need function[s] for this
 survival-splitting business, as I do,   this 'survcut' function below
 might be helpful.
 It is not an elegant nor efficient function but it works, at least for
 some examples below.

Ditto the following, for the case where there are multiple time-varying
(irreversible) binary covariates, here slicing as coarsely as possible.

#
# Create dataset for survival analysis with time-dependent covariate
# Gill-Anderson model
#
x - data.frame(onset=c(46, 32, 53, 76, 64, 43),
case=c(1,1,1,0,0,0),
ooph=c(NA, 30, 38, 50, NA, NA),
ocp=c(1,1,0,0,1,0),
parity=c(2,0,1,3,3,2),
age.preg=c(28,NA,27,20,22,23))

make.dep - function(onset, case, time.dep, covs=NULL) {
  if (is.null(n.time.dep - ncol(time.dep))) {
if (!is.null(time.dep)) {
  n.time.dep - 1
  time.dep - as.matrix(time.dep)
}else{
  n.time.dep - 0
  warning(No time dependent covariates)
}
  }
  if (is.null(n.covs - ncol(covs))) {
if (!is.null(covs)) {
  n.covs - 1
  covs - as.matrix(covs)
}else{
  n.covs - 0
}
  }
  ordered.t - t(apply(cbind(onset,time.dep),1,sort,na.last=TRUE))
  tot.time.dep - apply(ordered.t,1,function(x) sum(!is.na(x)))
  ordered.t - cbind(rep(0, nrow(ordered.t)), ordered.t)
  npars - 4+n.time.dep+n.covs
  nrecs - sum(tot.time.dep)
  new.x - as.data.frame(matrix(nr=nrecs, nc=npars))
  names(new.x) - c(start, stop, event, 
names(time.dep),names(covs),episode)
  this.rec-0
  for(i in 1:length(onset)) {
for(j in 1:tot.time.dep[i]) {
  this.rec - this.rec+1
  new.x[this.rec,1] - ordered.t[i, j]
  new.x[this.rec,2] - ordered.t[i, j+1]
  new.x[this.rec,3] - 0
  new.x[this.rec,4:(3+n.time.dep)] - (ordered.t[i,j]=time.dep[i,])
  missing - is.na(new.x[this.rec,])
  new.x[this.rec,missing] - 0
  if (n.covs0) {
new.x[this.rec, (4+n.time.dep):(4+n.time.dep+n.covs)] - covs[i,]
  }
  new.x[this.rec, npars]-paste(i,j,sep=.)
}
new.x[this.rec,3]-case[i]
  }
  new.x
}

David Duffy.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Search engine for LINUX MOZILLA

2004-11-16 Thread Prof Brian Ripley
This is covered in the R-admin manual, linked to from that HTML page.
Please follow carefully the advice there.  In particular ensure that you 
have a version of Java that is said to work (preferably the latest, 
1.5.0).

On Wed, 17 Nov 2004, Yuandan Zhang wrote:
Hi,
I am looking for help on searc engine at R htmlhelp page. Here is the system 
settings:
R 2.0.0 (2004-10-04).
Installed at Linux RH 9.0 (kernal 2.4.20-8) and FC2 (kernal 2.5.8).
The web broswer is
Mozilla 1.7
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616
From help.start(), web broswer started ok. However, the search engine does not respond. The status bar only shows done. In Windows settings, it shows Applet started  or something similar.
I tried a few plugins, did not work.
Any suggest?
Yuandan
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Cross-correlated variables in kernel density estimation

2004-11-16 Thread Prof Brian Ripley
Yes it can and it is in the reference.
On Tue, 16 Nov 2004, Adam Gobena wrote:
Hi,
I am wondering if the kde2d 2-D kernel density estimation function in the
MASS package can take into account the effect of correlations between the
variables. I couldn't find any achieved information on this issue.
Unfortunately, I don't have the 2002 edition of Modern Applied Statistics
with S by Venables and Ripley in case it was described there.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] How to plot this

2004-11-16 Thread Mulholland, Tom
If this is a quick and dirty process you want rather than learning all the 
capabilities that are in R then I would copy the density curve (or the bits you 
like) into your favourite image editor, and use it's capabilities to pretty it 
up.

However there are a number of options. Firstly you have chosen to plot 
density(y). When I looked at the help for density it gives the values returned 
by density. If you want a custom plot maybe you should try

dcurve - density(y)

you could then directly access the $x and $y components as you would in any plot

For instance plot(density(y)) gives you the grey line. However 
plot(dcurve$x,dcurve$y,type = l) gives you a different type of plot.

As for arrowheads one could create an appropriate polygon to stick at each 
end. Which for a one off might be a bit of overkill. Sometime in all of this 
you'll also probably encounter clipping, in which case par(xpd = TRUE) will 
often help. Just remember to turn if off or you may find unwanted graphics 
appearing later on.

For putting the labels where you want you could use mtext. This gives you 
control over where you want to place the text.

A word of caution. If you are going to start prettying up you plots to very 
specific standards make sure that you are working on the final device from 
which you wish to take the final copy. Each of the devices have their own 
capabilities which are often not related to R but rather to their own 
environment. That is you can't get a plot looking perfect in a window and 
assume that the same code sent to a postscript device will produce identical 
results. 

R can give you very good graphics, often straight out of the box, but like any 
publishing process it can be a bit fiddly.

Tom Mulholland
Senior Demographer
Department for Planning and Infrastructure
Perth, WA, Australia.




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 November 2004 2:39 PM
To: [EMAIL PROTECTED]
Subject: [R] How to plot this


Hi there,

 

I produced a plot using the following codes:

 

y-rnorm(1000, 2, 0)

x0-c(0, 0)

y0-c(0, 0)

y1-c(0, 1)

x1-c(0, 4)

plot(density(y), ylab=Abundance of species, xlab=Environmental
gradient, main= , 

   xlim=c(0, 4), ylim=c(0, 1), lty=2, col=4, xaxt=n, yaxt=n,
frame.plot=F)

lines(x0, y1) # add an axis

lines(x1, y0) # add an axis

arrows(3.95, 0, 4, 0,  angle = 15, length = 0.1)

arrows(0, 0.98, 0, 1,  angle = 15, length = 0.1)

 

Please help me to remove the grey horizontal line and put the axis
labels closer to the axes. And also appreciate any suggestions on how to
make those arrows look nicer, e.g. a filled small arrow for each axis,
like what from points(0, 1,   pch=17), but a slightly narrowed one.
Thanks.

 

Regards,

 

Jin Li



Jin Li, PhD

Climate Impacts Modeller

CSIRO Sustainable Ecosystems

Atherton, QLD 4883, Australia



 


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html