Re: [R] ANOVA non-sphericity test and corrections (eg, Greenhouse-Geisser)

2007-06-25 Thread Peter Dalgaard
DarrenWeber wrote:
 I'm an experimental psychologist and when I run ANOVA analysis in
 SPSS, I normally ask for a test of non-sphericity (Box's M-test).  I
 also ask for output of the corrections for non-sphericity, such as
 Greenhouse-Geisser and Huhn-Feldt.  These tests and correction factors
 are commonly used in the journals for experimental and other
 psychology reports.  I have been switching from SPSS to R for over a
 year now, but I realize now that I don't have the non-sphericity test
 and correction factors.
   
This can be done using anova.mlm() and mauchly.test()  which work on 
mlm objects, i.e., lm() output where the response is a matrix. There 
is no theory, to my knowledge, to support it for general aov() models, 
the catch being that you need to have a within-subject covariance matrix.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Random numbers from skewed distributions

2007-06-25 Thread Anup Nandialath
Dear Friends,

I was wondering if there is any package to get random numbers from the Burr 10 
distribution. I checked the rmutil and actuar package. Both seems to implement 
the Burr 12 distribution.

thanks in advance
Regards

Anup

   
-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Source code for rlogis

2007-06-25 Thread Peter Dalgaard
Anup Nandialath wrote:
 Dear friends,

 I was trying to read the source code for rlogis but ran into a roadblock. It 
 shows

 [[1]]
 function (n, location = 0, scale = 1) 
 .Internal(rlogis(n, location, scale))
 environment: namespace:stats

 Is is possible to access the source code for the same.

   
Yes, but as it is .Internal, you have to look in the (C code) sources 
for R itself. You can access that either by getting the source files for 
R and unpacking them somewhere on your computer, or by browsing e.g. 
https://*svn*.*R*-project.org/*R*/tags/R-2-5-0 or  
https://svn.r-project.org/R/branches/R-2-5-branch. Specifically, 
src/nmath/rlogis.c.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ANOVA non-sphericity test and corrections (eg, Greenhouse-Geisser)

2007-06-25 Thread Simon Blomberg
On Mon, 2007-06-25 at 17:53 +1000, Simon Blomberg wrote:
 If you use lme, you can fit a general correlation structure to the
 within-subject data, and compare the fit to a model assuming
 uncorrelated within-subjects errors. That should tell you whether your
 data are ...

correlated... (damn email gremlins.)

 Aren't the G-G and H-F corrections only approximate fixes?
 Surely it is better to work with a model that actually fits your data,
 rather than using ad hoc adjustments towards a model that doesn't quite
 fit. But I'm no psychologist. :-)
 
 Cheers,
 
 Simon.
 
  On Mon, 2007-06-25 at 08:22 +0200, Peter Dalgaard wrote:
  DarrenWeber wrote:
   I'm an experimental psychologist and when I run ANOVA analysis in
   SPSS, I normally ask for a test of non-sphericity (Box's M-test).  I
   also ask for output of the corrections for non-sphericity, such as
   Greenhouse-Geisser and Huhn-Feldt.  These tests and correction factors
   are commonly used in the journals for experimental and other
   psychology reports.  I have been switching from SPSS to R for over a
   year now, but I realize now that I don't have the non-sphericity test
   and correction factors.
 
  This can be done using anova.mlm() and mauchly.test()  which work on 
  mlm objects, i.e., lm() output where the response is a matrix. There 
  is no theory, to my knowledge, to support it for general aov() models, 
  the catch being that you need to have a within-subject covariance matrix.
  
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
-- 
Simon Blomberg, BSc (Hons), PhD, MAppStat. 
Lecturer and Consultant Statistician 
Faculty of Biological and Chemical Sciences 
The University of Queensland 
St. Lucia Queensland 4072 
Australia

Room 320, Goddard Building (8)
T: +61 7 3365 2506 
email: S.Blomberg1_at_uq.edu.au 

The combination of some data and an aching desire for 
an answer does not ensure that a reasonable answer can 
be extracted from a given body of data. - John Tukey.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to run mathematica or c programs in R?

2007-06-25 Thread Schmitt, Corinna
Hallo,

I just know a solution if you use MATLAB. Here you need the library R.matlab 
and there the functions writeMat and readMat. You can download the package on 
CRAN.

Corinna

**
Corinna Schmitt, Dipl.Inf.(Bioinformatik)
Fraunhofer Institut für Grenzflächen-  Bioverfahrenstechnik
Nobelstrasse 12, B 3.24
70569 Stuttgart
Germany

phone: +49 711 9704044
fax: +49 711 9704200
e-mail: [EMAIL PROTECTED]
http://www.igb.fraunhofer.de



  


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Zhang Jian
Gesendet: Freitag, 22. Juni 2007 23:26
An: r-help
Betreff: [R] How to run mathematica or c programs in R?

I have some programs which were writen in mathematica or c language, but I
donot know how to use these software. So I want to run them in R.
Can I do it ?
How to run mathematica or c programs in R?

Jian Zhang

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ANOVA non-sphericity test and corrections (eg, Greenhouse-Geisser)

2007-06-25 Thread Simon Blomberg
If you use lme, you can fit a general correlation structure to the
within-subject data, and compare the fit to a model assuming
uncorrelated within-subjects errors. That should tell you whether your
data are Aren't the G-G and H-F corrections only approximate fixes?
Surely it is better to work with a model that actually fits your data,
rather than using ad hoc adjustments towards a model that doesn't quite
fit. But I'm no psychologist. :-)

Cheers,

Simon.

 On Mon, 2007-06-25 at 08:22 +0200, Peter Dalgaard wrote:
 DarrenWeber wrote:
  I'm an experimental psychologist and when I run ANOVA analysis in
  SPSS, I normally ask for a test of non-sphericity (Box's M-test).  I
  also ask for output of the corrections for non-sphericity, such as
  Greenhouse-Geisser and Huhn-Feldt.  These tests and correction factors
  are commonly used in the journals for experimental and other
  psychology reports.  I have been switching from SPSS to R for over a
  year now, but I realize now that I don't have the non-sphericity test
  and correction factors.

 This can be done using anova.mlm() and mauchly.test()  which work on 
 mlm objects, i.e., lm() output where the response is a matrix. There 
 is no theory, to my knowledge, to support it for general aov() models, 
 the catch being that you need to have a within-subject covariance matrix.
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
-- 
Simon Blomberg, BSc (Hons), PhD, MAppStat. 
Lecturer and Consultant Statistician 
Faculty of Biological and Chemical Sciences 
The University of Queensland 
St. Lucia Queensland 4072 
Australia

Room 320, Goddard Building (8)
T: +61 7 3365 2506 
email: S.Blomberg1_at_uq.edu.au 

The combination of some data and an aching desire for 
an answer does not ensure that a reasonable answer can 
be extracted from a given body of data. - John Tukey.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] adding lines to stripchart

2007-06-25 Thread Chuck Cleland
James Root wrote:
 I have two points of collection across 20 subjects (pre and post for each),
 so 20 pairs of data points.  I would like to plot the actual raw data points
 for each subject for both pre and post and connect lines between these two
 points (20 in all) to depict real change between the two timepoints.
 
 I have tried using stripchart which adequately plots the two lines of
 subject data points.  Attempting to use segments however has been
 difficult.  It seems that the segments command gives too many coordiate
 points - so where segments has:
 
 x0, y0, x1, y1
 
 I really only have two coordinates for each point -
 
 pre to post
 
 I am sure that I am misusing the command but not sure if I should continue
 to try with segments or if there is another command that would be more
 appropriate.
 
 As always, thanks for any help.

  Here is how you might use segments() and stripchart():

df - data.frame(pre = runif(20), post = runif(20))

stripchart(x = list(df$pre, df$post), vertical=TRUE,
group.names=c(Pre,Post))

for(i in 1:nrow(df)){segments(1, df$pre[i], 2, df$post[i])}

   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Prof Brian Ripley
Is this ppc32 or ppc64?  (What does uname -a say?)

If the former, you might need to set CPICFLAGS and FPICFLAGS to -fPIC 
(rather than -fpic): please look these up in the R-admin.html file (which 
INSTALL points you to).

For ppc64 configure should have found -fPIC.

On Mon, 25 Jun 2007, Vivek Menon wrote:

 Hello everybody,I am having an error while compiling R-2.5.0 on Linux
 powerpc.
 This is what I see when I do a make:


 gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o devNull.o
 devPicTeX.o devPS.o devQuartz.o init.o
 ../../../../library/grDevices/libs/grDevices.so is unchanged
 make[5]: Leaving directory
 `/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'

 make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
 /src/library/grDevices/src'
 Warning: unable to load shared library '/home/vivekv/sw_alg/R-2.5.0
 /modules//lapack.so':
  /home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24 relocation at
 0x0e65d7e4 for symbol `strlen' out of range
 Error in solve.default(rgb) : lapack routines cannot be loaded
 Error: unable to load R code in package 'grDevices'
 Execution halted
 make[3]: *** [all] Error 1
 make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
 /src/library/grDevices'
 make[2]: *** [R] Error 1
 make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0/src/library'
 make[1]: *** [R] Error 1
 make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
 make: *** [R] Error 1

 Please let me know what needs to be done for a successful installation.
 Thanks,
 Vivek

   [[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Re : Half of a heatmap

2007-06-25 Thread Neil Shephard
 I am trying to produce a heatmap of pairwise correlations, but since the 
 matrix is
 symmetric, I only need either the upper or the lower triangle.  I have 
 scoured the
 web and R documentation, but I have not been able to find a way to produce 
 such a
 figure.  Is there a simple way to produce a heat map with only the part above 
 or
 below the diagonal?

You might want to check out the LDheatmap() package which can generate
the plots you describe.  The help indicates that it accepts a matrix
of pair-wise linkage disequilibrium measures, one of which is R^2 (the
correlation coefficient between loci), but I suspect you could simply
pass it a matrix of correlation coefficents.

Hope that helps,

Neil
-- 
In mathematics you don't understand things. You just get used to
them.  - Johann von Neumann

Email - [EMAIL PROTECTED] / [EMAIL PROTECTED]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] fractional calculations

2007-06-25 Thread Federico Calboli
Hi All,

is there a function in R that allows me to work with fractions without 
transforming them to floats (or whatever) in between?

Something that would calculate something like:

(1/2 + 1/8) * 1/2 = 5/16

without ever transforming to 0.5 and 0.125?

Best,

Federico

-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] fractional calculations

2007-06-25 Thread Henrique Dallazuanna
require(MASS)
?as.fractions
as.fractions(1/2+1/8)

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22
Ohttp://maps.google.com/maps?f=qhl=enq=Curitiba,+Brazillayer=ie=UTF8z=18ll=-25.448315,-49.276916spn=0.002054,0.005407t=kom=1

On 25/06/07, Federico Calboli [EMAIL PROTECTED] wrote:

 Hi All,

 is there a function in R that allows me to work with fractions without
 transforming them to floats (or whatever) in between?

 Something that would calculate something like:

 (1/2 + 1/8) * 1/2 = 5/16

 without ever transforming to 0.5 and 0.125?

 Best,

 Federico

 --
 Federico C. F. Calboli
 Department of Epidemiology and Public Health
 Imperial College, St Mary's Campus
 Norfolk Place, London W2 1PG

 Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

 f.calboli [.a.t] imperial.ac.uk
 f.calboli [.a.t] gmail.com

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] fractional calculations

2007-06-25 Thread Stefan Grosse

 is there a function in R that allows me to work with fractions without 
 transforming them to floats (or whatever) in between?

   

You could use the ryacas (CAS) package:
http://code.google.com/p/ryacas/
and/or
http://cran.r-project.org/doc/vignettes/Ryacas/Ryacas.pdf

e.g:
 library(Ryacas)
 yacas(expression((1/2 + 1/8) * 1/2 ))
[1] Starting Yacas!
expression(5/16)



Stefan

 Something that would calculate something like:

 (1/2 + 1/8) * 1/2 = 5/16

 without ever transforming to 0.5 and 0.125?


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] gam function in the mgcv library

2007-06-25 Thread Bill Wheeler
I would like to fit a logistic regression using a smothing spline, where the 
spline is a piecewise cubic polynomial. Is the knots option used to define the 
subintervals for each piece of the cubic spline? If yes and there are k knots, 
then why does the coefficients field in the returned object from gam only list 
k coefficients? Shouldn't there be 4k -4 coefficients?

Sincerely,

Bill

   
-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Re : Half of a heatmap

2007-06-25 Thread Rosenfeld, Jeffrey
Thank you for your reply.  I have looked at LDheatmap, but it does not seem to 
do what I want and seems to only work well for LD data.  I was looking for 
something that would produce a figure identical to what heatmap.2 gives me, 
including the proper X and Y-axis labels and a dendogram, except that it would 
only have half of the map.  Preferably, it would have the Color Key in the 
place where the other triangle of the heatmap would be, to save space.


Jeff


-Original Message-
From: Neil Shephard [mailto:[EMAIL PROTECTED]
Sent: Mon 6/25/2007 6:14 AM
To: r-help@stat.math.ethz.ch
Cc: Rosenfeld, Jeffrey
Subject: Re : [R] Half of a heatmap
 
 I am trying to produce a heatmap of pairwise correlations, but since the 
 matrix is
 symmetric, I only need either the upper or the lower triangle.  I have 
 scoured the
 web and R documentation, but I have not been able to find a way to produce 
 such a
 figure.  Is there a simple way to produce a heat map with only the part above 
 or
 below the diagonal?

You might want to check out the LDheatmap() package which can generate
the plots you describe.  The help indicates that it accepts a matrix
of pair-wise linkage disequilibrium measures, one of which is R^2 (the
correlation coefficient between loci), but I suspect you could simply
pass it a matrix of correlation coefficents.

Hope that helps,

Neil
-- 
In mathematics you don't understand things. You just get used to
them.  - Johann von Neumann

Email - [EMAIL PROTECTED] / [EMAIL PROTECTED]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Peter Moser ist außer Haus.

2007-06-25 Thread peter . moser

Ich werde ab  25.06.2007 nicht im Büro sein. Ich kehre zurück am
28.06.2007.

in dringenden Fällen bin ich unter 079 79 73 74 6 erreichbar

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Christophe Pallier
cf. R Data Import/Export
file:///tmp/RtmpnFqONj/.R/doc/manual/R-data.htmlin the standard
documentation.

Christophe

On 6/25/07, Erika Frigo [EMAIL PROTECTED] wrote:


 Good morning to everybody,
 I have a problem : how can I import excel files in R???

 thank you very much


 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza
 Alimentare (VSA)

 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
 [[alternative HTML version deleted]]


 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Christophe Pallier (http://www.pallier.org)

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] fractional calculations

2007-06-25 Thread Federico Calboli
Henrique Dallazuanna wrote:
 require(MASS)
 ?as.fractions
 as.fractions(1/2+1/8)

I thought that as.fractions did transform the fractions *first* into floats and 
*then* found the rational approssimation (a passage I'd rather avoid):

fractionspackage:MASSR Documentation

Rational Approximation

Description:

  Find rational approximations to the components of a real numeric
  object using a standard continued fraction method.

/F
-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help in HMM for count data

2007-06-25 Thread Regina Verghis
Respected Sir,
   I am Regina M.Verghis, Final Year PG in Biostatistics. My thesis is
based on a count data. I am trying to fit the data using HMM.
I have the count of new infectives each month. I am not considering any
other covariates. I am using the 'chidden(repeated package)'. Can
you explain about the estimation of the parameters. And how to estimate the
initial values of 'mu' and 'pgamma'.
I will be grateful to you for the help.
Thanking You,
Yours Faithfuly
 Regina M.Verghis




-- 
[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R-excel

2007-06-25 Thread Erika Frigo

Good morning to everybody,
I have a problem : how can I import excel files in R???

thank you very much


Dr.sa. Erika Frigo
Università degli Studi di Milano
Facoltà di Medicina Veterinaria
Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
(VSA)
 
Via Grasselli, 7
20137 Milano
Tel. 02/50318515
Fax 02/50318501
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] JRI and Axis Web Service

2007-06-25 Thread Rajarshi Guha

On Jun 24, 2007, at 7:58 PM, Yifan (Eric) Jiang wrote:

 I've been asked to develop a Java Axis web service to retrieve an
 R-script file from the client side and then using JRI jar file in  
 order
 to call the R program that installed on the web service server. After
 reading the online documentation, I've successfully installed the R
 program with rJava and JRI packages. In addition, I can call the R
 program to run the R-script by using org.rosuda.JRI.Rengine.  
 Everything
 is running fine if this program is running as a normal Java  
 application.
 However, I fail to obtain any return when I was trying to consume this
 method by using the Java Axis web service.



 So I am wondering if any one could share their experiences to using  
 JRI
 in Axis web service. Your helps mean a lot to me and I've been  
 struggled
 to fix this problem for days.

We have developed a distributed computational infrastructure using R  
(and JRI) as the backend coupled with AXIS web services and have  
built a number of clients on top of this.

You can browse the source code for the services from the Sourceforge  
repository located at
http://svn.sourceforge.net/viewvc/cicc-grid/cicc-grid/rws/trunk/  
(though the R code in the repository has not been updated recently)

Examples of what functionality is available via the web services can  
be found at http://www.chembiogrid.org/projects/proj_statistics.html

The page also lists a number of clients that make use of the web  
service infrastructure.

---
Rajarshi Guha  [EMAIL PROTECTED]
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04  06F7 1BB9 E634 9B87 56EE
---
I'm related to people I don't relate to.
 -Calvin

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Prof Brian Ripley
On Mon, 25 Jun 2007, Vivek Menon wrote:

 uname -a gives me this:==
 Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007 ppc64
 ppc64 ppc64 GNU/Linux
 ===
 Also when I configure I see the foll. output:
 
 R is now configured for powerpc64-unknown-linux-gnu

That might be the problem: 'powerpc64' not 'ppc64'.  What Linux distro is 
this?

 Source directory:  .
 Installation directory:/usr/local

 C compiler:gcc -std=gnu99  -g -O2
 Fortran 77 compiler:   gfortran  -g -O2

 C++ compiler:  g++  -g -O2
 Fortran 90/95 compiler:gfortran -g -O2
 Obj-C compiler:

 Interfaces supported:
 External libraries:readline
 Additional capabilities:   PNG, iconv, MBCS, NLS
 Options enabled:   shared BLAS, R profiling, Java

 Recommended packages:  yes
 
 Do you have any suggestions??

And what is the setting of the flags I mentioned?  See the manual I 
pointed you to, or the Makeconf file?


 Thanks,
 Vivek
 On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
 
 Is this ppc32 or ppc64?  (What does uname -a say?)
 
 If the former, you might need to set CPICFLAGS and FPICFLAGS to -fPIC
 (rather than -fpic): please look these up in the R-admin.html file (which
 INSTALL points you to).
 
 For ppc64 configure should have found -fPIC.
 
 On Mon, 25 Jun 2007, Vivek Menon wrote:
 
  Hello everybody,I am having an error while compiling R-2.5.0 on Linux
  powerpc.
  This is what I see when I do a make:
 
 
  gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
 devNull.o
  devPicTeX.o devPS.o devQuartz.o init.o
  ../../../../library/grDevices/libs/grDevices.so is unchanged
  make[5]: Leaving directory
  `/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'
 
  make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
  /src/library/grDevices/src'
  Warning: unable to load shared library '/home/vivekv/sw_alg/R-2.5.0
  /modules//lapack.so':
   /home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24 relocation
 at
  0x0e65d7e4 for symbol `strlen' out of range
  Error in solve.default(rgb) : lapack routines cannot be loaded
  Error: unable to load R code in package 'grDevices'
  Execution halted
  make[3]: *** [all] Error 1
  make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
  /src/library/grDevices'
  make[2]: *** [R] Error 1
  make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0/src/library'
  make[1]: *** [R] Error 1
  make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
  make: *** [R] Error 1
 
  Please let me know what needs to be done for a successful installation.
  Thanks,
  Vivek
 
[[alternative HTML version deleted]]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 
 --
 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
 


-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] transposing data.frames

2007-06-25 Thread Christoph Heibl
Hello,
This must be simple...
Thanks a lot
- Christoph

# Imagine you have a list, e.g:

K - list(1:10, 2:11, 9:18)
K

# Transforming to dataframe...

KK - as.data.frame(K)

# ... one obtaines the list elements as column.

KK

# But I need the list elements as rows
# How can I achieve this? Is there a simple way to transpose  
data.frames?

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] gam function in the mgcv library

2007-06-25 Thread Simon Wood
On Monday 25 June 2007 13:26, Bill Wheeler wrote:
 I would like to fit a logistic regression using a smothing spline, where
 the spline is a piecewise cubic polynomial. Is the knots option used to
 define the subintervals for each piece of the cubic spline? 
- if you use something like 
gam(y~s(x,bs=cr,k=5),family=binomial,knots=list(x=c(0,.1,.3,.4,.8))
then yes, k is the number of knots and the `knots' list specifies where they 
occur. If you use the default `bs=tp' then the spline basis functions are 
not really `knot' based, being instead an ordered set of eigenfunctions, that 
are optimal in a defined sense (see Wood, 2003, JRSSB).

 If yes and 
 there are k knots, then why does the coefficients field in the returned
 object from gam only list k coefficients? Shouldn't there be 4k -4
 coefficients?

A k knot natural cubic spline only has k free coefficients, so that is all 
that mgcv:gam reports. If you are thinking about sections of cubic, then the 
other 3 coefficients of each section are determined by the spline  continuity 
conditions + the conditions of having zero second derivative at the end 
knots. Exact details of the `mgcv' cr basis are given in section 4.1.2 of 
my 2006  book (see ?gam), but all you really need to know is that it's a 
natural cubic spline basis parameterized in terms of function heights at the 
knots (although there  is a gam identifiability constraint absorbed into the 
parameterization which muddies this neat interpretability a little). 

best,
Simon


 Sincerely,

 Bill


 -

   [[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html and provide commented, minimal,
 self-contained, reproducible code.

-- 
 Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
 +44 1225 386603  www.maths.bath.ac.uk/~sw283

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Stefan Grosse
http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets

plus there is a package xlsReadWrite that might be of your interest.

Stefan

 Original Message  
Subject: [R] R-excel
From: Erika Frigo [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Date: 25.06.2007 14:47
 Good morning to everybody,
 I have a problem : how can I import excel files in R???

 thank you very much


 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
 (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]

   
 

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
   
 

 No virus found in this incoming message.
 Checked by AVG Free Edition. 
 Version: 7.5.472 / Virus Database: 269.9.6/865 - Release Date: 24.06.2007 
 08:33


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Vivek Menon
uname -a gives me this:==
Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007 ppc64
ppc64 ppc64 GNU/Linux
===
Also when I configure I see the foll. output:

R is now configured for powerpc64-unknown-linux-gnu

  Source directory:  .
  Installation directory:/usr/local

  C compiler:gcc -std=gnu99  -g -O2
  Fortran 77 compiler:   gfortran  -g -O2

  C++ compiler:  g++  -g -O2
  Fortran 90/95 compiler:gfortran -g -O2
  Obj-C compiler:

  Interfaces supported:
  External libraries:readline
  Additional capabilities:   PNG, iconv, MBCS, NLS
  Options enabled:   shared BLAS, R profiling, Java

  Recommended packages:  yes

Do you have any suggestions??
Thanks,
Vivek
On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:

 Is this ppc32 or ppc64?  (What does uname -a say?)

 If the former, you might need to set CPICFLAGS and FPICFLAGS to -fPIC
 (rather than -fpic): please look these up in the R-admin.html file (which
 INSTALL points you to).

 For ppc64 configure should have found -fPIC.

 On Mon, 25 Jun 2007, Vivek Menon wrote:

  Hello everybody,I am having an error while compiling R-2.5.0 on Linux
  powerpc.
  This is what I see when I do a make:
 
 
  gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
 devNull.o
  devPicTeX.o devPS.o devQuartz.o init.o
  ../../../../library/grDevices/libs/grDevices.so is unchanged
  make[5]: Leaving directory
  `/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'
 
  make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
  /src/library/grDevices/src'
  Warning: unable to load shared library '/home/vivekv/sw_alg/R-2.5.0
  /modules//lapack.so':
   /home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24 relocation
 at
  0x0e65d7e4 for symbol `strlen' out of range
  Error in solve.default(rgb) : lapack routines cannot be loaded
  Error: unable to load R code in package 'grDevices'
  Execution halted
  make[3]: *** [all] Error 1
  make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
  /src/library/grDevices'
  make[2]: *** [R] Error 1
  make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0/src/library'
  make[1]: *** [R] Error 1
  make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
  make: *** [R] Error 1
 
  Please let me know what needs to be done for a successful installation.
  Thanks,
  Vivek
 
[[alternative HTML version deleted]]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
  and provide commented, minimal, self-contained, reproducible code.
 


 --
 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


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] transposing data.frames

2007-06-25 Thread Stefan Grosse

 Original Message  
Subject: [R] transposing data.frames
From: Christoph Heibl [EMAIL PROTECTED]
To: R-help@stat.math.ethz.ch
Date: 25.06.2007 15:13
 Hello,
 This must be simple...
 Thanks a lot
 - Christoph

 # Imagine you have a list, e.g:

 K - list(1:10, 2:11, 9:18)
 K

 # Transforming to dataframe...

 KK - as.data.frame(K)

 # ... one obtaines the list elements as column.

 KK

 # But I need the list elements as rows
 # How can I achieve this? Is there a simple way to transpose  
 data.frames?
   

yes:
t(as.data.frame(K))

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] transposing data.frames

2007-06-25 Thread David Barron
t(KK) will transpose your data frame

On 25/06/07, Christoph Heibl [EMAIL PROTECTED] wrote:
 Hello,
 This must be simple...
 Thanks a lot
 - Christoph

 # Imagine you have a list, e.g:

 K - list(1:10, 2:11, 9:18)
 K

 # Transforming to dataframe...

 KK - as.data.frame(K)

 # ... one obtaines the list elements as column.

 KK

 # But I need the list elements as rows
 # How can I achieve this? Is there a simple way to transpose
 data.frames?

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Vivek Menon


  uname -a gives me this:==
  Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007
 ppc64
  ppc64 ppc64 GNU/Linux
  ===
  Also when I configure I see the foll. output:
  
  R is now configured for powerpc64-unknown-linux-gnu

 That might be the problem: 'powerpc64' not 'ppc64'.  What Linux distro is
 this?


I am using Yellow Dog Linux distro.

 Source directory:  .
  Installation directory:/usr/local
 
  C compiler:gcc -std=gnu99  -g -O2
  Fortran 77 compiler:   gfortran  -g -O2
 
  C++ compiler:  g++  -g -O2
  Fortran 90/95 compiler:gfortran -g -O2
  Obj-C compiler:
 
  Interfaces supported:
  External libraries:readline
  Additional capabilities:   PNG, iconv, MBCS, NLS
  Options enabled:   shared BLAS, R profiling, Java
 
  Recommended packages:  yes
  
  Do you have any suggestions??

 And what is the setting of the flags I mentioned?  See the manual I
 pointed you to, or the Makeconf file?


I checked the Makeconf file and found the following settings:
CPICFLAGS = -fpic
FPICFLAGS = -fpic


Thanks,
Vivek


 Thanks,
  Vivek
  On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
 
  Is this ppc32 or ppc64?  (What does uname -a say?)
 
  If the former, you might need to set CPICFLAGS and FPICFLAGS to -fPIC
  (rather than -fpic): please look these up in the R-admin.html file
 (which
  INSTALL points you to).
 
  For ppc64 configure should have found -fPIC.
 
  On Mon, 25 Jun 2007, Vivek Menon wrote:
 
   Hello everybody,I am having an error while compiling R-2.5.0 on Linux
   powerpc.
   This is what I see when I do a make:
  
  
   gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
  devNull.o
   devPicTeX.o devPS.o devQuartz.o init.o
   ../../../../library/grDevices/libs/grDevices.so is unchanged
   make[5]: Leaving directory
   `/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'
  
   make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
   /src/library/grDevices/src'
   Warning: unable to load shared library '/home/vivekv/sw_alg/R-2.5.0
   /modules//lapack.so':
/home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24
 relocation
  at
   0x0e65d7e4 for symbol `strlen' out of range
   Error in solve.default(rgb) : lapack routines cannot be loaded
   Error: unable to load R code in package 'grDevices'
   Execution halted
   make[3]: *** [all] Error 1
   make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
   /src/library/grDevices'
   make[2]: *** [R] Error 1
   make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0/src/library'
   make[1]: *** [R] Error 1
   make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
   make: *** [R] Error 1
  
   Please let me know what needs to be done for a successful
 installation.
   Thanks,
   Vivek
  
 [[alternative HTML version deleted]]
  
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide http://www.R-project.org/posting-
  guide.html
   and provide commented, minimal, self-contained, reproducible code.
  
 
 
  --
  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
 
 



[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Vivek Menon
After setting the flags to -fPIC using ./configure --with-x=no
--with-lapack=/apps/lib/LAPACK/lapack_LINUX.a CPICFLAGS=-fPIC
FPICFLAGS=-fPIC
I still get the following errors:cc -std=gnu99 -shared -L/usr/local/lib -o
grDevices.so chull.o devNull.o devPicTeX.o devPS.o devQuartz.o init.o
make[5]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices/src'
make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices/src'
Warning: unable to load shared library '/home/vivekv/sw_alg/R-2.5.0
/modules//lapack.so':
  /home/vivekv/sw_alg/R-2.5.0/modules//lapack.so: R_PPC_REL24 relocation at
0x0e65d864 for symbol `strlen' out of range
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'
Execution halted
make[3]: *** [all] Error 1
make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src/library'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
make: *** [R] Error 1
-
Thanks,
Vivek



   uname -a gives me this:==
   Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007
  ppc64
   ppc64 ppc64 GNU/Linux
   ===
   Also when I configure I see the foll. output:
   
   R is now configured for powerpc64-unknown-linux-gnu
 
  That might be the problem: 'powerpc64' not 'ppc64'.  What Linux distro
  is
  this?



 I am using Yellow Dog Linux distro.

  Source directory:  .
   Installation directory:/usr/local
  
   C compiler:gcc -std=gnu99  -g -O2
   Fortran 77 compiler:   gfortran  -g -O2
  
   C++ compiler:  g++  -g -O2
   Fortran 90/95 compiler:gfortran -g -O2
   Obj-C compiler:
  
   Interfaces supported:
   External libraries:readline
   Additional capabilities:   PNG, iconv, MBCS, NLS
   Options enabled:   shared BLAS, R profiling, Java
  
   Recommended packages:  yes
   
   Do you have any suggestions??
 
  And what is the setting of the flags I mentioned?  See the manual I
  pointed you to, or the Makeconf file?



 I checked the Makeconf file and found the following settings:
 CPICFLAGS = -fpic
 FPICFLAGS = -fpic


 Thanks,
 Vivek


  Thanks,
   Vivek
   On 6/25/07, Prof Brian Ripley  [EMAIL PROTECTED] wrote:
  
   Is this ppc32 or ppc64?  (What does uname -a say?)
  
   If the former, you might need to set CPICFLAGS and FPICFLAGS to -fPIC
   (rather than -fpic): please look these up in the R-admin.html file
  (which
   INSTALL points you to).
  
   For ppc64 configure should have found -fPIC.
  
   On Mon, 25 Jun 2007, Vivek Menon wrote:
  
Hello everybody,I am having an error while compiling R-2.5.0 on
  Linux
powerpc.
This is what I see when I do a make:
   
   
gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
   devNull.o
devPicTeX.o devPS.o devQuartz.o init.o
../../../../library/grDevices/libs/grDevices.so is unchanged
make[5]: Leaving directory
`/home/vivekv/sw_alg/R- 2.5.0/src/library/grDevices/src'
   
make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices/src'
Warning: unable to load shared library '/home/vivekv/sw_alg/R-
  2.5.0
/modules//lapack.so':
 /home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24
  relocation
   at
0x0e65d7e4 for symbol `strlen' out of range
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'
Execution halted
make[3]: *** [all] Error 1
make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0
  /src/library'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
make: *** [R] Error 1
   
Please let me know what needs to be done for a successful
  installation.
Thanks,
Vivek
   
  [[alternative HTML version deleted]]
   
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-
   guide.html
and provide commented, minimal, self-contained, reproducible code.
   
  
  
   --
   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
  
  
 
 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list

Re: [R] fractional calculations

2007-06-25 Thread Prof Brian Ripley
On Mon, 25 Jun 2007, Henrique Dallazuanna wrote:

 require(MASS)
 ?as.fractions
 as.fractions(1/2+1/8)

I think Federico wanted

1/as.fractions(2) + 1/as.fractions(8)

that is avoiding computing 1/8 in float (although it is exact).

You might be better off with package gmp:

 1/as.bigq(2) + 1/as.bigq(8)
[1] 5/8

allows you to handle arbitrarily large fractions.


-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R behaviour related to user input (readline()) and run selection

2007-06-25 Thread Bernzweig, Bruce \(Consultant\)
When I run the below section of code I get the following error: 

 

   Error in if (co == A || co[1] == O) { : 

  missing value where TRUE/FALSE needed

 

When I run the code in two parts where I first get the user's input

then afterwards run the if/else section, there is no problem.

 

Is there a way to stop the run selection process until the user

has input a value?

 


-



   calc_option - function(){

  msg - cat(Please select an option:\n, 'O'ne or 'A'll':
)

  co - readline(msg)

  

  switch(co,

 O = O, o = O,

 A = A, a = A

  )

   }

   

   co - calc_option()



   if (co == A || co[1] == O) {

  print(paste(calc_option = , co))

   } else {

  print(calc_option is not acceptable)

   }





Thanks,



- Bruce



**
Please be aware that, notwithstanding the fact that the pers...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Prof Brian Ripley
On Mon, 25 Jun 2007, Vivek Menon wrote:

 
 
  uname -a gives me this:==
  Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007
 ppc64
  ppc64 ppc64 GNU/Linux
  ===
  Also when I configure I see the foll. output:
  
  R is now configured for powerpc64-unknown-linux-gnu
 
 That might be the problem: 'powerpc64' not 'ppc64'.  What Linux distro is
 this?


 I am using Yellow Dog Linux distro.

 Source directory:  .
  Installation directory:/usr/local
 
  C compiler:gcc -std=gnu99  -g -O2
  Fortran 77 compiler:   gfortran  -g -O2
 
  C++ compiler:  g++  -g -O2
  Fortran 90/95 compiler:gfortran -g -O2
  Obj-C compiler:
 
  Interfaces supported:
  External libraries:readline
  Additional capabilities:   PNG, iconv, MBCS, NLS
  Options enabled:   shared BLAS, R profiling, Java
 
  Recommended packages:  yes
  
  Do you have any suggestions??
 
 And what is the setting of the flags I mentioned?  See the manual I
 pointed you to, or the Makeconf file?


 I checked the Makeconf file and found the following settings:
 CPICFLAGS = -fpic
 FPICFLAGS = -fpic

So my comment in the first reply applied, since it looks like your distro 
is using an unusual name.  You need to change these (and in etc/Makeconf).

 Thanks,
 Vivek


 Thanks,
  Vivek
  On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
 
  Is this ppc32 or ppc64?  (What does uname -a say?)
 
  If the former, you might need to set CPICFLAGS and FPICFLAGS to -fPIC
  (rather than -fpic): please look these up in the R-admin.html file
 (which
  INSTALL points you to).
 
  For ppc64 configure should have found -fPIC.
 
  On Mon, 25 Jun 2007, Vivek Menon wrote:
 
   Hello everybody,I am having an error while compiling R-2.5.0 on Linux
   powerpc.
   This is what I see when I do a make:
  
  
   gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
  devNull.o
   devPicTeX.o devPS.o devQuartz.o init.o
   ../../../../library/grDevices/libs/grDevices.so is unchanged
   make[5]: Leaving directory
   `/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'
  
   make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
   /src/library/grDevices/src'
   Warning: unable to load shared library '/home/vivekv/sw_alg/R-2.5.0
   /modules//lapack.so':
/home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24
 relocation
  at
   0x0e65d7e4 for symbol `strlen' out of range
   Error in solve.default(rgb) : lapack routines cannot be loaded
   Error: unable to load R code in package 'grDevices'
   Execution halted
   make[3]: *** [all] Error 1
   make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
   /src/library/grDevices'
   make[2]: *** [R] Error 1
   make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0/src/library'
   make[1]: *** [R] Error 1
   make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
   make: *** [R] Error 1
  
   Please let me know what needs to be done for a successful
 installation.
   Thanks,
   Vivek
  
 [[alternative HTML version deleted]]
  
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide http://www.R-project.org/posting-
  guide.html
   and provide commented, minimal, self-contained, reproducible code.
  
 
 
  --
  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
 
 
 
 


-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Vivek Menon
I did not get what you replied in the previous email. I still get the same
error with CPICFLAGS and FPICFLAGS set to -fPIC.
Vivek

On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:

 On Mon, 25 Jun 2007, Vivek Menon wrote:

 
 
   uname -a gives me this:==
   Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007
  ppc64
   ppc64 ppc64 GNU/Linux
   ===
   Also when I configure I see the foll. output:
   
   R is now configured for powerpc64-unknown-linux-gnu
 
  That might be the problem: 'powerpc64' not 'ppc64'.  What Linux distro
 is
  this?
 
 
  I am using Yellow Dog Linux distro.
 
  Source directory:  .
   Installation directory:/usr/local
  
   C compiler:gcc -std=gnu99  -g -O2
   Fortran 77 compiler:   gfortran  -g -O2
  
   C++ compiler:  g++  -g -O2
   Fortran 90/95 compiler:gfortran -g -O2
   Obj-C compiler:
  
   Interfaces supported:
   External libraries:readline
   Additional capabilities:   PNG, iconv, MBCS, NLS
   Options enabled:   shared BLAS, R profiling, Java
  
   Recommended packages:  yes
   
   Do you have any suggestions??
 
  And what is the setting of the flags I mentioned?  See the manual I
  pointed you to, or the Makeconf file?
 
 
  I checked the Makeconf file and found the following settings:
  CPICFLAGS = -fpic
  FPICFLAGS = -fpic

 So my comment in the first reply applied, since it looks like your distro
 is using an unusual name.  You need to change these (and in etc/Makeconf).

  Thanks,
  Vivek
 
 
  Thanks,
   Vivek
   On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
  
   Is this ppc32 or ppc64?  (What does uname -a say?)
  
   If the former, you might need to set CPICFLAGS and FPICFLAGS to
 -fPIC
   (rather than -fpic): please look these up in the R-admin.html file
  (which
   INSTALL points you to).
  
   For ppc64 configure should have found -fPIC.
  
   On Mon, 25 Jun 2007, Vivek Menon wrote:
  
Hello everybody,I am having an error while compiling R-2.5.0 on
 Linux
powerpc.
This is what I see when I do a make:
   
   
gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
   devNull.o
devPicTeX.o devPS.o devQuartz.o init.o
../../../../library/grDevices/libs/grDevices.so is unchanged
make[5]: Leaving directory
`/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'
   
make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices/src'
Warning: unable to load shared library '/home/vivekv/sw_alg/R-
 2.5.0
/modules//lapack.so':
 /home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24
  relocation
   at
0x0e65d7e4 for symbol `strlen' out of range
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'
Execution halted
make[3]: *** [all] Error 1
make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0
 /src/library'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
make: *** [R] Error 1
   
Please let me know what needs to be done for a successful
  installation.
Thanks,
Vivek
   
  [[alternative HTML version deleted]]
   
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-
   guide.html
and provide commented, minimal, self-contained, reproducible code.
   
  
  
   --
   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
  
  
 
 
 

 --
 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


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] how to plot this?

2007-06-25 Thread Weiwei Shi
Hi, there:

Suppose I have a couple of data.frames and each one has five columns
(one for x-axis, two for y-axis and two for std of y's.) There is
another dimensions (besides x and y) which is continuous. My question
is, how to plot such series of data frames in one plot (thus,
3-dimensional plot) AND multiple 2-D plots. I am not familar with R's
plotting utilities.

Thanks.

-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

Did you always know?
No, I did not. But I believed...
---Matrix III

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] eps in odfWeave

2007-06-25 Thread Dieter Menne
Dear Weavers,

Does someone have an example of using eps or any other vector graphics with
odfWeave? It tried the example below (and commented variants) with
simple.odt in the examples directory, and got an error.

Dieter


#---
library(odfWeave)
plotInfo - getImageDefs()
plotInfo$type = eps
#plotInfo$device = postscript
setImageDefs(plotInfo)
odfWeave(simple.odt, simpleOut.odt)
#-

#  Writing to file content_1.xml
#  Processing code chunks ...
#1 : term hide(label=loadLibs)
#2 : term xml(label=showOutputList)
#Error in check(options) : invalid value for 'type' : eps

Version: 0.5.9
Date: 2007-20-06

platform   i386-pc-mingw32
arch   i386
os mingw32
system i386, mingw32
status
major  2
minor  5.0
year   2007
month  04
day23
svn rev41293
language   R
version.string R version 2.5.0 (2007-04-23)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-2.5.0 compilation problem on Linux powerpc

2007-06-25 Thread Prof Brian Ripley
On Mon, 25 Jun 2007, Vivek Menon wrote:

 I did not get what you replied in the previous email. I still get the same
 error with CPICFLAGS and FPICFLAGS set to -fPIC.

And a completely fresh build?

 Vivek

 On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
 
 On Mon, 25 Jun 2007, Vivek Menon wrote:
 
 
 
   uname -a gives me this:==
   Linux  2.6.21.1-xserve #17 SMP Thu Jun 14 19:45:57 MDT 2007
  ppc64
   ppc64 ppc64 GNU/Linux
   ===
   Also when I configure I see the foll. output:
   
   R is now configured for powerpc64-unknown-linux-gnu
 
  That might be the problem: 'powerpc64' not 'ppc64'.  What Linux distro
 is
  this?
 
 
  I am using Yellow Dog Linux distro.
 
  Source directory:  .
   Installation directory:/usr/local
  
   C compiler:gcc -std=gnu99  -g -O2
   Fortran 77 compiler:   gfortran  -g -O2
  
   C++ compiler:  g++  -g -O2
   Fortran 90/95 compiler:gfortran -g -O2
   Obj-C compiler:
  
   Interfaces supported:
   External libraries:readline
   Additional capabilities:   PNG, iconv, MBCS, NLS
   Options enabled:   shared BLAS, R profiling, Java
  
   Recommended packages:  yes
   
   Do you have any suggestions??
 
  And what is the setting of the flags I mentioned?  See the manual I
  pointed you to, or the Makeconf file?
 
 
  I checked the Makeconf file and found the following settings:
  CPICFLAGS = -fpic
  FPICFLAGS = -fpic
 
 So my comment in the first reply applied, since it looks like your distro
 is using an unusual name.  You need to change these (and in etc/Makeconf).
 
  Thanks,
  Vivek
 
 
  Thanks,
   Vivek
   On 6/25/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
  
   Is this ppc32 or ppc64?  (What does uname -a say?)
  
   If the former, you might need to set CPICFLAGS and FPICFLAGS to
 -fPIC
   (rather than -fpic): please look these up in the R-admin.html file
  (which
   INSTALL points you to).
  
   For ppc64 configure should have found -fPIC.
  
   On Mon, 25 Jun 2007, Vivek Menon wrote:
  
Hello everybody,I am having an error while compiling R-2.5.0 on
 Linux
powerpc.
This is what I see when I do a make:
   
   
gcc -std=gnu99 -shared -L/usr/local/lib -o grDevices.so chull.o
   devNull.o
devPicTeX.o devPS.o devQuartz.o init.o
../../../../library/grDevices/libs/grDevices.so is unchanged
make[5]: Leaving directory
`/home/vivekv/sw_alg/R-2.5.0/src/library/grDevices/src'
   
make[4]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices/src'
Warning: unable to load shared library '/home/vivekv/sw_alg/R-
 2.5.0
/modules//lapack.so':
 /home/vivekv/sw_alg/R- 2.5.0/modules//lapack.so: R_PPC_REL24
  relocation
   at
0x0e65d7e4 for symbol `strlen' out of range
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'
Execution halted
make[3]: *** [all] Error 1
make[3]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0
/src/library/grDevices'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/vivekv/sw_alg/R- 2.5.0
 /src/library'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/vivekv/sw_alg/R-2.5.0/src'
make: *** [R] Error 1
   
Please let me know what needs to be done for a successful
  installation.
Thanks,
Vivek
   
  [[alternative HTML version deleted]]
   
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-
   guide.html
and provide commented, minimal, self-contained, reproducible code.
   
  
  
   --
   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
  
  
 
 
 
 
 --
 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
 


-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, 

Re: [R] R-excel

2007-06-25 Thread Sébastien
Hi,

Directly import from Excel files should be possible using the RODBC 
package. Yu may want to read the R data import/export manual about the 
RODBC package for further details.
Another solution is to save each of your Excel sheets as *.csv file and 
import the data in R using the read.table command (see ?read.table).

Sebastien

Erika Frigo a écrit :
 Good morning to everybody,
 I have a problem : how can I import excel files in R???

 thank you very much


 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
 (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]

   
 

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
   

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Imputing missing values in time series

2007-06-25 Thread Achim Zeileis
On Fri, 22 Jun 2007, Horace Tso wrote:

 Thanks to Mark and Erik for different versions of locf, also Erik's
 pointer to archive where I found another function due to Simon Fear. I
 haven't tested the zoo locf function.

Just as an addition to what Marc already wrote:

zoo offers at least two advantages here:
  - it does not break if the first element is NA
  - if available it incorporates the corresponding time stamps

When we wrote na.locf(), Gabor also tried to optimize it for speed. I
haven't compared it to the solutions suggested here but would be surprised
if any of them would substantially faster.

As for your time series, I would recommend that you hold it as a zoo
series with Date time stamps. See
  vignette(zoo-quickref, package = zoo)
  vignette(zoo, package = zoo)
for some examples of zoo series in general and na.locf() in particular.
Z

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] eps in odfWeave

2007-06-25 Thread Kuhn, Max
Dieter,

What is the version of odfWeave? If you use those specifications in the
current version (0.5.9):

 plotInfo - getImageDefs()
 plotInfo$type = eps
 plotInfo$device = postscript
 setImageDefs(plotInfo)
you will probabiliy need to set 
horizontal = FALSE, onefile = FALSE, and paper = special to generate
ps graphics for OpenOffice
an image size of 480 inches by 480 inches has been requested.
 setImageDefs(plotInfo)

When I run somewhat altered options:

 plotInfo - getImageDefs()
 plotInfo$type = eps
 plotInfo$plotWidth = 4
 plotInfo$plotHeight = 4
 plotInfo$device = postscript
 plotInfo$args = list(
+horizontal = FALSE, 
+onefile = FALSE, 
+paper = special)
 setImageDefs(plotInfo)
 
 demoFile - system.file(examples, simple.odt, package =
odfWeave)
 odfWeave(demoFile, c:/simpleOut.odt)
  Copying  C:/PROGRA~1/R/R250/library/odfWeave/examples/simple.odt 
  Setting wd to
C:\DOCUME~1\KuhnA03\LOCALS~1\Temp\Rtmpp4Zcsb/odfWeave25113622566 
snip
  Copying  simple.odt 
  Resetting wd
  Removing
C:\DOCUME~1\KuhnA03\LOCALS~1\Temp\Rtmpp4Zcsb/odfWeave25113622566 

  Done
 

There were some issues with eps and older versions of odfWeave, but I
don't recall that specific error. 

[The only other issue with eps and odfWeave (on windows), is image
rendering. On my system, there is a windows system file called convert
(instead of imagemagick's convert) which messes up the image preview
within the document. Marc Schwartz and I have talked about this off-list
and he doesn't have the same issues.]

Max
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dieter Menne
Sent: Monday, June 25, 2007 11:04 AM
To: R-Help
Subject: [R] eps in odfWeave

Dear Weavers,

Does someone have an example of using eps or any other vector graphics
with
odfWeave? It tried the example below (and commented variants) with
simple.odt in the examples directory, and got an error.

Dieter


#---
library(odfWeave)
plotInfo - getImageDefs()
plotInfo$type = eps
#plotInfo$device = postscript
setImageDefs(plotInfo)
odfWeave(simple.odt, simpleOut.odt)
#-

#  Writing to file content_1.xml
#  Processing code chunks ...
#1 : term hide(label=loadLibs)
#2 : term xml(label=showOutputList)
#Error in check(options) : invalid value for 'type' : eps

Version: 0.5.9
Date: 2007-20-06

platform   i386-pc-mingw32
arch   i386
os mingw32
system i386, mingw32
status
major  2
minor  5.0
year   2007
month  04
day23
svn rev41293
language   R
version.string R version 2.5.0 (2007-04-23)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

--
LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] a string to enviroment or function

2007-06-25 Thread Weiwei Shi
Hi,

I am wondering how to make a function Fun to make the following work:

t0 - (paste(hgu133a, ENTREZID, sep=))
xx - as.list(Fun(t0)) # make it work like xx-as.list(hgu133aENTREZID)

thanks,
-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

Did you always know?
No, I did not. But I believed...
---Matrix III

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] problem building first package

2007-06-25 Thread Richard Chandler
Hi,

I am trying to build a package from source for the first time. I'm
using Windows XP. After R CMD INSTALL or R CMD check I get an error
message that I don't understand. I've tried to follow the instrucions
provided in the R Installation and Administration .pdf and the text
file that comes with Rtools, but most of this is new to me and clearly
I'm missing something. Here's what I've done:

-Downloaded perl and Rtools and put them in my c directory
-Used package.skeleton() to set up the package structure and put the
package-to-be removal in C:\toBuild
-I edited my path to :
C:\Rtools\bin;C:\perl\bin;C:\Rtools\MinGW\bin;C:\R-2.5.0\bin;...
-I changed the following in the MkRules file:
1)HEADER=C:/Rtools/MinGW/include
2)HELPTYPES = -txt
3)WINHELP = NO
4)HEADER=C:/Rtools/MinGW/include
5)R_EXE=C:/R-2.5.0/bin/R.exe
-Next, I opened up a command prompt and went to c:/toBuild
-Then I ran: R CMD build removal. No problems.
-Then I ran: R CMD INSTALL removal_1.0.tar.gz
and got this:
-
installing to 'c:/R-2.5.0/library'

latex: not found
latex: not found
latex: not found

-- Making package removal 
latex: not found
  adding build stamp to DESCRIPTION
latex: not found
latex: not found
latex: not found
  installing R files
latex: not found
  installing data files
latex: not found
  installing man source files
  installing indices
latex: not found
latex: not found
  not zipping data
  installing help
  Building/Updating help pages for package 'removal'
 Formats: text chm
  RemProbs  text   chm
  add.error text   chm
  error.plottext   chm
  firstDetect   text   chm
  funs  text   chm
  path  text   chm
  pll2  text   chm
  remll2text   chm
  removal-package   text   chm
  removal2  text   chm
  var.d text   chm
hhc: not found
cp: cannot stat `C:/toBuild/R.INSTALL.3064/removal/chm/removal.chm':
No such fil
e or directory
make[1]: *** [chm-removal] Error 1
make: *** [pkg-removal] Error 2
*** Installation of removal failed ***

Removing 'c:/R-2.5.0/library/removal'
---

I don't know what hhc is. I'm guessing its trying to build the
compiled help files even though I tried to ask for only text files. It
also seems to want latex even though I read that it isn't necessary to
build simple packages. Can someone please tell me what I'm doing
wrong? Thanks.

Richard


-- 
Richard Chandler, PhD student
Department of Natural Resources Conservation
UMass Amherst
(413)545-1237

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] eps in odfWeave

2007-06-25 Thread Dieter Menne
Kuhn, Max Max.Kuhn at pfizer.com writes:

Thanks, Max.

 What is the version of odfWeave? If you use those specifications in the
 current version (0.5.9):

Yes, version 0.5.9 (it was further below in my message, I forgot to put the
odfWeave flag before it.

I had tried your horizontal... suggestions before, because these came up nicely
in the error message, but the error remained the same, so I removed them. Here
another try for copy/paste, with a traceback. 

The convert problem is a well known Imagemagick problem; clashes with convert
in the Windows directory. Workaround is to put the Imagemagick path before the
Windows/system32 path.

Dieter


library(odfWeave)
plotInfo - getImageDefs()
plotInfo$type = eps
plotInfo$plotWidth = 4
plotInfo$plotHeight = 4
plotInfo$device = postscript
plotInfo$args = list(
horizontal = FALSE,
onefile = FALSE,
paper = special)
setImageDefs(plotInfo)
demoFile - system.file(examples, simple.odt, package =odfWeave)
odfWeave(demoFile, c:/simpleOut.odt)

-
Error in check(options) : invalid value for 'type' : eps


 traceback()
5: stop(gettextf(invalid value for '%s' : %s, opt, oldval), domain = NA)
4: check(options)
3: SweaveParseOptions(chunkopts, drobj$options, driver$checkopts)
2: Sweave(file = rnwFileName, output = content_1.xml, quiet = 
!control$verbose,
   driver = RweaveOdf(), control = control)
1: odfWeave(demoFile, c:/simpleOut.odt)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] simultaneous actions of grep ???

2007-06-25 Thread Ana Patricia Martins
Hello R-users and developers,

Once again, I'm asking for your help.

There is other way to do the same more easily for applied simultaneous
grep???
  
c-subset(c,!rownames(c) %in% grep(.1,rownames(c),value=T))
c-subset(c,!rownames(c) %in% grep(.5,rownames(c),value=T))
c-subset(c,!rownames(c) %in% grep(.6,rownames(c),value=T))
c-subset(c,!rownames(c) %in% grep(.9,rownames(c),value=T))

Thanks in advance for helping me.

Atenciosamente,
Ana Patricia Martins
---
Serviço Métodos Estatísticos
Departamento de Metodologia Estatística
INE - Portugal
Telef:  218 426 100 - Ext: 3210
E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a string to enviroment or function

2007-06-25 Thread jim holtman
I think that you might want:

t0 - (paste(hgu133a, ENTREZID, sep=))
xx - as.list(get(t0)) # make it work like xx-as.list(hgu133aENTREZID)




On 6/25/07, Weiwei Shi [EMAIL PROTECTED] wrote:

 Hi,

 I am wondering how to make a function Fun to make the following work:

 t0 - (paste(hgu133a, ENTREZID, sep=))
 xx - as.list(Fun(t0)) # make it work like xx-as.list(hgu133aENTREZID)

 thanks,
 --
 Weiwei Shi, Ph.D
 Research Scientist
 GeneGO, Inc.

 Did you always know?
 No, I did not. But I believed...
 ---Matrix III

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] manipulate a matrix

2007-06-25 Thread Jon Hak
I have read everything I can find on how to manipulate a results matrix in R 
and I have to admit I'm stumped.  I have set up a process to extract a dataset 
from ArcGIS to compute a similarity index (Jaccards) in Vegan.  The dataset is 
fairly simple, but large, and consists of rows = sample area, and columns = 
elements.  I've been able to view the results in R, but I want to get the 
results out to a database and a matrix that is 6000-rows x 6000-columns can be 
very difficult to manipulate in Windows XP.  I would to rotate the matrix so 
that the output would look like the old condensed format in programs like 
Conoco.  Ideally, I would like format to look something like this;


Site-row Site-col Jaccard
1   1   1
1   2   .9
1   3   .6
2   1   .9
2   2   1
2   3   .75

Thanks for any help,




***
John Hak
Senior GIS Analyst/Sr. Ecologist
NatureServe
4001 Discovery Drive 
Boulder, CO 80303
(703) 797-4809

There is perhaps no better demonstration of the folly of human conceits than 
this distant image of our tiny world. To me, it underscores our responsibility 
to deal more kindly with one another, and to preserve and cherish the pale blue 
dot, the only home we've ever known. --Carl Sagan
 

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Re : Half of a heatmap

2007-06-25 Thread Gavin Kelly
  I am trying to produce a heatmap of pairwise correlations, but
since the matrix is
 symmetric, I only need either the upper or the lower triangle.  I have 
 scoured the
 web and R documentation, but I have not been able to find a way to produce 
 such a
 figure.  Is there a simple way to produce a heat map with only the part above 
 or
 below the diagonal?

Can you not just set the lower or upper triangle to NAs, and pass this
on to heatmap - or am I misunderstanding you?

tmp - matrix(rnorm(100),10,10)
tmp[lower.tri(tmp)] - NA
heatmap(tmp, Rowv=NA, Colv=NA)

Regards - Gavin
--
Gavin Kelly
Senior Statistician, Bioinformatics  Biostatistics Group
Cancer Research UK

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R behaviour related to user input (readline()) and run selection

2007-06-25 Thread jim holtman
First of all you don't appear to be returning anything from your function,
so 'co' is NULL and your 'if' statement fails.  You were also probably
cut/paste the code in, and the readline was reading from the statements you
pasted.  Try sourcing in the code.

On 6/25/07, Bernzweig, Bruce (Consultant) [EMAIL PROTECTED] wrote:

 When I run the below section of code I get the following error:



   Error in if (co == A || co[1] == O) { :

  missing value where TRUE/FALSE needed



 When I run the code in two parts where I first get the user's input

 then afterwards run the if/else section, there is no problem.



 Is there a way to stop the run selection process until the user

 has input a value?



 
 -



   calc_option - function(){

  msg - cat(Please select an option:\n, 'O'ne or 'A'll':
 )

  co - readline(msg)



  switch(co,

 O = O, o = O,

 A = A, a = A

  )

   }



   co - calc_option()



   if (co == A || co[1] == O) {

  print(paste(calc_option = , co))

   } else {

  print(calc_option is not acceptable)

   }





 Thanks,



 - Bruce




 **
 Please be aware that, notwithstanding the fact that the pers...{{dropped}}


 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to plot this?

2007-06-25 Thread jim holtman
You might want to check out this link to the type of graphs that R can
produce and find one you like; the code will be with it.

http://addictedtor.free.fr/graphiques/allgraph.php


On 6/25/07, Weiwei Shi [EMAIL PROTECTED] wrote:

 Hi, there:

 Suppose I have a couple of data.frames and each one has five columns
 (one for x-axis, two for y-axis and two for std of y's.) There is
 another dimensions (besides x and y) which is continuous. My question
 is, how to plot such series of data frames in one plot (thus,
 3-dimensional plot) AND multiple 2-D plots. I am not familar with R's
 plotting utilities.

 Thanks.

 --
 Weiwei Shi, Ph.D
 Research Scientist
 GeneGO, Inc.

 Did you always know?
 No, I did not. But I believed...
 ---Matrix III

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to plot this?

2007-06-25 Thread jim holtman
You might want to check out this link to the type of graphs that R can
produce and find one you like; the code will be with it.

http://addictedtor.free.fr/graphiques/allgraph.php


On 6/25/07, Weiwei Shi [EMAIL PROTECTED] wrote:

 Hi, there:

 Suppose I have a couple of data.frames and each one has five columns
 (one for x-axis, two for y-axis and two for std of y's.) There is
 another dimensions (besides x and y) which is continuous. My question
 is, how to plot such series of data frames in one plot (thus,
 3-dimensional plot) AND multiple 2-D plots. I am not familar with R's
 plotting utilities.

 Thanks.

 --
 Weiwei Shi, Ph.D
 Research Scientist
 GeneGO, Inc.

 Did you always know?
 No, I did not. But I believed...
 ---Matrix III

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] degrees of freedom in lme

2007-06-25 Thread Jean-Baptiste Ferdy
Dear all,

I am starting to use the lme package (and plan to teach a course based on it 
next semester...). To understand what lme is doing precisely, I used balanced 
datasets described in Pinheiro and Bates and tried to compare the lme outputs 
to that of aov. Here is what I obtained:

 data(Machines)
 summary(aov(score~Machine+Error(Worker/Machine),data=Machines))
Error: Worker
  Df  Sum Sq Mean Sq F value Pr(F)
Residuals  5 1241.89  248.38

Error: Worker:Machine
  Df  Sum Sq Mean Sq F valuePr(F)
Machine2 1755.26  877.63  20.576 0.0002855 ***
Residuals 10  426.53   42.65
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: Within
  Df Sum Sq Mean Sq F value Pr(F)
Residuals 36 33.287   0.925
 anova(lme(fixed=score~Machine,random=~1|Worker/Machine,data=Machines))
numDF denDF  F-value p-value
(Intercept) 136 773.5709  .0001
Machine 210  20.5762   3e-04
  
No problem here: the results are essentially the same, which is expected. Now 
I turn to an ANCOVA with a random grouping factor.

 data(Orthodont)
 OrthoFem - Orthodont[Orthodont$Sex==Female,];
 summary(aov(distance~age+Error(Subject/age),data=OrthoFem))
Error: Subject
  Df  Sum Sq Mean Sq F value Pr(F)
Residuals 10 177.227  17.723

Error: Subject:age
  Df Sum Sq Mean Sq F valuePr(F)
age1 50.592  50.592  52.452 2.783e-05 ***
Residuals 10  9.645   0.965
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: Within
  Df Sum Sq Mean Sq F value Pr(F)
Residuals 22 9.8250  0.4466
 anova(lme(fixed=distance~age,random=~1+age|Subject,data=OrthoFem))
numDF denDF   F-value p-value
(Intercept) 132 1269.7764  .0001
age 132   52.4517  .0001

This time the F values are (almost) identical, the numerator degrees of 
freedom are the same, but the denominator degrees of freedom are very 
different (10 for aov vs. 32 for lme). I understand that there is an issue 
with the estimation of that number, but I would naively expect the number 
given by lme to be close to that provided by aov is the case of a balanced 
dataset. That's obviously not true in the case of an ANCOVA... But why?? And 
how should I interpret the F-test given by anova.lme?

Thanks in advance for your help !
-- 
Jean-Baptiste Ferdy
Institut des Sciences de l'Évolution de Montpellier
CNRS UMR 5554
Université Montpellier 2
34 095 Montpellier cedex 05
tel. +33 (0)4 67 14 42 27
fax  +33 (0)4 67 14 36 22

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] simultaneous actions of grep ???

2007-06-25 Thread Marc Schwartz
On Mon, 2007-06-25 at 17:15 +0100, Ana Patricia Martins wrote:
 Hello R-users and developers,
 
 Once again, I'm asking for your help.
 
 There is other way to do the same more easily for applied simultaneous
 grep???
   
 c-subset(c,!rownames(c) %in% grep(.1,rownames(c),value=T))
 c-subset(c,!rownames(c) %in% grep(.5,rownames(c),value=T))
 c-subset(c,!rownames(c) %in% grep(.6,rownames(c),value=T))
 c-subset(c,!rownames(c) %in% grep(.9,rownames(c),value=T))
 
 Thanks in advance for helping me.

One question might be what other possible values can the rownames take.

For example, if you want to check for '.9', but not for other values
containing a '9' after the decimal, something like the following should
work:

sub.c - subset(c, 
!rownames(c) %in% 
grep(\\.([156])|([9]{5}), rownames(c), 
 value = TRUE))

Otherwise, if you want to include anything with a '9' after a decimal,
the following would work:

sub.c - subset(c, 
!rownames(c) %in% 
grep(\\.[1569], rownames(c), value = TRUE))


See ?regex and the information there for some additional guidance. There
are also many regex references online, such as:

  http://www.regular-expressions.info/

BTW, it would be preferable not to use 'c' to name an object in R, since
c() is a function. While conflicts should, in general, not occur, it
eliminates such risk and makes for more easily readable code to not use
function names for objects.

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem building first package

2007-06-25 Thread Prof Brian Ripley
You can ignore the message about latex (and 2.5.1 RC does not give it).

hhc is part of HTML Help Workshop: you either have not installed that or 
not put it in your path.

The settings in MkRules affect the types of help for building R, not 'R 
CMD INSTALL'.  If you only want text help you need to run

R CMD INSTALL --docs=txt removal_1.0.tar.gz


On Mon, 25 Jun 2007, Richard Chandler wrote:

 Hi,

 I am trying to build a package from source for the first time. I'm
 using Windows XP. After R CMD INSTALL or R CMD check I get an error
 message that I don't understand. I've tried to follow the instrucions
 provided in the R Installation and Administration .pdf and the text
 file that comes with Rtools, but most of this is new to me and clearly
 I'm missing something. Here's what I've done:

 -Downloaded perl and Rtools and put them in my c directory
 -Used package.skeleton() to set up the package structure and put the
 package-to-be removal in C:\toBuild
 -I edited my path to :
 C:\Rtools\bin;C:\perl\bin;C:\Rtools\MinGW\bin;C:\R-2.5.0\bin;...
 -I changed the following in the MkRules file:
 1)HEADER=C:/Rtools/MinGW/include
 2)HELPTYPES = -txt
 3)WINHELP = NO
 4)HEADER=C:/Rtools/MinGW/include
 5)R_EXE=C:/R-2.5.0/bin/R.exe

The last two are for cross-building, not what you are doing.

 -Next, I opened up a command prompt and went to c:/toBuild
 -Then I ran: R CMD build removal. No problems.
 -Then I ran: R CMD INSTALL removal_1.0.tar.gz
 and got this:
 -
 installing to 'c:/R-2.5.0/library'

 latex: not found
 latex: not found
 latex: not found

 -- Making package removal 
 latex: not found
  adding build stamp to DESCRIPTION
 latex: not found
 latex: not found
 latex: not found
  installing R files
 latex: not found
  installing data files
 latex: not found
  installing man source files
  installing indices
 latex: not found
 latex: not found
  not zipping data
  installing help
  Building/Updating help pages for package 'removal'
 Formats: text chm
  RemProbs  text   chm
  add.error text   chm
  error.plottext   chm
  firstDetect   text   chm
  funs  text   chm
  path  text   chm
  pll2  text   chm
  remll2text   chm
  removal-package   text   chm
  removal2  text   chm
  var.d text   chm
 hhc: not found
 cp: cannot stat `C:/toBuild/R.INSTALL.3064/removal/chm/removal.chm':
 No such fil
 e or directory
 make[1]: *** [chm-removal] Error 1
 make: *** [pkg-removal] Error 2
 *** Installation of removal failed ***

 Removing 'c:/R-2.5.0/library/removal'
 ---

 I don't know what hhc is. I'm guessing its trying to build the
 compiled help files even though I tried to ask for only text files. It
 also seems to want latex even though I read that it isn't necessary to
 build simple packages. Can someone please tell me what I'm doing
 wrong? Thanks.

 Richard




-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] LanguageR pvals.fnc error message

2007-06-25 Thread Mike Ford
Hi. I get an error message about not converging when I try and use the 
pvals.fnc from the languageR library. The LMER analysis worked fine (See 
below).

I am not an expert so I don't understand why the LMER worked but not the 
pvals.fnc

Any help gratefully received.

- Mike

   AIC   BIC logLik MLdeviance REMLdeviance
 -7324 -7254   3673  -7451-7346
Random effects:
 Groups   NameVariance   Std.Dev.
 Item (Intercept) 5.3386e-05 0.0073066
 Subj (Intercept) 1.8073e-03 0.0425128
 Residual 1.0314e-02 0.1015578
number of obs: 4363, groups: Item, 294; Subj, 38

Fixed effects:
   Estimate Std. Error t value
(Intercept)   5.848e+00  7.830e-03   746.9
PrevErr1  3.835e-03  3.808e-03 1.0
ExpOrd   -3.708e-05  9.107e-06-4.1
pc4lex   -4.630e-04  1.681e-03-0.3
pc4img   -7.519e-04  1.642e-03-0.5
pc4nlen  -4.413e-03  1.608e-03-2.7
pc4lsa8.118e-04  1.648e-03 0.5
pc4ng   -5.183e-03  1.642e-03-3.2
I(pc4nlen^2)  2.999e-03  1.451e-03 2.1

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Re : Half of a heatmap

2007-06-25 Thread Brad McNeney
Just for the record, LDheatmap can display any upper-triangular matrix of
measures between 0 and 1, not just LD measures. Users with their own matrix
should pass it as the first argument (gdat) to the function.

-b

--
Brad McNeney
Statistics and Actuarial Science
Simon Fraser University
Burnaby, BC, Canada


On 6/25/07, Rosenfeld, Jeffrey [EMAIL PROTECTED] wrote:

 Thank you for your reply.  I have looked at LDheatmap, but it does not
 seem to do what I want and seems to only work well for LD data.  I was
 looking for something that would produce a figure identical to what
 heatmap.2 gives me, including the proper X and Y-axis labels and a
 dendogram, except that it would only have half of the map.  Preferably, it
 would have the Color Key in the place where the other triangle of the
 heatmap would be, to save space.


 Jeff


 -Original Message-
 From: Neil Shephard [mailto:[EMAIL PROTECTED]
 Sent: Mon 6/25/2007 6:14 AM
 To: r-help@stat.math.ethz.ch
 Cc: Rosenfeld, Jeffrey
 Subject: Re : [R] Half of a heatmap

  I am trying to produce a heatmap of pairwise correlations, but since the
 matrix is
  symmetric, I only need either the upper or the lower triangle.  I have
 scoured the
  web and R documentation, but I have not been able to find a way to
 produce such a
  figure.  Is there a simple way to produce a heat map with only the part
 above or
  below the diagonal?

 You might want to check out the LDheatmap() package which can generate
 the plots you describe.  The help indicates that it accepts a matrix
 of pair-wise linkage disequilibrium measures, one of which is R^2 (the
 correlation coefficient between loci), but I suspect you could simply
 pass it a matrix of correlation coefficents.

 Hope that helps,

 Neil
 --
 In mathematics you don't understand things. You just get used to
 them.  - Johann von Neumann

 Email - [EMAIL PROTECTED] / [EMAIL PROTECTED]
 Website - http://slack.ser.man.ac.uk/
 Photos - http://www.flickr.com/photos/slackline/

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] manipulate a matrix

2007-06-25 Thread jim holtman
Is this what you want?

 x
 [,1] [,2] [,3] [,4] [,5]
[1,]16   11   16   21
[2,]27   12   17   22
[3,]38   13   18   23
[4,]49   14   19   24
[5,]5   10   15   20   25
 cbind(row=as.vector(row(x)), col=as.vector(col(x)), value=as.vector(x))
  row col value
 [1,]   1   1 1
 [2,]   2   1 2
 [3,]   3   1 3
 [4,]   4   1 4
 [5,]   5   1 5
 [6,]   1   2 6
 [7,]   2   2 7
 [8,]   3   2 8
 [9,]   4   2 9
[10,]   5   210
[11,]   1   311
[12,]   2   312
[13,]   3   313
[14,]   4   314
[15,]   5   315
[16,]   1   416
[17,]   2   417
[18,]   3   418
[19,]   4   419
[20,]   5   420
[21,]   1   521
[22,]   2   522
[23,]   3   523
[24,]   4   524
[25,]   5   525




On 6/25/07, Jon Hak [EMAIL PROTECTED] wrote:

 I have read everything I can find on how to manipulate a results matrix in
 R and I have to admit I'm stumped.  I have set up a process to extract a
 dataset from ArcGIS to compute a similarity index (Jaccards) in Vegan.  The
 dataset is fairly simple, but large, and consists of rows = sample area, and
 columns = elements.  I've been able to view the results in R, but I want to
 get the results out to a database and a matrix that is 6000-rows x
 6000-columns can be very difficult to manipulate in Windows XP.  I would to
 rotate the matrix so that the output would look like the old condensed
 format in programs like Conoco.  Ideally, I would like format to look
 something like this;


 Site-row Site-col Jaccard
 1   1   1
 1   2   .9
 1   3   .6
 2   1   .9
 2   2   1
 2   3   .75

 Thanks for any help,




 ***
 John Hak
 Senior GIS Analyst/Sr. Ecologist
 NatureServe
 4001 Discovery Drive
 Boulder, CO 80303
 (703) 797-4809

 There is perhaps no better demonstration of the folly of human conceits
 than this distant image of our tiny world. To me, it underscores our
 responsibility to deal more kindly with one another, and to preserve and
 cherish the pale blue dot, the only home we've ever known. --Carl Sagan


 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] degrees of freedom in lme

2007-06-25 Thread Doran, Harold
This is such a common question that it has a an FAQ-like response from Doug 
Bates. Google lmer p-values and all that to find the response. 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Jean-Baptiste Ferdy
 Sent: Monday, June 25, 2007 12:26 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] degrees of freedom in lme
 
 Dear all,
 
 I am starting to use the lme package (and plan to teach a 
 course based on it next semester...). To understand what lme 
 is doing precisely, I used balanced datasets described in 
 Pinheiro and Bates and tried to compare the lme outputs to 
 that of aov. Here is what I obtained:
 
  data(Machines)
  summary(aov(score~Machine+Error(Worker/Machine),data=Machines))
 Error: Worker
   Df  Sum Sq Mean Sq F value Pr(F) Residuals  5 
 1241.89  248.38
 
 Error: Worker:Machine
   Df  Sum Sq Mean Sq F valuePr(F)
 Machine2 1755.26  877.63  20.576 0.0002855 ***
 Residuals 10  426.53   42.65
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 Error: Within
   Df Sum Sq Mean Sq F value Pr(F)
 Residuals 36 33.287   0.925
  
 anova(lme(fixed=score~Machine,random=~1|Worker/Machine,data=Machines))
 numDF denDF  F-value p-value
 (Intercept) 136 773.5709  .0001
 Machine 210  20.5762   3e-04
   
 No problem here: the results are essentially the same, which 
 is expected. Now I turn to an ANCOVA with a random grouping factor.
 
  data(Orthodont)
  OrthoFem - Orthodont[Orthodont$Sex==Female,];
  summary(aov(distance~age+Error(Subject/age),data=OrthoFem))
 Error: Subject
   Df  Sum Sq Mean Sq F value Pr(F) Residuals 10 
 177.227  17.723
 
 Error: Subject:age
   Df Sum Sq Mean Sq F valuePr(F)
 age1 50.592  50.592  52.452 2.783e-05 ***
 Residuals 10  9.645   0.965
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 Error: Within
   Df Sum Sq Mean Sq F value Pr(F) Residuals 22 9.8250  0.4466
  anova(lme(fixed=distance~age,random=~1+age|Subject,data=OrthoFem))
 numDF denDF   F-value p-value
 (Intercept) 132 1269.7764  .0001
 age 132   52.4517  .0001
 
 This time the F values are (almost) identical, the numerator 
 degrees of freedom are the same, but the denominator degrees 
 of freedom are very different (10 for aov vs. 32 for lme). I 
 understand that there is an issue with the estimation of that 
 number, but I would naively expect the number given by lme to 
 be close to that provided by aov is the case of a balanced 
 dataset. That's obviously not true in the case of an 
 ANCOVA... But why?? And how should I interpret the F-test 
 given by anova.lme?
 
 Thanks in advance for your help !
 --
 Jean-Baptiste Ferdy
 Institut des Sciences de l'Évolution de Montpellier CNRS UMR 
 5554 Université Montpellier 2
 34 095 Montpellier cedex 05
 tel. +33 (0)4 67 14 42 27
 fax  +33 (0)4 67 14 36 22
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] simultaneous actions of grep ???

2007-06-25 Thread Marc Schwartz
On Mon, 2007-06-25 at 11:58 -0500, Marc Schwartz wrote:
 On Mon, 2007-06-25 at 17:15 +0100, Ana Patricia Martins wrote:
  Hello R-users and developers,
  
  Once again, I'm asking for your help.
  
  There is other way to do the same more easily for applied simultaneous
  grep???

  c-subset(c,!rownames(c) %in% grep(.1,rownames(c),value=T))
  c-subset(c,!rownames(c) %in% grep(.5,rownames(c),value=T))
  c-subset(c,!rownames(c) %in% grep(.6,rownames(c),value=T))
  c-subset(c,!rownames(c) %in% grep(.9,rownames(c),value=T))
  
  Thanks in advance for helping me.
 
 One question might be what other possible values can the rownames take.
 
 For example, if you want to check for '.9', but not for other values
 containing a '9' after the decimal, something like the following should
 work:
 
 sub.c - subset(c, 
 !rownames(c) %in% 
 grep(\\.([156])|([9]{5}), rownames(c), 
  value = TRUE))
 
 Otherwise, if you want to include anything with a '9' after a decimal,
 the following would work:
 
 sub.c - subset(c, 
 !rownames(c) %in% 
 grep(\\.[1569], rownames(c), value = TRUE))
 
 
 See ?regex and the information there for some additional guidance. There
 are also many regex references online, such as:
 
   http://www.regular-expressions.info/
 
 BTW, it would be preferable not to use 'c' to name an object in R, since
 c() is a function. While conflicts should, in general, not occur, it
 eliminates such risk and makes for more easily readable code to not use
 function names for objects.

Quick possible correction:

I mis-read the regex as containing a decimal, which would need to be
escaped as I had. 

If your use of the '.' is to refer to any character, then the following
would be correct:

sub.c - subset(c, 
!rownames(c) %in% 
grep(.([156])|([9]{5}), rownames(c), 
 value = TRUE))

or

sub.c - subset(c, 
!rownames(c) %in% 
grep(.[1569], rownames(c), value = TRUE))


Sorry for the confusion.

Marc

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] manipulate a matrix

2007-06-25 Thread Marc Schwartz
On Mon, 2007-06-25 at 10:58 -0400, Jon Hak wrote:
 I have read everything I can find on how to manipulate a results
 matrix in R and I have to admit I'm stumped.  I have set up a process
 to extract a dataset from ArcGIS to compute a similarity index
 (Jaccards) in Vegan.  The dataset is fairly simple, but large, and
 consists of rows = sample area, and columns = elements.  I've been
 able to view the results in R, but I want to get the results out to a
 database and a matrix that is 6000-rows x 6000-columns can be very
 difficult to manipulate in Windows XP.  I would to rotate the matrix
 so that the output would look like the old condensed format in
 programs like Conoco.  Ideally, I would like format to look something
 like this;
 
 
 Site-row Site-col Jaccard
 1 1   1
 1 2   .9
 1 3   .6
 2 1   .9
 2 2   1
 2 3   .75
 
 Thanks for any help,

Presuming that your source matrix for the above is:

mat - matrix(c(1, .9, .6, .9, 1, .75), ncol = 3, byrow = TRUE)

 mat
 [,1] [,2] [,3]
[1,]  1.0  0.9 0.60
[2,]  0.9  1.0 0.75

You can use the following:

t.mat - t(mat)

Res - cbind(Site-row = as.vector(col(t.mat)), 
 Site-col = as.vector(row(t.mat)), 
 Jaccard = as.vector(t.mat))

 Res
 Site-row Site-col Jaccard
[1,]111.00
[2,]120.90
[3,]130.60
[4,]210.90
[5,]221.00
[6,]230.75

See ?t and ?row

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to plot this?

2007-06-25 Thread hadley wickham
On 6/25/07, jim holtman [EMAIL PROTECTED] wrote:
 You might want to check out this link to the type of graphs that R can
 produce and find one you like; the code will be with it.

 http://addictedtor.free.fr/graphiques/allgraph.php

Or for examples using the ggplot2 package:

http://had.co.nz/ggplot2

Hadley

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem building first package

2007-06-25 Thread Richard Chandler
Thanks so much. I was able to get it installed using:

R CMD INSTALL --docs=normal removal_1.0.tar.gz

However, setting --docs=txt gave me this error:

ERROR: invalid --docs value `txt'

The --help says it needs to be a list, but no matter, --docs=normal
worked fine.



Quoting Prof Brian Ripley [EMAIL PROTECTED]:

 You can ignore the message about latex (and 2.5.1 RC does not give
 it).

 hhc is part of HTML Help Workshop: you either have not installed
 that or
 not put it in your path.

 The settings in MkRules affect the types of help for building R,
 not 'R
 CMD INSTALL'.  If you only want text help you need to run

 R CMD INSTALL --docs=txt removal_1.0.tar.gz


 On Mon, 25 Jun 2007, Richard Chandler wrote:

  Hi,
 
  I am trying to build a package from source for the first time.
 I'm
  using Windows XP. After R CMD INSTALL or R CMD check I get an
 error
  message that I don't understand. I've tried to follow the
 instrucions
  provided in the R Installation and Administration .pdf and the
 text
  file that comes with Rtools, but most of this is new to me and
 clearly
  I'm missing something. Here's what I've done:
 
  -Downloaded perl and Rtools and put them in my c directory
  -Used package.skeleton() to set up the package structure and put
 the
  package-to-be removal in C:\toBuild
  -I edited my path to :
  C:\Rtools\bin;C:\perl\bin;C:\Rtools\MinGW\bin;C:\R-2.5.0\bin;...
  -I changed the following in the MkRules file:
  1)HEADER=C:/Rtools/MinGW/include
  2)HELPTYPES = -txt
  3)WINHELP = NO
  4)HEADER=C:/Rtools/MinGW/include
  5)R_EXE=C:/R-2.5.0/bin/R.exe

 The last two are for cross-building, not what you are doing.

  -Next, I opened up a command prompt and went to c:/toBuild
  -Then I ran: R CMD build removal. No problems.
  -Then I ran: R CMD INSTALL removal_1.0.tar.gz
  and got this:
  -
  installing to 'c:/R-2.5.0/library'
 
  latex: not found
  latex: not found
  latex: not found
 
  -- Making package removal 
  latex: not found
   adding build stamp to DESCRIPTION
  latex: not found
  latex: not found
  latex: not found
   installing R files
  latex: not found
   installing data files
  latex: not found
   installing man source files
   installing indices
  latex: not found
  latex: not found
   not zipping data
   installing help
   Building/Updating help pages for package 'removal'
  Formats: text chm
   RemProbs  text
 chm
   add.error text
 chm
   error.plottext
 chm
   firstDetect   text
 chm
   funs  text
 chm
   path  text
 chm
   pll2  text
 chm
   remll2text
 chm
   removal-package   text
 chm
   removal2  text
 chm
   var.d text
 chm
  hhc: not found
  cp: cannot stat
 `C:/toBuild/R.INSTALL.3064/removal/chm/removal.chm':
  No such fil
  e or directory
  make[1]: *** [chm-removal] Error 1
  make: *** [pkg-removal] Error 2
  *** Installation of removal failed ***
 
  Removing 'c:/R-2.5.0/library/removal'
  ---
 
  I don't know what hhc is. I'm guessing its trying to build the
  compiled help files even though I tried to ask for only text
 files. It
  also seems to want latex even though I read that it isn't
 necessary to
  build simple packages. Can someone please tell me what I'm doing
  wrong? Thanks.
 
  Richard
 
 
 

 --
 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



-- 
Richard Chandler, PhD student
Department of Natural Resources Conservation
UMass Amherst
(413)545-1237

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Re : Half of a heatmap

2007-06-25 Thread Rosenfeld, Jeffrey
I have correlation values between -1 and 1 and I need to keep the sign.

Jeff


-Original Message-
From: Brad McNeney [mailto:[EMAIL PROTECTED]
Sent: Mon 6/25/2007 1:01 PM
To: Rosenfeld, Jeffrey
Cc: Neil Shephard; r-help@stat.math.ethz.ch
Subject: Re: [R] Re : Half of a heatmap
 
Just for the record, LDheatmap can display any upper-triangular matrix of
measures between 0 and 1, not just LD measures. Users with their own matrix
should pass it as the first argument (gdat) to the function.

-b

--
Brad McNeney
Statistics and Actuarial Science
Simon Fraser University
Burnaby, BC, Canada


On 6/25/07, Rosenfeld, Jeffrey [EMAIL PROTECTED] wrote:

 Thank you for your reply.  I have looked at LDheatmap, but it does not
 seem to do what I want and seems to only work well for LD data.  I was
 looking for something that would produce a figure identical to what
 heatmap.2 gives me, including the proper X and Y-axis labels and a
 dendogram, except that it would only have half of the map.  Preferably, it
 would have the Color Key in the place where the other triangle of the
 heatmap would be, to save space.


 Jeff


 -Original Message-
 From: Neil Shephard [mailto:[EMAIL PROTECTED]
 Sent: Mon 6/25/2007 6:14 AM
 To: r-help@stat.math.ethz.ch
 Cc: Rosenfeld, Jeffrey
 Subject: Re : [R] Half of a heatmap

  I am trying to produce a heatmap of pairwise correlations, but since the
 matrix is
  symmetric, I only need either the upper or the lower triangle.  I have
 scoured the
  web and R documentation, but I have not been able to find a way to
 produce such a
  figure.  Is there a simple way to produce a heat map with only the part
 above or
  below the diagonal?

 You might want to check out the LDheatmap() package which can generate
 the plots you describe.  The help indicates that it accepts a matrix
 of pair-wise linkage disequilibrium measures, one of which is R^2 (the
 correlation coefficient between loci), but I suspect you could simply
 pass it a matrix of correlation coefficents.

 Hope that helps,

 Neil
 --
 In mathematics you don't understand things. You just get used to
 them.  - Johann von Neumann

 Email - [EMAIL PROTECTED] / [EMAIL PROTECTED]
 Website - http://slack.ser.man.ac.uk/
 Photos - http://www.flickr.com/photos/slackline/

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem building first package

2007-06-25 Thread Prof Brian Ripley
It's a buglet: --docs=txt, works.

On Mon, 25 Jun 2007, Richard Chandler wrote:

 Thanks so much. I was able to get it installed using:

 R CMD INSTALL --docs=normal removal_1.0.tar.gz

 However, setting --docs=txt gave me this error:

 ERROR: invalid --docs value `txt'

 The --help says it needs to be a list, but no matter, --docs=normal
 worked fine.


 Quoting Prof Brian Ripley [EMAIL PROTECTED]:

 You can ignore the message about latex (and 2.5.1 RC does not give
 it).

 hhc is part of HTML Help Workshop: you either have not installed
 that or
 not put it in your path.

 The settings in MkRules affect the types of help for building R,
 not 'R
 CMD INSTALL'.  If you only want text help you need to run

 R CMD INSTALL --docs=txt removal_1.0.tar.gz


 On Mon, 25 Jun 2007, Richard Chandler wrote:

 Hi,

 I am trying to build a package from source for the first time.
 I'm
 using Windows XP. After R CMD INSTALL or R CMD check I get an
 error
 message that I don't understand. I've tried to follow the
 instrucions
 provided in the R Installation and Administration .pdf and the
 text
 file that comes with Rtools, but most of this is new to me and
 clearly
 I'm missing something. Here's what I've done:

 -Downloaded perl and Rtools and put them in my c directory
 -Used package.skeleton() to set up the package structure and put
 the
 package-to-be removal in C:\toBuild
 -I edited my path to :
 C:\Rtools\bin;C:\perl\bin;C:\Rtools\MinGW\bin;C:\R-2.5.0\bin;...
 -I changed the following in the MkRules file:
 1)HEADER=C:/Rtools/MinGW/include
 2)HELPTYPES = -txt
 3)WINHELP = NO
 4)HEADER=C:/Rtools/MinGW/include
 5)R_EXE=C:/R-2.5.0/bin/R.exe

 The last two are for cross-building, not what you are doing.

 -Next, I opened up a command prompt and went to c:/toBuild
 -Then I ran: R CMD build removal. No problems.
 -Then I ran: R CMD INSTALL removal_1.0.tar.gz
 and got this:
 -
 installing to 'c:/R-2.5.0/library'

 latex: not found
 latex: not found
 latex: not found

 -- Making package removal 
 latex: not found
  adding build stamp to DESCRIPTION
 latex: not found
 latex: not found
 latex: not found
  installing R files
 latex: not found
  installing data files
 latex: not found
  installing man source files
  installing indices
 latex: not found
 latex: not found
  not zipping data
  installing help
 Building/Updating help pages for package 'removal'
 Formats: text chm
  RemProbs  text
 chm
  add.error text
 chm
  error.plottext
 chm
  firstDetect   text
 chm
  funs  text
 chm
  path  text
 chm
  pll2  text
 chm
  remll2text
 chm
  removal-package   text
 chm
  removal2  text
 chm
  var.d text
 chm
 hhc: not found
 cp: cannot stat
 `C:/toBuild/R.INSTALL.3064/removal/chm/removal.chm':
 No such fil
 e or directory
 make[1]: *** [chm-removal] Error 1
 make: *** [pkg-removal] Error 2
 *** Installation of removal failed ***

 Removing 'c:/R-2.5.0/library/removal'
 ---

 I don't know what hhc is. I'm guessing its trying to build the
 compiled help files even though I tried to ask for only text
 files. It
 also seems to want latex even though I read that it isn't
 necessary to
 build simple packages. Can someone please tell me what I'm doing
 wrong? Thanks.

 Richard




 --
 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





-- 
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] complex contrasts and logistic regression

2007-06-25 Thread Nicholas Lewin-Koh
Hi,
Sorry to take so long to reply, I was travelling last week. Thanks for
your
suggestions. Actually in this case contrast and predict gave the same
result,
and what I was looking at was the correct odds from the model. 

What is still confusing me is the 1st part of my question,
looking for a trend in odds ratios. From what I understand
testing the interaction:
fit1-glmD(survived ~ as.numeric(Covariate)+Therapy +
confounder,myDat,X=TRUE, Y=TRUE, family=binomial())
fit2-glmD(survived ~ as.numeric(Covariate)*Therapy +
confounder,myDat,X=TRUE, Y=TRUE, family=binomial()) 
lrtest(fit1,fit2)

Would be effectively testing for a trend in odds ratios? 
Do I have to fiddle with contrasts to make sure I am testing the correct
parameter?

Thanks
Nicholas

On Sat, 16 Jun 2007 11:14:12 -0500, Frank E Harrell Jr
[EMAIL PROTECTED] said:
 Nicholas Lewin-Koh wrote:
  Hi,
  I am doing a retrospective analysis on a cohort from a designed trial,
  and I am fitting
  the model
  
  fit-glmD(survived ~ Covariate*Therapy + confounder,myDat,X=TRUE,
  Y=TRUE, family=binomial()) 
 
 For logistic regression you can also use Design's lrm function which 
 gives you more options.
 
  
  My covariate has three levels (A,B and C) and therapy has two
  (treated and control), confounder is a continuous variable.
  Also patients were randomized to treatment in the trial, but Covariate
  is something that is measured
  posthoc and can vary in the population.
 
 If by posthoc you mean that the covariate is measured after baseline, it 
 is difficult to get an interpretable analysis.
 
   
  I am trying to wrap my head around how to calculate a few quantities
  from the model
  and get reasonable confidence intervals for them, namely I would like to
  test
  
  H0: gamma=0, where gamma is the regression coefficient of the odds
  ratios of surviving
   under treatment vs control at each level of Covariate
   (adjusted for the confounder)
 
 You mean regression coefficient on the log odds ratio scale.  This is 
 easy to do with the contrast( ) function in Design.  Do ?contrast.Design 
 for details and examples.
 
  
  and I would like to get the odds of surviving at each level of Covariate
  under treatment and control
  for each level of covariate adjusted for the confounder. I have looked
  at contrast in the Design 
  library but I don't think it gives me the right quantity, for instance 
  
  contrast(fit,list(covariate=A, Therapy=Treated,
  confounder=median(myDat$confounder), X=TRUE)
  ( A is the baseline level of Covariate) 
  
  gives me beta0 + beta_Treated + beta_confounder*68  
  
  Is this correctly interpreted as the conditional odds of dying? 
  As to the 1st contrast I am not sure how to get it, would it be using
  type = 'average' with some weights 
  in contrast? The answers are probably staring me in the face, i am just
  not seeing them today.
 
 contrast( ) is for contrasts (differences).  Sounds like you want 
 predicted values.  Do ?predict  ?predict.lrm  ?predict.Design.  Also do 
 ?gendata which will generate a data frame for getting predictors, with 
 unspecified predictors set to reference values such as medians.
 
 Frank
 
  
  Nicholas
  
  
  
 
 
 -- 
 Frank E Harrell Jr   Professor and Chair   School of Medicine
   Department of Biostatistics   Vanderbilt University

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] eps in odfWeave

2007-06-25 Thread Dieter Menne
Dieter Menne dieter.menne at menne-biomed.de writes:

 
 library(odfWeave)
 plotInfo - getImageDefs()
 plotInfo$type = eps
 plotInfo$plotWidth = 4
 plotInfo$plotHeight = 4
 plotInfo$device = postscript
 plotInfo$args = list( horizontal = FALSE,onefile = FALSE, paper = special)
 setImageDefs(plotInfo)
 demoFile - system.file(examples, simple.odt, package =odfWeave)
 odfWeave(demoFile, c:/simpleOut.odt)
 
 -
 Error in check(options) : invalid value for 'type' : eps

Sorry, Max, my error (as you noted in private email). From an earlier attempt I
had forgotten to remove the incorrect type=eps in the code.

Dieter

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ANOVA non-sphericity test and corrections (eg, Greenhouse-Geisser)

2007-06-25 Thread John Wilkinson

Darren,

Further to Peter Dalgaard's help;

Take a look at the example in ---

library(car)
?Anova  # note upper case 'A' 

The example in the Anova help page following the ---

## a multivariate linear model for repeated-measures data
## See ?OBrienKaiser for a description of the data set used in this example

gives a workings for --

## Greenhouse-Geisser and Huynh-Feldt Corrections
##  for Departure from Compound Symmetry

You might find that example helpful.

John

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Post-hoc tests for interactions of between- and within-subject factors

2007-06-25 Thread Richard M. Heiberger
The glht function in package multcomp requires aov objects.
As you discovered, it does not work with aovlist objects.

See the documentation ?MMC in the HH package from CRAN.
The maiz example is similar to your example.  Come back
to the list if you need further help.

Rich

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] degrees of freedom in lme

2007-06-25 Thread Manuel Morales
On Mon, 2007-06-25 at 13:15 -0400, Doran, Harold wrote:
 This is such a common question that it has a an FAQ-like response from Doug 
 Bates. Google lmer p-values and all that to find the response. 

Isn't this a different question, though, since Jean-Baptiste is using
nlme. 

Details on the calculation of DF in nlme can be found in chapter 4 of
the book by Pinheiro and Bates Mixed Effects Models in S and S-PLUS.
Using the formula provided, I get denDF of 10 for level 1 and 32 for
level 2. I'm not sure why lme is using the denDF estimated at level 2 in
this example ...

  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Jean-Baptiste Ferdy
  Sent: Monday, June 25, 2007 12:26 PM
  To: r-help@stat.math.ethz.ch
  Subject: [R] degrees of freedom in lme
  
  Dear all,
  
  I am starting to use the lme package (and plan to teach a 
  course based on it next semester...). To understand what lme 
  is doing precisely, I used balanced datasets described in 
  Pinheiro and Bates and tried to compare the lme outputs to 
  that of aov. Here is what I obtained:
  
   data(Machines)
   summary(aov(score~Machine+Error(Worker/Machine),data=Machines))
  Error: Worker
Df  Sum Sq Mean Sq F value Pr(F) Residuals  5 
  1241.89  248.38
  
  Error: Worker:Machine
Df  Sum Sq Mean Sq F valuePr(F)
  Machine2 1755.26  877.63  20.576 0.0002855 ***
  Residuals 10  426.53   42.65
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Error: Within
Df Sum Sq Mean Sq F value Pr(F)
  Residuals 36 33.287   0.925
   
  anova(lme(fixed=score~Machine,random=~1|Worker/Machine,data=Machines))
  numDF denDF  F-value p-value
  (Intercept) 136 773.5709  .0001
  Machine 210  20.5762   3e-04

  No problem here: the results are essentially the same, which 
  is expected. Now I turn to an ANCOVA with a random grouping factor.
  
   data(Orthodont)
   OrthoFem - Orthodont[Orthodont$Sex==Female,];
   summary(aov(distance~age+Error(Subject/age),data=OrthoFem))
  Error: Subject
Df  Sum Sq Mean Sq F value Pr(F) Residuals 10 
  177.227  17.723
  
  Error: Subject:age
Df Sum Sq Mean Sq F valuePr(F)
  age1 50.592  50.592  52.452 2.783e-05 ***
  Residuals 10  9.645   0.965
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Error: Within
Df Sum Sq Mean Sq F value Pr(F) Residuals 22 9.8250  0.4466
   anova(lme(fixed=distance~age,random=~1+age|Subject,data=OrthoFem))
  numDF denDF   F-value p-value
  (Intercept) 132 1269.7764  .0001
  age 132   52.4517  .0001
  
  This time the F values are (almost) identical, the numerator 
  degrees of freedom are the same, but the denominator degrees 
  of freedom are very different (10 for aov vs. 32 for lme). I 
  understand that there is an issue with the estimation of that 
  number, but I would naively expect the number given by lme to 
  be close to that provided by aov is the case of a balanced 
  dataset. That's obviously not true in the case of an 
  ANCOVA... But why?? And how should I interpret the F-test 
  given by anova.lme?
  
  Thanks in advance for your help !
  --
  Jean-Baptiste Ferdy
  Institut des Sciences de l'Évolution de Montpellier CNRS UMR 
  5554 Université Montpellier 2
  34 095 Montpellier cedex 05
  tel. +33 (0)4 67 14 42 27
  fax  +33 (0)4 67 14 36 22
  
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide 
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
-- 
Manuel A. Morales
http://mutualism.williams.edu
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] correlation structure

2007-06-25 Thread Daniel O'Shea
I have been using a nlme model and wish to specify the correlation structure.  
My data is grouped (bas), but I have no time component or adequate spatial 
description beyond the grouping variable. So I chose the simplest structure and 
updated my original nlme model by:
update(model, corr=corCompSymm(~1|bas))

This is not significant.  One of my variables measures area upstream of the 
sample.  Area is a continuous variable, and there are some identical values of 
area.  Can I model the dependence among residuals with in group (bas) and along 
area?  Can the corCAR1 be used and the area used as a position variable?  If so 
does the position variable need to be sorted when using the corCAR1 structure?  
Or could one use spatial classes and use area as one position and watershed as 
the other substituting numbers for the grouping variable?  I have been trying, 
but R keeps crashing when I specify correlation structures other than compound 
symmetry.  I assume this is because I am not specifying the form correctly.  
Any suggestions would be appreciated.

Dan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] debug()

2007-06-25 Thread Nair, Murlidharan T
I am having problems using debug() when I am running R under linux. It
works fine under the windows environment. Is there anything special that
need to specify when running under linux. I would appreciate your help.

 

Cheers../Murli

 

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a string to enviroment or function

2007-06-25 Thread Weiwei Shi
then how to do this

f1 - function(mylab){
  library(mylab)
  ...
}

it seems that if you call
library(hgu133a) # which is file
# but
library(mylab) # even you pass hgu133a as parameter, it still
complains about mylab does not exist. It seems that it consider
mylab as package instead of its value.


On 6/25/07, jim holtman [EMAIL PROTECTED] wrote:
 I think that you might want:

 t0 - (paste(hgu133a, ENTREZID, sep=))
 xx - as.list(get(t0)) # make it work like xx-as.list(hgu133aENTREZID)




 On 6/25/07, Weiwei Shi [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I am wondering how to make a function Fun to make the following work:
 
  t0 - (paste(hgu133a, ENTREZID, sep=))
  xx - as.list(Fun(t0)) # make it work like xx-as.list(hgu133aENTREZID)
 
  thanks,
  --
  Weiwei Shi, Ph.D
  Research Scientist
  GeneGO, Inc.
 
  Did you always know?
  No, I did not. But I believed...
  ---Matrix III
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 



 --
 Jim Holtman
 Cincinnati, OH
 +1 513 646 9390

 What is the problem you are trying to solve?


-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

Did you always know?
No, I did not. But I believed...
---Matrix III

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to shadow 'power' area?

2007-06-25 Thread Andrej Kastrin
Dear all,

Suppose I plot two normal distributions (A and B) side by side and add 
vertical line which hipotheticaly represent alpha value; e.g.:

x - seq(-3.5,5, length=1000)
y - dnorm(x)
# Plot distribution A
plot(y~x, type='l',axes=F,xlab=,ylab=,lwd=2)
# Plot distribution B
y2 - dnorm(x-1.5)
lines(y2~x,lwd=2)
# Plot vertical line for alpha value
abline(h=0)
segments(qnorm(.5)+1.5,0,qnorm(.5)+1.5,dnorm(qnorm(.5)))
text(2,0.2,Power)

Now I want to shadow area labeled as Power. Any suggestion how to do 
that using 'polygon' function?

Thanks in advance for any suggestion.

Andrej

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to shadow 'power' area?

2007-06-25 Thread Christos Hatzis
Look at the following link:

http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=88 

This should be pretty close to what you want.
HTH

-Christos

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Andrej Kastrin
 Sent: Monday, June 25, 2007 4:51 PM
 To: R-help
 Subject: [R] How to shadow 'power' area?
 
 Dear all,
 
 Suppose I plot two normal distributions (A and B) side by 
 side and add vertical line which hipotheticaly represent 
 alpha value; e.g.:
 
 x - seq(-3.5,5, length=1000)
 y - dnorm(x)
 # Plot distribution A
 plot(y~x, type='l',axes=F,xlab=,ylab=,lwd=2)
 # Plot distribution B
 y2 - dnorm(x-1.5)
 lines(y2~x,lwd=2)
 # Plot vertical line for alpha value
 abline(h=0)
 segments(qnorm(.5)+1.5,0,qnorm(.5)+1.5,dnorm(qnorm(.5)))
 text(2,0.2,Power)
 
 Now I want to shadow area labeled as Power. Any suggestion 
 how to do that using 'polygon' function?
 
 Thanks in advance for any suggestion.
 
 Andrej
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to shadow 'power' area?

2007-06-25 Thread Marc Schwartz
On Mon, 2007-06-25 at 22:50 +0200, Andrej Kastrin wrote:
 Dear all,
 
 Suppose I plot two normal distributions (A and B) side by side and add 
 vertical line which hipotheticaly represent alpha value; e.g.:
 
 x - seq(-3.5,5, length=1000)
 y - dnorm(x)
 # Plot distribution A
 plot(y~x, type='l',axes=F,xlab=,ylab=,lwd=2)
 # Plot distribution B
 y2 - dnorm(x-1.5)
 lines(y2~x,lwd=2)
 # Plot vertical line for alpha value
 abline(h=0)
 segments(qnorm(.5)+1.5,0,qnorm(.5)+1.5,dnorm(qnorm(.5)))
 text(2,0.2,Power)
 
 Now I want to shadow area labeled as Power. Any suggestion how to do 
 that using 'polygon' function?
 
 Thanks in advance for any suggestion.
 
 Andrej

See the latter section of this post:

http://tolstoy.newcastle.edu.au/R/help/03b/2475.html

and in turn, ?polygon

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] LanguageR pvals.fnc error message

2007-06-25 Thread Ben Bolker
Mike Ford mford at csl.psychol.cam.ac.uk writes:

 
 Hi. I get an error message about not converging when I try and use the 
 pvals.fnc from the languageR library. The LMER analysis worked fine (See 
 below).
 
 I am not an expert so I don't understand why the LMER worked but not the 
 pvals.fnc
 
 Any help gratefully received.
 
 - Mike

  results of traceback() after the error?
  precise wording of the error message?
  any chance of sending to the list, or posting, a data
set that produces the error?  (see the posting guide ...)

  on the face of it is puzzling because pvals.fnc doesn't
seem to do any fitting, just post-processing of the lmer
object ...

  (by the way, that's the languageR package --
library(fortunes); fortune(Maechler.*package))

  Ben Bolker

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem installing MCMCpack

2007-06-25 Thread Vivek Menon
I am having a problem installing MCMCpack on a Linux ppc64 machine. Has
someone had this problem??This is what I see when I do an install package:
 install.packages(c(MCMCpack))
trying URL '
http://www.sourcekeg.co.uk/cran/src/contrib/MCMCpack_0.8-2.tar.gz'
Content type 'application/x-tar' length 310117 bytes
opened URL
==
downloaded 302Kb

* Installing *source* package 'MCMCpack' ...
checking for C++ compiler default output file name... configure: error: C++
compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package 'MCMCpack'
** Removing '/home/vivekv/sw_alg/R-2.5.0/library/MCMCpack'
---
Thanks,
Vivek

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] fft and the derivative

2007-06-25 Thread Todd Remund
Can one take f(t) and transform to F(omega) in the frequency domain using 
fft(), and use the properties of the fft and find the derivative of f(t)?  
For example,

f(t) - F(omega) = f(t)^n - (i*omega)^n  *  F(omega)

Use this and get,

f(t)^n = F^(-) [ (i*omega)^n  *  F(omega) ]

to get the nth derivative of f(t)?
Todd Remund

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Quiver in 1d

2007-06-25 Thread fernando espindola
Dear all R-users,

I am try to plot quiver in one dimension, but there is only code for two 
dimension in different R web pages. Somebody know same code that can 
help me in plot quiver in one dimension. Any help gratefully received .

Thanks for all

Fernando

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a string to enviroment or function

2007-06-25 Thread Martin Morgan
Weiwei

See ?library and the character.only argument.

 f - function(x) library(x)
 f(hgu95av2)
Error in library(x) : there is no package called 'x'
 f - function(x) library(x, character.only=TRUE)
 f(hgu95av2)
 search()
 [1] .GlobalEnvpackage:hgu95av2  package:stats
 [4] package:graphics  package:grDevices package:utils
 [7] package:datasets  package:methods   Autoloads
[10] package:base 

Also

 g - function(x) as.list(get(paste(x, ENTREZID, sep=)))
 ll - g(hgu95av2)
 length(ll)
[1] 12625

and finally reverseSplit in Biobase and revmap in AnnotationDbi might
be helpful (though AnnotationDbi is only available with R-devel and
revmap seems not to be documented).

 res - revmap(hgu95av2ENTREZID)
 hgu95av2ENTREZID[[1190_at]]
[1] 5800
 res[[5800]]
[1] 1190_at  32199_at


Martin

Weiwei Shi [EMAIL PROTECTED] writes:

 then how to do this

 f1 - function(mylab){
   library(mylab)
   ...
 }

 it seems that if you call
 library(hgu133a) # which is file
 # but
 library(mylab) # even you pass hgu133a as parameter, it still
 complains about mylab does not exist. It seems that it consider
 mylab as package instead of its value.


 On 6/25/07, jim holtman [EMAIL PROTECTED] wrote:
 I think that you might want:

 t0 - (paste(hgu133a, ENTREZID, sep=))
 xx - as.list(get(t0)) # make it work like xx-as.list(hgu133aENTREZID)




 On 6/25/07, Weiwei Shi [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I am wondering how to make a function Fun to make the following work:
 
  t0 - (paste(hgu133a, ENTREZID, sep=))
  xx - as.list(Fun(t0)) # make it work like xx-as.list(hgu133aENTREZID)
 
  thanks,
  --
  Weiwei Shi, Ph.D
  Research Scientist
  GeneGO, Inc.
 
  Did you always know?
  No, I did not. But I believed...
  ---Matrix III
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 



 --
 Jim Holtman
 Cincinnati, OH
 +1 513 646 9390

 What is the problem you are trying to solve?


 -- 
 Weiwei Shi, Ph.D
 Research Scientist
 GeneGO, Inc.

 Did you always know?
 No, I did not. But I believed...
 ---Matrix III

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a string to enviroment or function

2007-06-25 Thread Duncan Murdoch
On 25/06/2007 4:19 PM, Weiwei Shi wrote:
 then how to do this
 
 f1 - function(mylab){
   library(mylab)
   ...
 }
 
 it seems that if you call
 library(hgu133a) # which is file
 # but
 library(mylab) # even you pass hgu133a as parameter, it still
 complains about mylab does not exist. It seems that it consider
 mylab as package instead of its value.

One of the examples in ?library shows how to do what you want.

pkg - splines
library(pkg, character.only = TRUE)

Duncan Murdoch

 Weiwei Shi, Ph.D
 Research Scientist
 GeneGO, Inc.

P.S. If you think this was helpful, one of the ways to contribute back 
to the R project would be to ask your employer to become an 
institutional member:  see

http://www.r-project.org/foundation/membership.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] changing the position of the y label (ylab)

2007-06-25 Thread Etienne
How can I change the position of the ylab, after
enlarging the margins with par(mar=...)? 

Here is the relevant code snippet


par(mar=c(5.1,5.1,4.1,2.1))
plot(c(1979,2003),c(40,50),ylim=c(1,73),lab=c(20,10,1),pch=21,col='blue',bg='blue',axes=FALSE,xlab=Years,ylab=Onset/Withdrawl
Date,font.lab=2)
box()
axis(1,las=2)
axis(2,las=2,labels=c('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC','JAN'),at=seq(from=1,to=73,by=6))
axis(3,labels=FALSE)
axis(4,labels=FALSE,at=seq(from=1,to=73,by=6))


Thanks

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to shadow 'power' area?

2007-06-25 Thread Greg Snow
You can look at the power.examp function in the TeachingDemos package to
see if it gives you the graph you want, or look at the code to see how
you could modify it to give you the plot you want.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Andrej Kastrin
 Sent: Monday, June 25, 2007 2:51 PM
 To: R-help
 Subject: [R] How to shadow 'power' area?
 
 Dear all,
 
 Suppose I plot two normal distributions (A and B) side by 
 side and add vertical line which hipotheticaly represent 
 alpha value; e.g.:
 
 x - seq(-3.5,5, length=1000)
 y - dnorm(x)
 # Plot distribution A
 plot(y~x, type='l',axes=F,xlab=,ylab=,lwd=2)
 # Plot distribution B
 y2 - dnorm(x-1.5)
 lines(y2~x,lwd=2)
 # Plot vertical line for alpha value
 abline(h=0)
 segments(qnorm(.5)+1.5,0,qnorm(.5)+1.5,dnorm(qnorm(.5)))
 text(2,0.2,Power)
 
 Now I want to shadow area labeled as Power. Any suggestion 
 how to do that using 'polygon' function?
 
 Thanks in advance for any suggestion.
 
 Andrej
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] degrees of freedom in lme

2007-06-25 Thread Doran, Harold
I don't believe the issue is different. In some respects, lme and lmer 
essentially accomplish the same thing for mixed linear models. lmer differs in 
many ways than lme in how estimates are computed and in the type of models it 
can handle. It is probably best to read the new vignettes in the lme4 package 
to see inside lmer a bit more. 

However, if you estimate the same model with lme and lmer to the same data 
you'll get the same results. But, lme gives DF and p-values but lmer does not.


-Original Message-
From: Manuel Morales [mailto:[EMAIL PROTECTED]
Sent: Mon 6/25/2007 3:32 PM
To: Doran, Harold
Cc: Jean-Baptiste Ferdy; r-help@stat.math.ethz.ch
Subject: Re: [R] degrees of freedom in lme
 
On Mon, 2007-06-25 at 13:15 -0400, Doran, Harold wrote:
 This is such a common question that it has a an FAQ-like response from Doug 
 Bates. Google lmer p-values and all that to find the response. 

Isn't this a different question, though, since Jean-Baptiste is using
nlme. 

Details on the calculation of DF in nlme can be found in chapter 4 of
the book by Pinheiro and Bates Mixed Effects Models in S and S-PLUS.
Using the formula provided, I get denDF of 10 for level 1 and 32 for
level 2. I'm not sure why lme is using the denDF estimated at level 2 in
this example ...

  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Jean-Baptiste Ferdy
  Sent: Monday, June 25, 2007 12:26 PM
  To: r-help@stat.math.ethz.ch
  Subject: [R] degrees of freedom in lme
  
  Dear all,
  
  I am starting to use the lme package (and plan to teach a 
  course based on it next semester...). To understand what lme 
  is doing precisely, I used balanced datasets described in 
  Pinheiro and Bates and tried to compare the lme outputs to 
  that of aov. Here is what I obtained:
  
   data(Machines)
   summary(aov(score~Machine+Error(Worker/Machine),data=Machines))
  Error: Worker
Df  Sum Sq Mean Sq F value Pr(F) Residuals  5 
  1241.89  248.38
  
  Error: Worker:Machine
Df  Sum Sq Mean Sq F valuePr(F)
  Machine2 1755.26  877.63  20.576 0.0002855 ***
  Residuals 10  426.53   42.65
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Error: Within
Df Sum Sq Mean Sq F value Pr(F)
  Residuals 36 33.287   0.925
   
  anova(lme(fixed=score~Machine,random=~1|Worker/Machine,data=Machines))
  numDF denDF  F-value p-value
  (Intercept) 136 773.5709  .0001
  Machine 210  20.5762   3e-04

  No problem here: the results are essentially the same, which 
  is expected. Now I turn to an ANCOVA with a random grouping factor.
  
   data(Orthodont)
   OrthoFem - Orthodont[Orthodont$Sex==Female,];
   summary(aov(distance~age+Error(Subject/age),data=OrthoFem))
  Error: Subject
Df  Sum Sq Mean Sq F value Pr(F) Residuals 10 
  177.227  17.723
  
  Error: Subject:age
Df Sum Sq Mean Sq F valuePr(F)
  age1 50.592  50.592  52.452 2.783e-05 ***
  Residuals 10  9.645   0.965
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Error: Within
Df Sum Sq Mean Sq F value Pr(F) Residuals 22 9.8250  0.4466
   anova(lme(fixed=distance~age,random=~1+age|Subject,data=OrthoFem))
  numDF denDF   F-value p-value
  (Intercept) 132 1269.7764  .0001
  age 132   52.4517  .0001
  
  This time the F values are (almost) identical, the numerator 
  degrees of freedom are the same, but the denominator degrees 
  of freedom are very different (10 for aov vs. 32 for lme). I 
  understand that there is an issue with the estimation of that 
  number, but I would naively expect the number given by lme to 
  be close to that provided by aov is the case of a balanced 
  dataset. That's obviously not true in the case of an 
  ANCOVA... But why?? And how should I interpret the F-test 
  given by anova.lme?
  
  Thanks in advance for your help !
  --
  Jean-Baptiste Ferdy
  Institut des Sciences de l'Évolution de Montpellier CNRS UMR 
  5554 Université Montpellier 2
  34 095 Montpellier cedex 05
  tel. +33 (0)4 67 14 42 27
  fax  +33 (0)4 67 14 36 22
  
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide 
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
-- 
Manuel A. Morales
http://mutualism.williams.edu


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] fft and the derivative

2007-06-25 Thread Ravi Varadhan
Todd, 

Your idea is correct for continuous Fourier transform, but I am not sure
how one could apply that to fft, which corresponds to the discrete Fourier
transform.  For instance, what values of omega would you use for the term
i*omega to get the discrete fourier transform of the derivative of f(t)?  

Ravi.


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Todd Remund
Sent: Monday, June 25, 2007 5:16 PM
To: r-help@stat.math.ethz.ch
Subject: [R] fft and the derivative

Can one take f(t) and transform to F(omega) in the frequency domain using 
fft(), and use the properties of the fft and find the derivative of f(t)?  
For example,

f(t) - F(omega) = f(t)^n - (i*omega)^n  *  F(omega)

Use this and get,

f(t)^n = F^(-) [ (i*omega)^n  *  F(omega) ]

to get the nth derivative of f(t)?
Todd Remund

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] changing the position of the y label (ylab)

2007-06-25 Thread Etienne
Thanks (Merci) Christophe!

that did it

--- Christophe Bonenfant
[EMAIL PROTECTED] wrote:

 Hi Etienne - consider to use the mtext function:
 
   par(mar=c(5.1,5.1,4.1,2.1))
  

plot(c(1979,2003),c(40,50),ylim=c(1,73),lab=c(20,10,1),

pch=21,col='blue',bg='blue',axes=FALSE,xlab=,ylab=,font.lab=2)
   box()
   axis(1,las=2)
  

axis(2,las=2,labels=c('JAN','FEB','MAR','APR','MAY','JUN','JUL',

'AUG','SEP','OCT','NOV','DEC','JAN'),at=seq(from=1,to=73,by=6))
   axis(3,labels=FALSE)
   axis(4,labels=FALSE,at=seq(from=1,to=73,by=6))
   mtext(Years, 1, 3.5, cex = 1.7)
 # first interger is the axis number, second number
 is the distance to 
 the axis
   mtext(Onset/Withdrawl Date, 2, 4, cex = 1.7)
 
 see ?mtext
 
 Christophe
 
 Etienne a écrit :
  How can I change the position of the ylab, after
  enlarging the margins with par(mar=...)? 
  
  Here is the relevant code snippet
  
  
  par(mar=c(5.1,5.1,4.1,2.1))
 

plot(c(1979,2003),c(40,50),ylim=c(1,73),lab=c(20,10,1),pch=21,col='blue',bg='blue',axes=FALSE,xlab=Years,ylab=Onset/Withdrawl
  Date,font.lab=2)
  box()
  axis(1,las=2)
 

axis(2,las=2,labels=c('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC','JAN'),at=seq(from=1,to=73,by=6))
  axis(3,labels=FALSE)
  axis(4,labels=FALSE,at=seq(from=1,to=73,by=6))
  
  
  Thanks
  
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained,
 reproducible code.
  
  


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] running Rcmdr

2007-06-25 Thread Manuel
Thanks for your answer, but i think i dont do correctly my question.
I need the command line to run Rmdr, like that:
R  Rcmdr or  R  loadRcmdr.R where loadRcmdr has library(Rcmdr).
or something like that.
I tried the last example, but when Rcmdr is executed, later it is closed.
About RProfile.site, i dont know what i have to change. If you think its 
useful to me, please explain me.
Thanks.

Felipe Carrillo escribió:
 First, you need to install the Rcmdr packages and then in the R 
 Command window or Tinn-R window type library(Rcmdr) without the 
 quotation marks. In addition, if you want Rcmdr to start automatically 
 everytime you start R, go to the following path C:\Program 
 Files\R\R-2.5.0\etc\RProfile.site if you installed R in program files, 
 otherwise follow your own path and type the same command 
 library(Rcmdr) and the R commander window should pop up everytime you 
 start R
  

 */Manuel [EMAIL PROTECTED]/* wrote:

 Hi to all,

 i want to know how can run Rcmdr automatically , or how to load a
 library in the call of R

 greetings

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 
 Choose the right car based on your needs. Check out Yahoo! Autos new 
 Car Finder tool. 
 http://us.rd.yahoo.com/evt=48518/*http://autos.yahoo.com/carfinder/;_ylc=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg--%20

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Moshe Olshansky
Also try xlsReadWrite package on CRAN.

--- Erika Frigo [EMAIL PROTECTED] wrote:

 
 Good morning to everybody,
 I have a problem : how can I import excel files in
 R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per
 la Sicurezza Alimentare (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
  __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Has anyone tryed out my software?

2007-06-25 Thread Robert Wilkins
Hello all,

Has anyone ( who uses a Linux desktop ) tryed out my stuff I mentioned
a few weeks ago?
Perhaps installed it and run a couple of example programs?

If you have, tell me what you think.


Robert


( it's the tarball in the download section at
http://code.google.com/p/vilno , discussed briefly in comparison to
Awk a couple of weeks ago )



PS

Of R users: how many use Windows XP, how many use an Apple, and how
many use a Linux desktop? Are there a lot of Linux users out there?

Is R more popular in Europe than North America? I'll need to do a
statistical analysis of the mailing list. I notice a ton of Europeans.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] a-priori orthogonal contrasts

2007-06-25 Thread Keith Alan Chamberlain
Dear R-helpers,

I have some stacked data with which I want to generate orthogonal contrasts - 
with the caveat that I determine what means comparisons are taking place 
a-priori.

Does it matter for e.g. 'contr.SUM' that the data are stacked, and does 
'contr.SUM' allow me to set the contrasts efficiently even if the data are 
unballanced? Is there an alternative in R I should consider?

Sincerely,
KeithC.
Psych Undergrad, CU Boulder (US)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Erich Neuwirth
The R(D)COM server (contaiong the RExcel Excel addin) and/or the rcom
package allow (among other things) to select a range in Excel and
directly transfer it to R as an array or as a dataframe.
It only works on Windows with Excel and R installed.

More information on these packages is available at

http://rcom.univie.ac.at


Erika Frigo wrote:
 Good morning to everybody,
 I have a problem : how can I import excel files in R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza Alimentare 
 (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
 
 
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Erich Neuwirth, Didactic Center for Computer Science
University of Vienna
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-39464 Fax: +43-1-4277-9394

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Howto fix colors in colorRampPalette?

2007-06-25 Thread Ashoka Polpitiya
Hi All,

I am plotting a correlation matrix using the heatmap function. I create my
color palette as follows (say, for red-green palette):
colorRampPalette( c(green, black, red), space=rgb)(10)

But I want to fix colors for a specific range of values, i.e. green=-1,
black=0, red=+1. The purpose of doing this is I can then quickly compare two
different correlation matrices visually, i.e., one matrix has values in the
range -1 to +1, whereas the other has from -0.5 to +0.5. Then the two
heatmaps differ in color levels. I searched in the help archives to find any
hints but didn't. Is there an easy way of doing this?
Any help is greatly appreciated.

Thanks.
Ashoka.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-excel

2007-06-25 Thread Stephen Tucker
There are also some notes about this in the R Data Import/Export manual: 
http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets

But I've gathered the following examples from the R-help mailing list
archives [in addition to the option of saving the spreadsheet as a .csv file
and reading it in with read.csv()]. Personally, I use option 4 regularly (I
happened to have Perl installed on my Windows XP machine already) and have
had good luck with it.

Hope this helps.

= Option 1 =
# SIMPLEST OPTION
install.packages(xlsReadWrite)
library(xlsReadWrite)
data = read.xls(sampledata.xls,sheet=1)

= Option 2 =
# ALSO SIMPLE BUT MORE MANUAL WORK EACH TIME
# (1) highlight region in Excel you want to import and
data = read.delim(file=clipboard,header=TRUE)
# or, if you don't have a header,
data = read.delim(file=clipboard,header=FALSE)

= Option 3 =
# RODBC IS A BIG APPLICATION, FOR INTERFACING
# WITH MANY TYPES OF FILES/SERVERS
install.packages(RODBC)
library(RODBC)
fid - odbcConnectExcel(sampledata.xls)
data - sqlFetch(fid,Sheet1)
close(fid)

= Option 4 =
# REQUIRES CONCURRENT INSTALLATION OF PERL
install.packages(gdata)
library(gdata)
data = read.xls(sampledata.xls,sheet=1)

 



--- Erika Frigo [EMAIL PROTECTED] wrote:

 
 Good morning to everybody,
 I have a problem : how can I import excel files in R???
 
 thank you very much
 
 
 Dr.sa. Erika Frigo
 Università degli Studi di Milano
 Facoltà di Medicina Veterinaria
 Dipartimento di Scienze e Tecnologie Veterinarie per la Sicurezza
 Alimentare (VSA)
  
 Via Grasselli, 7
 20137 Milano
 Tel. 02/50318515
 Fax 02/50318501
   [[alternative HTML version deleted]]
 
  __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 



   


Comedy with an Edge to see what's on, when.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.