RE: [R] Common principle components

2004-05-26 Thread Heywood, Giles
I was a lttle shocked to see your report of 3.2M hits for the correct
speeling versus 1.8M for incorrect.  This is a ratio of just 1.8!  Google
normally has much higher power than this, as the arbiter of spelling
disputes.

A quick google reveals however that your search is for
"principal"+"components" and principle"+"components".  A search for the
complete strings yields a ratio of 14.8 in favour of the latter.

- Giles



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Spencer Graves
> Sent: 26 May 2004 17:25
> To: Martin Maechler
> Cc: [EMAIL PROTECTED]
> Subject: Re: [R] Common principle components
> 
> 
> Google just returned "about" 1.8M hits for "principle components" and 
> 3.2M hits for "principal components".  Evidently, 
> eigenvectors are more 
> your friend (pal) than a structure for the space by a factor 
> of roughly 
> 2 to 1. 
> 
> spencer graves
> 
> Martin Maechler wrote:
> 
> >>"JosePG" == J Pedro Granadeiro <[EMAIL PROTECTED]>
> >>on Wed, 26 May 2004 16:01:22 +0100 writes:
> >>
> >>
> >
> >JosePG> I am sorry for not being clear. I meant the 
> methods detailed in:
> >JosePG> Flury, B. (1988). Common Principle Components 
> Analysis and Related 
> >JosePG> Multivariate Models, John Wiley and Sons, New York. 
> >
> >Well, I'm 100% sure the title of that book is different
> >(and so should be your e-mail subject)
> >
> >Hint: Look carefully at the end of the 2nd word ...
> >
> >__
> >[EMAIL PROTECTED] mailing list
> >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> >  
> >
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 


** 
This is a commercial communication from Commerzbank AG.\ \ T...{{dropped}}

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


Re: [R] Common principle components

2004-05-26 Thread Jari Oksanen
On Wed, 2004-05-26 at 18:01, J. Pedro Granadeiro wrote:
> I am sorry for not being clear. I meant the methods detailed in:
> 
> Flury, B. (1988). Common Principle Components Analysis and Related 
> Multivariate Models, John Wiley and Sons, New York. 
> 

Judging from the lack of positive answers, there may not be such a
utility in R. I checked Flury's book, and it seems that he gives there
his algorithm in such a detail that it might be possible to implement
the code in R, including the FORTRAN code for his crucial FG step.
Naturally, you should expect some complication in real world
implementations of long and winding book algorithms, but it might be
doable even for me, and somebody good in multivariate analysis might
find it fairly easy. I am not sure about the licensing of his FORTRAN
code: it was submitted to IMSL and you just cannot use IMSL code in free
software (actually, back in 1980s I got the complete FORTRAN code from
Flury himself, but it was under NDA, and I don't have the FORTRAN source
any longer). 

The most natural choice is to Google and find this page:
http://darkwing.uoregon.edu/~pphil/programs/cpc/cpc.htm. The page has
CPC binaries for more platforms than you have R, and you can pick your
own. However, the software uses Numerical Recipes, and the source code
cannot be made available, but the author writes there: "f you want to
run the software on a particular platform without a current compiled
version, get in contact with me to see what we can do." Sounds
promising: replacing NR pieces with R pieces may be easy (as  long as
you are careful in moving arrays to the genuine C zero offset). That was
a hint.

Finally, there are many brands of CPC. Flury discusses Krzanowski's
Common Space Analysis in his book, and describes its algorithm, too.
(Both of these algorithms are concisely given on pages 204-205.) Then
there is the classical SINDSCAL of the Bell Labs. I have had a look at
its code, and it looks like it would be easish to port to R -- if that
only would be legal. The first lines of the source files read: 

C THIS INFORMATION IS PROPRIETARY AND IS THE
C PROPERTY OF BELL TELEPHONE LABORATORIES,
C INCORPORATED.  ITS REPRODUCTION OR DISCLOSURE
C TO OTHERS, EITHER ORALLY OR IN WRITING, IS
C PROHIBITED WITHOUT WRITTEN PRERMISSION OF
C BELL LABORATORIES.

So you are not even allowed to anybody that you have the software, nor
tell how to use it. This must be the most restrictive source license
around. Further, it says in several places:

CTHESE IMSL ROUTINES ARE PROPRIETARY SOFTWARE, OWNED BY IMSL.
CTHEY MAY BE USED ONLY IN THE CODE IN WHICH THEY ARE EMBEDDED
CNO OTHER USE OF THESE ROUTINES IS PERMITTED. SMTI   7

So it just cannot be ported to R.

Anybody interested in working with porting CPC? (Better forget the
easier task of porting SINDSCAL.)

cheers, jari oksanen

-- 
Jari Oksanen <[EMAIL PROTECTED]>

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


Re: [R] Source Code for Linear Discriminant Analysis

2004-05-26 Thread Uwe Ligges
Chris Trengove wrote:
Dear R users,
  I am not an R user myself, but someone searching the web for C source code that will 
do linear discriminant function analysis.
  The only lead I have been able to locate is that R contains a function called "lda" 
which is contained in the MASS package.
(http://stat.ethz.ch/R-manual/R-devel/library/MASS/html/lda.html)
  I downloaded the R source file R-1.9.0.tgz, and found a huge collection of C 
programs in various package directories, but I could not find the source file for lda, 
nor could I find a directory for the MASS package.
  Can anyone help me please?
Regards,
Chris Trengove.
[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
MASS is in the VR package bundle. The current version is available at 
CRAN: /src/contrib/VR_7.2-2.tar.gz

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


[R] Source Code for Linear Discriminant Analysis

2004-05-26 Thread Chris Trengove
Dear R users,

  I am not an R user myself, but someone searching the web for C source code that will 
do linear discriminant function analysis.
  The only lead I have been able to locate is that R contains a function called "lda" 
which is contained in the MASS package.
(http://stat.ethz.ch/R-manual/R-devel/library/MASS/html/lda.html)
  I downloaded the R source file R-1.9.0.tgz, and found a huge collection of C 
programs in various package directories, but I could not find the source file for lda, 
nor could I find a directory for the MASS package.
  Can anyone help me please?

Regards,
Chris Trengove.
[[alternative HTML version deleted]]

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


Re: [R] cor and missing values. Bug?

2004-05-26 Thread Frank E Harrell Jr
On 27 May 2004 00:20:17 +0200
Peter Dalgaard <[EMAIL PROTECTED]> wrote:

> "Robert W. Baer, Ph.D." <[EMAIL PROTECTED]> writes:
> 
> > > Not to put too fine a point on it, but did you consider checking the
> > > NEWS file for the most recent version (1.9.0,
> > > http://cran.r-project.org/src/base/NEWS)?
> > >
> > > o   The cor() function did not remove missing values in the
> > > non-Pearson case.
> > 
> > 
> > There is still something a little strange in version 1.9.0. What  is
> > the source of the discrpancy between cor() and cor.test()?
> 
> One ranks x and y before removing missing values, the other one
> removes them first and then ranks. It is not really desirable, but a
> better solution is nontrivial (esp. in the "pairwise.complete.obs"
> case) and we did document it in ?cor:
> 
>   Notice also that the ranking is (currently) done
>  removing only cases that are missing on the variable itself,
>  which may not be what you expect if you let 'use' be
>  '"complete.obs"' or '"pairwise.complete.obs"'.
> 
> 
> -- 
>O__   Peter Dalgaard Blegdamsvej 3  
>   c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
>  (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
> ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
> 

Some of you may want to look at the old rcorr function in the Hmisc
package, which uses the pairwise complete obs method, uses some C code for
Spearman correlation, and is fast for large matrices.

Frank

---
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

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


Re: [R] Common principle components

2004-05-26 Thread Peter Dalgaard
Spencer Graves <[EMAIL PROTECTED]> writes:

> Google just returned "about" 1.8M hits for "principle components" and
> 3.2M hits for "principal components".  Evidently, eigenvectors are
> more your friend (pal) than a structure for the space by a factor of
> roughly 2 to 1. spencer graves

Of course, principles might actually have components. Take the Ten
Commandments for example

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

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


Re: [R] cor and missing values. Bug?

2004-05-26 Thread Peter Dalgaard
"Robert W. Baer, Ph.D." <[EMAIL PROTECTED]> writes:

> > Not to put too fine a point on it, but did you consider checking the
> > NEWS file for the most recent version (1.9.0,
> > http://cran.r-project.org/src/base/NEWS)?
> >
> > o   The cor() function did not remove missing values in the
> > non-Pearson case.
> 
> 
> There is still something a little strange in version 1.9.0. What  is the
> source of the discrpancy between cor() and cor.test()?

One ranks x and y before removing missing values, the other one
removes them first and then ranks. It is not really desirable, but a
better solution is nontrivial (esp. in the "pairwise.complete.obs"
case) and we did document it in ?cor:

  Notice also that the ranking is (currently) done
 removing only cases that are missing on the variable itself,
 which may not be what you expect if you let 'use' be '"complete.obs"'
 or '"pairwise.complete.obs"'.


-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

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


[R] Aid on two-way ANOVA with contrasts

2004-05-26 Thread joseclaudio.faria
Dears members of R list,

It would like that a more experienced statician in R helped me to complete
the analysis to follow:

r = gl(3, 8, label = c('r1', 'r2', 'r3'))
e = rep(gl(2, 4, label = c('e1', 'e2')), 3)
y = c(26.2, 26.0, 25.0, 25.4, 24.8, 24.6, 26.7, 25.2, 25.7, 26.3, 25.1, 26.4,
 19.6, 21.1, 19.0, 18.6, 22.8, 19.4, 18.8, 19.2, 19.8, 21.4, 22.8, 21.3)

df = data.frame(r, e, y)
attach(df)
  par(mfrow=c(2,1))
  interaction.plot(r, e, y, col = 'blue', ylab = 'y', xlab = 'r')

  interaction.plot(e, r, y, col = 'blue', ylab = 'y', xlab = 'r')
  av1 = aov(y ~ r*e)

  av2 = aov(y ~ r/e)
  efR_E = summary(av2, split = list('r:e' = list('e1 vs e2/r1' = 1, 'e1 vs
e2/r2' = 2, 'e1 vs e2/r3' = 3)))

  av3  = aov(y ~ e/r)
  efE_R = summary(av3, split = list('e:r' = list('r/e1' = c(1,3), 'r/e2' =
c(2,4

  mds = model.tables(av1, ty = 'means')
detach(df)

cat('\nData:'); cat('\n')
print(df)

cat('\nMeans:'); cat('\n')
print(mds)

cat('\nANOVA:'); cat('\n')
print(summary(av1)); cat('\n')

cat('\nANOVA - E effect in R levels:'); cat('\n')
print(efR_E); cat('\n')

cat('\nANOVA - R effect in E levels:'); cat('\n')
print(efE_R); cat('\n')

#I would like to get as resulted (efE_R) like this:
# ANOVA - R effect (contrasts) in E levels:
#Df   Sum SqMean Sq   F value
Pr(>F)
# e  1 19.082
#  e:r(4)  (156.622)
#e:r: r/e1 (2) (87.122)
#  r1 vs (r2,r3)/e1 1  ?...
#  r2 vs r3/e11  ?
#e:r: r/e2  (2)   (69.500)
#  r1 vs (r2,r3)/e1  1  ?...
#  r2 vs r3/e2 1  ?...
# Residuals  18   23.090 1.283



#Through manual calculations I got:
# ANOVA - R effect in E levels:
#Df   Sum SqMean Sq   F valuePr(>F)
# e  1 19.082
#  e:r(4)  (156.622)
#e:r: r/e1 (2) (87.122)
#  r1 vs (r2,r3)/e   1   19.26
#  r2 vs r3/e11   67.86
#e:r: r/e2 (2) (69.500)
#  r1 vs (r2,r3)/e   1   63.38
#  r2 vs r3/e21 6.12
# Residuals18  23.090 1.283

Best regards,

José Cláudio Faria
UESC/DCET
Brasil
73-634.2779
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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


RE: [R] 2 way repeated measures ANOVA using R: syntax and reportingquestion

2004-05-26 Thread F Z
Dear Gideon
Unless you are willing to accept uncorrelated measures in time and 
homogeneity of variance I would go for a linear mixed model instead. You 
might be surprised on how diffrent can be your results. Try;
?lme
I hope that this helps
Francisco

From: GIDEON WASSERBERG <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: [R] 2 way repeated measures ANOVA using R: syntax and 
reportingquestion
Date: Wed, 26 May 2004 14:03:21 -0500

Dear Friends
I have a technical question about conducting 2 way repeated measures ANOVA 
analysis using R.

1. Data set: repeated measurement of activity over night (2 hr. intervals)
repeated (within subject)factor: Hours
Between subject: Species, Sex
Dependent variables: specimens
Here is how the data arranged for the analysis:
Subject Replicate   HourSp. Specimens
1   1  1a
2   1  1a
3   1  1b
4   1  1b
5   2  1a
6   2  1a
7   2  1b
8   2  1b
1   1  2a
2   1  2a
3   1  2b
4   1  2b
5   2  2a
6   2  2a
7   2  2b
8   2  2b
here's the command I used:
summary(aov(Specimens~Species*Sex*Hours+Error(Subject/Hours),data=SP)).
My question is - is that the correct way to do it??
2. Below is the results output:
A. I am not sure I understand what is the meaning of the two error terms I 
get.
Does the first one show error between subjetcs
and the second - error within subjects?

Error: Subject –
Df  Sum Sq Mean Sq
Species  1 0.60715 0.60715
Error: Subject:Hours
  Df Sum Sq Mean Sq
Hours  1 158.24  158.24
Error: Within
Df Sum Sq Mean Sq F valuePr(>F)
Species  2  35.19   17.59 34.3017 2.733e-15 ***
Sex  1  18.98   18.98 37.0092 1.493e-09 ***
Hours1  40.02   40.02 78.0278 < 2.2e-16 ***
Species:Sex  2   1.290.64  1.25680.2849
Species:Hours2   9.954.97  9.6993 6.530e-05 ***
Sex:Hours1   0.660.66  1.27780.2585
Species:Sex:Hours2   1.380.69  1.34980.2596
Residuals 1486 762.200.51
---
B. How do I summarize this information for a report?
Is the below suggestion acceptable?
---
SourcedfSS  MS   F  P
-
Species235.19   17.59   34.3 <0.0001
Sex118.98   18.98   37.01 <0.0001
Species:Sex 2   1.290.64   1.25680.2849
Subject(Species)1   0.60715 0.60715
Subject(Hours) 1158.24  158.24
Hour1   40.02 40.02 78.0278<0.0001
Species:Hours   2   9.954.97 9.6993<0.0001
Sex:Hours   1   0.660.66 1.27780.2585
Species:Sex:Hours   2   1.380.69 1.3498 0.2596
Residuals1486   762.20  0.51
-
Very much obliged for your kind response
Gideon
Gideon Wasserberg (Ph.D.)
Wildlife research unit,
Department of wildlife ecology,
University of Wisconsin
218 Russell labs, 1630 Linden dr.,
Madison, Wisconsin 53706, USA.
Tel.:608 265 2130, Fax: 608 262 6099
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
_
Express yourself with the new version of MSN Messenger! Download today - 
it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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


Re: [R] time

2004-05-26 Thread Wolski
Hi!
I would extract the minutes from the time using sub (see ?sub) or (?grep)
than use them as factors (?as.factors)
and finally
?tapply

eg.
tt<-1:10
 fac<-c(rep(0,4),rep(1,6)) # here put the minutes from the time
fac
 [1] 0 0 0 0 1 1 1 1 1 1
fac<-as.factor(fac)
fac
 [1] 0 0 0 0 1 1 1 1 1 1
Levels: 0 1

tapply(t,fac,max)
 0  1 
 4 10 

Sincerely Eryk.



*** REPLY SEPARATOR  ***

On 5/26/2004 at 3:00 PM [EMAIL PROTECTED] wrote:

>Hi, i need select data from data frame, for example:
>x is a data frame with values in jump to 5 seconds
>12:10:00 51 //one minute
>12:10:05 63
>12:10:10 75
>12:10:15 88
>..
>12:10:59 45
>12:11:00 46 //another minute
>12:11:05 11
>..
>Have a command what to select the data minute to  minute, for example
>in the example above i need the maximun values minute to  minute
>1° minute-->88
>2° minute--> 46
>Thanks Ruben
>
>__
>[EMAIL PROTECTED] mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] an SJava array question

2004-05-26 Thread Rajarshi Guha
Hi,
  I'm using SJava (0.65) to interface some Java code I have and am
having trouble understanding the use of arrays. I have a function:

tmv <- function(fname) {
a <- .JavaArrayConstructor("int", dim=c(3,0))
.JavaSetArrayElement(a, .JavaArrayConstructor("int", dim=3), 1)
.JavaSetArrayElement(a, .JavaArrayConstructor("int", dim=3), 2)
.JavaSetArrayElement(a, .JavaArrayConstructor("int", dim=3), 3)
for (i in 1:3) {
for (j in 1:3) {
.JavaSetArrayElement(a, as.integer(i*j), i,j)
}
}
print(.JavaGetArrayElement(a, 1,1))
}

I expect that I should see 1 print out but instead I get

[[1]]
[1] 1 2 3
 
[[2]]
[1] 1 2 3

The SJava manual seems to indicate that .JavaGetArrayElement(a, 1,1)
gives the first element of the first array. 

Could anybody throw some light on this?

A related question is the an array of Strings.

Does .JavaArrayConstructor("String",3) give me an array of 3 Strings
(which are not yet defined) or a String of length 3? Or if I need to
allocate an array of Strings should I do:

r <- .JavaArrayConstructor( "String", c(3,0) )

and then for each element of r add a new array and then finally set the
individual elements to the actuial string values?

Is there any example code available that I could take a look at?

Thanks,

---
Rajarshi Guha <[EMAIL PROTECTED]> 
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
Q: What's purple and commutes?
A: An abelian grape.

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


[R] R: Help (two-way analysis of variance with contrasts)

2004-05-26 Thread joseclaudio.faria
Dears members of R list,

It would like that a more experienced statician in R helped me to complete
the analysis to follow:

r = gl(3, 8, label = c('r1', 'r2', 'r3'))
e = rep(gl(2, 4, label = c('e1', 'e2')), 3)
y = c(26.2, 26.0, 25.0, 25.4, 24.8, 24.6, 26.7, 25.2, 25.7, 26.3, 25.1,
26.4,
 19.6, 21.1, 19.0, 18.6, 22.8, 19.4, 18.8, 19.2, 19.8, 21.4, 22.8,
21.3)

df = data.frame(r, e, y)
attach(df)
  par(mfrow=c(2,1))
  interaction.plot(r, e, y, col = 'blue', ylab = 'y', xlab = 'r')

  interaction.plot(e, r, y, col = 'blue', ylab = 'y', xlab = 'r')
  av1 = aov(y ~ r*e)

  av2 = aov(y ~ r/e)
  efR_E = summary(av2, split = list('r:e' = list('e1 vs e2/r1' = 1, 'e1 vs
e2/r2' = 2, 'e1 vs e2/r3' = 3)))

  av3  = aov(y ~ e/r)
  efE_R = summary(av3, split = list('e:r' = list('r/e1' = c(1,3), 'r/e2' =
c(2,4

  mds = model.tables(av1, ty = 'means')
detach(df)

cat('\nData:'); cat('\n')
print(df)

cat('\nMeans:'); cat('\n')
print(mds)

cat('\nANOVA:'); cat('\n')
print(summary(av1)); cat('\n')

cat('\nANOVA - E effect in R levels:'); cat('\n')
print(efR_E); cat('\n')

cat('\nANOVA - R effect in E levels:'); cat('\n')
print(efE_R); cat('\n')

#I would like to get as resulted (efE_R) like this:
# ANOVA - R effect (contrasts) in E levels:
#Df   Sum SqMean Sq   F value
Pr(>F)
# e   1 19.082
#  e:r   (4)  (156.622)
#e:r: r/e1 (2)(87.122)
#  r1 vs (r2,r3)/e1 1  ?   ?
??
#  r2 vs r3/e11  ?   ?
??
#e:r: r/e2  (2)   (69.500)
#  r1 vs (r2,r3)/e1  1  ?   ?
??
#  r2 vs r3/e2 1  ?   ?
??
# Residuals  18  23.090 1.283



#Through manual calculations I got:
# ANOVA - R effect in E levels:
#   Df   Sum SqMean Sq   F valuePr(>F)
# e  1 19.082
#  e:r   (4)  (156.622)
#e:r: r/e1 (2)(87.122)
#  r1 vs (r2,r3)/e   1  19.26
#  r2 vs r3/e11  67.86
#e:r: r/e2 (2)(69.500)
#  r1 vs (r2,r3)/e   1  63.38
#  r2 vs r3/e216.12
# Residuals18   23.090 1.283

Best regards,

José Cláudio Faria
UESC/DCET
Brasil
73-634.2779
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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


[R] A data selection problem, suggestions highly appreciated

2004-05-26 Thread Yong Wang
Hi, All
I get following question:
A data format like following:

[Day time  x y]

Jan1 18:56:24 x1 y1
Jan1 18:56:25 x2 y2
Jan1 18:56:27 x3 y3
Jan1 18:56:28 x4 y4
Jan1 18:56:31 x5 y5
.
.

what I wanna do is to partion the time interval by unit of 5 seconds.
and pick x,y corresponding to the last time within that interval. for the 
example above,
suppose 18:56:24 is the starting time, the time included in the interval 
will be up to 18:56:28, therefore I want to get x4 and y4, and store them 
somewhere else. 
you might know this is the so called high frequency data. can you let me 
know how to do this partion and pick in R or Splus. 
suggestions are really and hihgly appreciated. 

thank you very much.
best regards
yong

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


[R] Outlier identification according to Hardin & Rocke (1999)

2004-05-26 Thread Kevin Wright
I'm trying to use a paper by Hardin & Rocke: 
http://handel.cipic.ucdavis.edu/~dmrocke/Robdist5.pdf
as a guide for a function to identify outliers in multivariate data.  Attached below 
is a function that is my attempt to reproduce their method and also a test to see what 
fraction of the data are identified as outliers.  Using this function I am able to 
reproduce their results regarding the asymptotic chi-square method, but not their new 
method using an asymptotic F method.  In particular, the asymptotic F method (and 
adjusted F method) seem to give critical distances that are too large and therefore no 
(or few) points are identified as outliers.

I have tried unsuccessfully to contact the authors of the paper to seek further 
information and / or numerical examples.

I would be most interested if anybody has used the method of Hardin & Rocke or can 
take the function I have provided below and modify it to reproduce their results.  
Note: The mvtnorm package is required.

Best,

Kevin Wright




outliers.id <- function(x, alpha=.05){
  # See: Hardin & Rocke (1999), "The Distribution of Robust Distances"
  # http://handel.cipic.ucdavis.edu/~dmrocke/Robdist5.pdf

  # See: Hardin & Rocke (2002), "Outlier Detection in the Multiple Cluster
  # Setting Using the Minimum Covariance Determinant Estimator"
  # http://bioinfo.cipic.ucdavis.edu/publications/print_pub?pub_id=736&category=1
  
  # Drop factors first
  factors <- names(x)[sapply(x,is.factor)] 
  if(length(factors)>0)
x <- x[-factors]

  # Get the robust location/scale estimates
  require(MASS)
  covResult <- cov.rob(x)
  
  # Calculate the mahalanobis distance for each datum
  distance <- mahalanobis(x,covResult$center,covResult$cov)
  
  n <- nrow(x)
  p <- ncol(x)
  h <- floor((n+p+1)/2)

  # Asymptotic chi-square method (page 11)
  # Often identifies too many points as outliers
  critical.chi <- qchisq(1-alpha, p)
  cat("Chi square critical distance:", critical.chi,"\n")

  # Now the approximate F method.  First estimate c (page 19)
  c <- pchisq(qchisq(1-h/n, p),p+2) / (h/n)
  
  # Now to estimate m (page 22)
  a <- (n-h)/n
  qa <- qchisq(1-a,p)
  ca <- (1-a)/pchisq(qa,p+2)
  c2 <- -pchisq(qa,p+2)/2
  c3 <- -pchisq(qa,p+4)/2
  c4 <- 3 * c3
  b1 <- ca * (c3 - c4) / (1-a)
  b2 <- 0.5 + ca/(1-a) * (c3 - qa/p * (c2 + (1-a)/2))
  v1 <- (1-a) * b1^2 * (a * (ca * qa/p -1)^2 -1) -
2 * c3 * ca^2 * (3* (b1 - p * b2)^2 + (p+2) * b2 * (2*b1 - p*b2))
  v2 <- n * (b1 * (b1 - p*b2) * (1-a))^2 * ca^2
  v <- v1/v2
  m <- 2/(ca^2 * v)

  # (page 17)
  critical.F.asy <- p*m * qf(1-alpha, p, m-p+1) / (c * (m-p+1))
  cat("Asymptotic F critical distance:",critical.F.asy,"\n")
  
  # The small-sample (hundreds of points) adjustment to m.
  # Hardin & Rocke, 2002, page 631
  m <- m * exp(0.725 - 0.00663*p -0.0780 * log(n))
  # Finally, the critical point (using adjusted m)
  critical.F.adj <- p*m*qf(1-alpha, p, m-p+1) / (c * (m-p+1))
  cat("Adjusted asymptotic F critical distance:",critical.F.adj,"\n")
  
  #outliers <- as.integer(distance > critical)
  x$Distances <- distance
  #x$Outliers <- outliers
  attr(x,"critical.chi") <- critical.chi
  attr(x,"critical.F.asy") <- critical.F.asy
  attr(x,"critical.F.adj") <- critical.F.adj
  return(x)
}

# Try to reproduce the tables in the paper
if(FALSE){
  require(mvtnorm)
  # Simulate data
  n <- 500;p <- 5
  dat <- rmvnorm(n,rep(0,p),diag(p))

  # Identify outliers
  dat.out <- outliers.id(as.data.frame(dat),alpha=.05)
  
  # Now see what percent are identified as outliers
  cat("Chi-square \n")
  100*sum(dat.out$Distances>attr(dat.out,"critical.chi"))/n
  cat("Approximate F asymptotic \n")
  100*sum(dat.out$Distances>attr(dat.out,"critical.F.asy"))/n
  cat("Approximate F adjusted \n")
  100*sum(dat.out$Distances>attr(dat.out,"critical.F.adj"))/n
}

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


[R] 2 way repeated measures ANOVA using R: syntax and reporting question

2004-05-26 Thread GIDEON WASSERBERG
Dear Friends

I have a technical question about conducting 2 way repeated measures ANOVA analysis 
using R.

1. Data set: repeated measurement of activity over night (2 hr. intervals)
repeated (within subject)factor: Hours
Between subject: Species, Sex
Dependent variables: specimens

Here is how the data arranged for the analysis:

Subject Replicate   HourSp. Specimens
1   1  1a   
2   1  1a   
3   1  1b   
4   1  1b   
5   2  1a   
6   2  1a   
7   2  1b   
8   2  1b   
1   1  2a   
2   1  2a   
3   1  2b   
4   1  2b   
5   2  2a
6   2  2a
7   2  2b
8   2  2b


here's the command I used: 
summary(aov(Specimens~Species*Sex*Hours+Error(Subject/Hours),data=SP)).

My question is - is that the correct way to do it??

2. Below is the results output:
A. I am not sure I understand what is the meaning of the two error terms I get. 
Does the first one show error between subjetcs
and the second - error within subjects?

Error: Subject – 
Df  Sum Sq Mean Sq
Species  1 0.60715 0.60715

Error: Subject:Hours
  Df Sum Sq Mean Sq
Hours  1 158.24  158.24

Error: Within
Df Sum Sq Mean Sq F valuePr(>F)
Species  2  35.19   17.59 34.3017 2.733e-15 ***
Sex  1  18.98   18.98 37.0092 1.493e-09 ***
Hours1  40.02   40.02 78.0278 < 2.2e-16 ***
Species:Sex  2   1.290.64  1.25680.2849
Species:Hours2   9.954.97  9.6993 6.530e-05 ***
Sex:Hours1   0.660.66  1.27780.2585
Species:Sex:Hours2   1.380.69  1.34980.2596
Residuals 1486 762.200.51  
---
B. How do I summarize this information for a report?
Is the below suggestion acceptable?
---

SourcedfSS  MS   F  P
-
Species235.19   17.59   34.3 <0.0001
Sex118.98   18.98   37.01 <0.0001
Species:Sex 2   1.290.64   1.25680.2849
Subject(Species)1   0.60715 0.60715 
Subject(Hours) 1158.24  158.24  
Hour1   40.02 40.02 78.0278<0.0001
Species:Hours   2   9.954.97 9.6993<0.0001
Sex:Hours   1   0.660.66 1.27780.2585
Species:Sex:Hours   2   1.380.69 1.3498 0.2596
Residuals1486   762.20  0.51 
-  
 
Very much obliged for your kind response

Gideon


Gideon Wasserberg (Ph.D.)
Wildlife research unit,
Department of wildlife ecology,
University of Wisconsin
218 Russell labs, 1630 Linden dr.,
Madison, Wisconsin 53706, USA.
Tel.:608 265 2130, Fax: 608 262 6099

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


[R] time

2004-05-26 Thread solares
Hi, i need select data from data frame, for example:
x is a data frame with values in jump to 5 seconds
12:10:00 51 //one minute
12:10:05 63
12:10:10 75
12:10:15 88
..
12:10:59 45
12:11:00 46 //another minute
12:11:05 11
..
Have a command what to select the data minute to  minute, for example
in the example above i need the maximun values minute to  minute
1° minute-->88
2° minute--> 46
Thanks Ruben

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


Re: [R] identify() - image()

2004-05-26 Thread Thomas Petzoldt
javier garcia - CEBAS wrote:
Hi all;
Just to ask if you know about any available function in R to identify points 
in a image plotted in X11. Something like the function identify(), but able 
to extract (x,y,value) groups from the image.
Maybe, something like that?
z <- matrix(runif(100),10,10)
image(list(x = 0:9, y = 0:9, z = z))
p <- locator(1)
z[round(p$x), round(p$y)]
Thomas P.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] identify() - image()

2004-05-26 Thread Barry Rowlingson
javier garcia - CEBAS wrote:
Hi all;
Just to ask if you know about any available function in R to identify points 
in a image plotted in X11. Something like the function identify(), but able 
to extract (x,y,value) groups from the image.
 this is what I use:
image.identify <- function(xyz, mark=T, digits=3){
  nx <- length(xyz$x) - 1
  ny <- length(xyz$y) - 1
  if(!all(dim(xyz$z)==c(nx,ny))){
stop("Really need image specified by cell edges")
  }
  res <- data.frame()
  xy <- locator(1)
  while(!is.null(xy)){
xbin <- as.numeric(cut(xy$x,xyz$x))
ybin <- as.numeric(cut(xy$y,xyz$y))
if(mark){
  points(xy$x,xy$y,pch=19,cex=.5,col="blue")
text(xy$x,xy$y,format(xyz$z[xbin,ybin],digits=digits),adj=-.2,col="blue")
}
cat("[",xbin,",",ybin,"] = ",xyz$z[xbin,ybin],"\n",sep='')
res <- 
rbind(res,data.frame(i=xbin,j=ybin,x=xy$x,y=xy$y,z=xyz$z[xbin,ybin]))
xy <- locator(1)
  }
  res
}

Try:
 > m=list(x=1:11,y=1:11,z=matrix(runif(100),10,10))
 > image(m)
 > identify.image(m)
 then click some things. Button 2 to finish.
 The returned data frame gives row and column in the 'z' matrix, x and 
y coordinates, and value of the z matrix at that point.

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


[R] identify() - image()

2004-05-26 Thread javier garcia - CEBAS
Hi all;
Just to ask if you know about any available function in R to identify points 
in a image plotted in X11. Something like the function identify(), but able 
to extract (x,y,value) groups from the image.

Thanks and best regards,

Javier

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


[R] (no subject)

2004-05-26 Thread Moustafa ElHousinie
I have data on disappearance of virus C from blood of acutely infected
   humans.  Blood samples were taken approximately 2, 3 and 6 months after 
the
   expected date of exposure.  It is noted that :
   1- not all timepoints are available
   2- in few cases the person turned negative early (2-3 months) to turm 
back
   to positive after 6 months
   3- the definition of spontaneos clearance is not well established but
   usually treatement, if any, should be started if the person remain 
positive
   after 5-6 months from exposure
   the questions are:
   is this a logistic regression problem or time to event (lifetable 
analysis)
   problem? and in either case HOW to proceed with R
   thanks in advance
   Mostafa

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


Re: [R] thanks again

2004-05-26 Thread Wolski
Hi!

"The magic cauldron"

http://www.catb.org/~esr/writings/magic-cauldron/magic-cauldron.html

and

http://www.catb.org/~esr/writings/magic-cauldron/magic-cauldron-9.html#ss9.4


Sincerely
Eryk

*** REPLY SEPARATOR  ***

On 5/26/2004 at 9:40 AM Andrew Robinson wrote:

>http://www.cafepress.com/
>
>is one such option.  I have no personal experience with it.
>
>Andrew
>
>On Wed, 26 May 2004, Dirk Eddelbuettel
>wrote:
>
>> On Wed, May 26, 2004 at 06:30:40PM +0200, Achim Zeileis wrote:
>> > As this useR! is over, I guess it's a bit too late for a useR! 2004
>> > shirt.
>> >
>> > In general, I would agree with you that it would be nice (and not only
>> > for fun) to have shirts (and coffee mugs and basecaps and ...) with R
>> > logos or maybe useR! logos. This has been discussed now and then and if
>> > I recall it correctly the reason that nobody actually started doing it
>> > is that you would have to spend some time setting it up - and most
>> > people prefer writing R code instead of mailing R shirts around the
>> > world. Time was the main reason for me not do organize shirts for the
>> > useR! - there were so many other things to do and prepare.
>> > Another point which always kept me from thinking about something like
>> > this more seriously is the poor quality of the R logo.
>> > But John Fox mentioned in a discussion that instead of some R user
>> > doing the work, maybe there are T-shirt mailorders around which could
>do
>> > most of the work. So maybe I will have the time to look at this.
>>
>> I visited such a site a few months back, but cannot recall the name or
>URL.
>> They had e.g. numerous Debian things.  If the useR png image was made
>> available, they could do the commercialisation.  With a bit of luck, we
>may
>> find a shop that would also donate back a percentage of the proceeds the
>> family^H^H^H^H^H^foundation. There is probably less merit in the purely
>> commerical play.
>>
>> Dirk
>>
>> --
>> The relationship between the computed price and reality is as yet
>unknown.
>>  -- From the pac(8) manual
>page
>>
>> __
>> [EMAIL PROTECTED] mailing list
>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>http://www.R-project.org/posting-guide.html
>>
>
>Andrew Robinson Ph: 208 885 7115
>Department of Forest Resources  Fa: 208 885 6226
>University of Idaho E : [EMAIL PROTECTED]
>PO Box 441133   W : http://www.uidaho.edu/~andrewr
>Moscow ID 83843 Or: http://www.biometrics.uidaho.edu
>No statement above necessarily represents my employer's opinion.
>
>__
>[EMAIL PROTECTED] mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] Subtracting number of days from a date

2004-05-26 Thread Prof Brian Ripley
On Wed, 26 May 2004, Hoeven, Maarten van der wrote:

> suppose I have a date, say May 15 2004, and I want to now what date it
> is 23 days before that date. The way to calculate the new date should
> (...) take account of leap years :)
> 
> 
> In pseudocode:
> 
> olddate <- "May 15 2004"
> newdate <- olddate-23
> 
> I looked around in POSIXct etc..., maybe I overlooked?

olddate <- as.Date("May 15 2004", "%B %d %Y")
newdate <- olddate - 23
newdate
[1] "2004-04-22"
format(newdate, "%B %d %Y")
[1] "April 22 2004"

looks straightforward enough to me (and it knows about leap years).

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] Subtracting number of days from a date

2004-05-26 Thread Gabor Grothendieck
Hoeven, Maarten van der  knmi.nl> writes:

: suppose I have a date, say May 15 2004, and I want to now what date it is 23 
days before that date. The way to
: calculate the new date should (...) take account of leap years :)
: 
: In pseudocode:
: 
: olddate <- "May 15 2004"
: newdate <- olddate-23
: 
: I looked around in POSIXct etc..., maybe I overlooked?

as.Date("2005-05-24")-23

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


Re: [R] thanks again

2004-05-26 Thread Andrew Robinson
http://www.cafepress.com/

is one such option.  I have no personal experience with it.

Andrew

On Wed, 26 May 2004, Dirk Eddelbuettel
wrote:

> On Wed, May 26, 2004 at 06:30:40PM +0200, Achim Zeileis wrote:
> > As this useR! is over, I guess it's a bit too late for a useR! 2004
> > shirt.
> >
> > In general, I would agree with you that it would be nice (and not only
> > for fun) to have shirts (and coffee mugs and basecaps and ...) with R
> > logos or maybe useR! logos. This has been discussed now and then and if
> > I recall it correctly the reason that nobody actually started doing it
> > is that you would have to spend some time setting it up - and most
> > people prefer writing R code instead of mailing R shirts around the
> > world. Time was the main reason for me not do organize shirts for the
> > useR! - there were so many other things to do and prepare.
> > Another point which always kept me from thinking about something like
> > this more seriously is the poor quality of the R logo.
> > But John Fox mentioned in a discussion that instead of some R user
> > doing the work, maybe there are T-shirt mailorders around which could do
> > most of the work. So maybe I will have the time to look at this.
>
> I visited such a site a few months back, but cannot recall the name or URL.
> They had e.g. numerous Debian things.  If the useR png image was made
> available, they could do the commercialisation.  With a bit of luck, we may
> find a shop that would also donate back a percentage of the proceeds the
> family^H^H^H^H^H^foundation. There is probably less merit in the purely
> commerical play.
>
> Dirk
>
> --
> The relationship between the computed price and reality is as yet unknown.
>  -- From the pac(8) manual page
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

Andrew Robinson  Ph: 208 885 7115
Department of Forest Resources   Fa: 208 885 6226
University of Idaho  E : [EMAIL PROTECTED]
PO Box 441133W : http://www.uidaho.edu/~andrewr
Moscow ID 83843  Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.

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


Re: [R] thanks again

2004-05-26 Thread Dirk Eddelbuettel
On Wed, May 26, 2004 at 06:30:40PM +0200, Achim Zeileis wrote:
> As this useR! is over, I guess it's a bit too late for a useR! 2004
> shirt.
> 
> In general, I would agree with you that it would be nice (and not only
> for fun) to have shirts (and coffee mugs and basecaps and ...) with R
> logos or maybe useR! logos. This has been discussed now and then and if
> I recall it correctly the reason that nobody actually started doing it
> is that you would have to spend some time setting it up - and most
> people prefer writing R code instead of mailing R shirts around the
> world. Time was the main reason for me not do organize shirts for the
> useR! - there were so many other things to do and prepare.
> Another point which always kept me from thinking about something like
> this more seriously is the poor quality of the R logo.
> But John Fox mentioned in a discussion that instead of some R user
> doing the work, maybe there are T-shirt mailorders around which could do
> most of the work. So maybe I will have the time to look at this.

I visited such a site a few months back, but cannot recall the name or URL.
They had e.g. numerous Debian things.  If the useR png image was made
available, they could do the commercialisation.  With a bit of luck, we may
find a shop that would also donate back a percentage of the proceeds the
family^H^H^H^H^H^foundation. There is probably less merit in the purely
commerical play.

Dirk

-- 
The relationship between the computed price and reality is as yet unknown.  
 -- From the pac(8) manual page

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


Re: FW: [R] is.weekend() odd behaviour

2004-05-26 Thread Gabor Grothendieck

I think the user should be forced to convert explicitly from POSIXct
to chron before is.weekend is used.  That way the user will know for 
sure what time zone he is converting with respect to.  Having it done 
silently will just cause subtle errors.

IMHO the correct functionality is to give an error message if the user
attempts to provide a POSIXct date.


Matthew Dowle  concordiafunds.com> writes:

: 
: Kurt,
: 
: Uwe suggested I write to you as maintainer of chron ... at the start of
: is.weekend, in the check on the argument type, maybe just change chron() to
: as.chron()? This would ensure as.chron.POSIXt gets called on POSIXt
: arguments, and (I think) fixes the problem. I tested and it seems ok. No
: warning/error required.
: 
: > is.weekend
: function(x)
: {
: if(!inherits(x, "dates"))
: if(is.character(x) || is.numeric(x))
: x <- as.chron(x)   # was  x <- chron(x)
: else stop("x must inherit from dates")
: 
: }
: 
: -Original Message-
: From: Uwe Ligges [mailto:ligges  statistik.uni-dortmund.de] 
: Sent: 26 May 2004 13:20
: To: Matthew Dowle
: Cc: 'r-help  stat.math.ethz.ch'
: Subject: Re: [R] is.weekend() odd behaviour
: 
: 
: Matthew Dowle wrote:
: 
: > Thanks. When is.weekend() is given an object it doesn't know about, 
: > could a warning or error be added? At the moment, I think you're 
: > agreeing, that it silently returns a random TRUE/FALSE.
: 
: It's not random, it depends on the value of Sys.time(), which also 
: includes seconds .
: I agree that a warning or error might be sensible. So I think you are 
: about to write a note to the maintainer of package "chron" including 
: patches for is.weekend() and friends?
: 
: Uwe Ligges
: 
: 
: > -Original Message-
: > From: Uwe Ligges [mailto:ligges  statistik.uni-dortmund.de]
: > Sent: 26 May 2004 11:55
: > To: Matthew Dowle
: > Cc: 'r-help  stat.math.ethz.ch'
: > Subject: Re: [R] is.weekend() odd behaviour
: > 
: > 
: > Matthew Dowle wrote:
: > 
: > 
: >>It seems is.weekend() is unsure ?
: > 
: > 
: > It is completely sure, if an object is given is.weekend() knows about 
: > as in:
: > 
: > table(is.weekend(sapply(1:100,
: > function(i){Sys.sleep(0.05);as.chron(Sys.time())})))
: > 
: > (note the as.chron() call!)
: > 
: > Uwe Ligges
: > 
: > 
: > 
: > 
: >># Start R 1.9.0 with --vanilla on windows xp
: >># load package chron
: >>
: >>
: >>
: >>>table(is.weekend(sapply(1:100,
: >>>function(i){Sys.sleep(0.05);Sys.time()})))
: >>
: >>FALSE  TRUE 
: >>   6832 
: >>
: >>
: >>>date()
: >>
: >>[1] "Wed May 26 11:18:56 2004"
: >>
: >>
: >>
: >>>version _  
: >>
: >>platform i386-pc-mingw32
: >>arch i386   
: >>os   mingw32
: >>system   i386, mingw32  
: >>status  
: >>major1  
: >>minor9.0
: >>year 2004   
: >>month04 
: >>day  12 
: >>language R

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


Re: [R] thanks again

2004-05-26 Thread Achim Zeileis
Chad:

> Thanks again for the conference.  We had good fun.

Thanks, we too ;-) If only I could get some sleep now...

> I want a useR t-shirt.  After lots of drinking and discussion with
> Fritz Leisch at dinner on saturday, I feel there will be no chance for
> an official T-shirt.
> 
> My question is:  any advice/ thoughts on how there can be T-shirts for
> the conference?

As this useR! is over, I guess it's a bit too late for a useR! 2004
shirt.

In general, I would agree with you that it would be nice (and not only
for fun) to have shirts (and coffee mugs and basecaps and ...) with R
logos or maybe useR! logos. This has been discussed now and then and if
I recall it correctly the reason that nobody actually started doing it
is that you would have to spend some time setting it up - and most
people prefer writing R code instead of mailing R shirts around the
world. Time was the main reason for me not do organize shirts for the
useR! - there were so many other things to do and prepare.
Another point which always kept me from thinking about something like
this more seriously is the poor quality of the R logo.
But John Fox mentioned in a discussion that instead of some R user
doing the work, maybe there are T-shirt mailorders around which could do
most of the work. So maybe I will have the time to look at this.

Best wishes from Vienna,
Achim

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


Re: [R] Common principle components

2004-05-26 Thread Spencer Graves
Google just returned "about" 1.8M hits for "principle components" and 
3.2M hits for "principal components".  Evidently, eigenvectors are more 
your friend (pal) than a structure for the space by a factor of roughly 
2 to 1. 

spencer graves
Martin Maechler wrote:
"JosePG" == J Pedro Granadeiro <[EMAIL PROTECTED]>
   on Wed, 26 May 2004 16:01:22 +0100 writes:
   

   JosePG> I am sorry for not being clear. I meant the methods detailed in:
   JosePG> Flury, B. (1988). Common Principle Components Analysis and Related 
   JosePG> Multivariate Models, John Wiley and Sons, New York. 

Well, I'm 100% sure the title of that book is different
(and so should be your e-mail subject)
Hint: Look carefully at the end of the 2nd word ...
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

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


Re: [R] Common principle components

2004-05-26 Thread Martin Maechler
> "JosePG" == J Pedro Granadeiro <[EMAIL PROTECTED]>
> on Wed, 26 May 2004 16:01:22 +0100 writes:

JosePG> I am sorry for not being clear. I meant the methods detailed in:
JosePG> Flury, B. (1988). Common Principle Components Analysis and Related 
JosePG> Multivariate Models, John Wiley and Sons, New York. 

Well, I'm 100% sure the title of that book is different
(and so should be your e-mail subject)

Hint: Look carefully at the end of the 2nd word ...

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


Re: [R] Opening help pages in new tab of existing Mozilla Firebird

2004-05-26 Thread Marc Schwartz
On Wed, 2004-05-26 at 10:32, Kevin Wright wrote:
> Subject pretty much says it all.  I currently have options()$browser
> set to open help pages in Mozilla Firebird, but it starts a new window
> each time and I would like a new 'tab' in an existing window.
> 
> Sorry if this is obvious, but I can't find anything.
> 
> Kevin Wright


You do not indicate which OS you are running, but under Linux, you can
use a script such as the following. It will check the current process
list to see if an instance of Firefox is already present. If so, it will
open a new tab. Otherwise, it opens a new window.

#!/bin/sh 

# if 'firefox-bin' in current ps listing,
if ps -e|grep firefox-bin >/dev/null 2>&1; then
  firefox -remote "openURL(${1}, new-tab)" && exit 0
else 
#open new instance 
  firefox $1 && exit 0
fi


Copy the above into a script file and set it to be executable (chmod +x
ScriptFileName). Then set options()$browser to use the script file.

Note also that the recent version of the Mozilla standalone browser is
called Firefox, in recognition of the existence of the Firebird
(formerly Interbase) SQL database project.

HTH,

Marc Schwartz

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


Re: [R] Opening help pages in new tab of existing Mozilla Firebird

2004-05-26 Thread Michael Morley
Try this Mozilla Firefox extension,
http://www.intraplanar.net/projects/tabprefs/
If you more control over tabs there is this extension as well
http://white.sakura.ne.jp/~piro/xul/_tabextensions.html.en
-Mike
Kevin Wright wrote:
Subject pretty much says it all.  I currently have options()$browser
set to open help pages in Mozilla Firebird, but it starts a new window 
each time and I would like a new 'tab' in an existing window.

Sorry if this is obvious, but I can't find anything.
Kevin Wright
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

--
Michael Morley
Bioinformatics Specialist
University of Pennsylvania
Department of Pediatrics
3516 Civic Center Blvd.,
510B Abramson Pediatric Research Center,
Philadelphia, PA 19104-4318.
Phone: (215) 590-7673
FAX: (215) 590-3709
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Using R in C++

2004-05-26 Thread Vadim Ogranovich
Look at "Writing R Extensions" guide. It covers both R-from-C and C-from-R.

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jörgen 
> Wallerman
> Sent: Wednesday, May 26, 2004 3:09 AM
> To: '[EMAIL PROTECTED]'
> Subject: [R] Using R in C++
> 
> 
> Hello,
> 
> Is it possible to use R functions (in my case: ks.test()) 
> from C++ -applications? That is, I get the impression R can 
> execute C/C++ code, but is there any possibility to do the 
> opposite? Where can I find help?
> 
> 
> ---
> Ph. D. Jörgen Wallerman
> Swedish University of Agricultural Sciences
> Remote Sensing Laboratory
> S901 83 UMEÅ
>  
> ###
> 
> This message has been scanned by F-Secure 
> Anti-Virus for Microsoft Exchange.
> 
> ###
> 
> __
> [EMAIL PROTECTED] mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> PLEASE 
> do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

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


Re: [R] No direct or inherited method for function "update"

2004-05-26 Thread Dick Beyer
Thanks very much for your help.  Following your suggestion, I found that the offending 
bioconductor package is affy.  I will report that to the bioconductor folks.

***
Richard P. Beyer, Ph.D. University of Washington
Tel.:(206) 616 7378 Env. & Occ. Health Sci. , Box 354695
Fax: (206) 685 4696 4225 Roosevelt Way NE, # 100
Seattle, WA 98105-6099
http://depts.washington.edu/ceeh/ServiceCores/FC5/FC5.html
***

On Wed, 26 May 2004, Prof Brian Ripley wrote:

> Try doing this without all those Bioconductor packages loaded.  It does 
> work in base R, and I suspect that one of your packages has redefined 
> update (by adding S4 methods?).  If you track down exactly which package 
> causes the problem, you can report it to the appropriate person.
> 
> On Tue, 25 May 2004, Dick Beyer wrote:
> 
> > I used to be able to call update() for lme objects. Now I get this error:
> > 
> > >   ge.lme <- update(ge.lme, data=dat)
> > Error in update(ge.lme, data = dat) : No direct or inherited method for function 
> > "update" for this call
> > 
> > 
> > Here is the relevant portion of my code:
> > 
> > ge <- eset[1,]
> > dat<- data.frame(age, gen, fdr, ge)
> > ge.lme <- lme(fixed=ge~age+gen+age*gen, data=dat, random=~ 1| fdr)
> > for (i in 1:nrow(eset)) {
> >   dat$ge <- c(eset[i,])
> >   ge.lme <- update(ge.lme, data=dat)
> >   .
> >   .
> >   .
> > }
> > 
> > I am using:
> > base 1.9.0 
> > utils 1.9.0 
> > graphics 1.9.0 
> > stats 1.9.0 
> > methods 1.9.0 
> > Biobase 1.4.14 
> > affy 1.4.30 
> > gcrma 1.1.0 
> > annaffy 1.0.7 
> > KEGG 1.4.0 
> > GO 1.5.1 
> > mgu74av2 1.4.0 
> > nlme 3.1-48 
> > xtable 1.2-1 
> > 
> > Any help or suggestions would be most appreciated.
> > 
> > Thanks much,
> > Dick
> > ***
> > Richard P. Beyer, Ph.D. University of Washington
> > Tel.:(206) 616 7378 Env. & Occ. Health Sci. , Box 354695
> > Fax: (206) 685 4696 4225 Roosevelt Way NE, # 100
> > Seattle, WA 98105-6099
> > http://depts.washington.edu/ceeh/ServiceCores/FC5/FC5.html
> > 
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> > 
> > 
> 
> -- 
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
> 
>

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


Re: [R] Need help on Mclus output

2004-05-26 Thread Bhaskar S. Manda
On Wed, 26 May 2004 03:34:14 +0200, Max Marinucci wrote
> I have fitted a mixture with 4 normal components on a univariate 
> distribution using the Mclust package. Now, I would like to get a 
> variable with the cluster membership of each class, or in

If you've loaded
   library(mclust)

you can do
   print(my_Mclust_object$classification)

or assign it to a variable. 
   help(Mclust)

shows the following to be similarly available.
   bic,BIC,modelName,classification,uncertainty,mu,sigma,pro,z,loglik

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


[R] Opening help pages in new tab of existing Mozilla Firebird

2004-05-26 Thread Kevin Wright

Subject pretty much says it all.  I currently have options()$browser
set to open help pages in Mozilla Firebird, but it starts a new window 
each time and I would like a new 'tab' in an existing window.

Sorry if this is obvious, but I can't find anything.

Kevin Wright

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


[R] Subtracting number of days from a date

2004-05-26 Thread Hoeven, Maarten van der
Hi group,

suppose I have a date, say May 15 2004, and I want to now what date it is 23 days 
before that date. The way to calculate the new date should (...) take account of leap 
years :)


In pseudocode:

olddate <- "May 15 2004"
newdate <- olddate-23

I looked around in POSIXct etc..., maybe I overlooked?

Thanks,
Maarten
-- 

Zie ook/see also: http://www.knmi.nl/maildisclaimer.html

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


Re: [R] multi read.table function and read.table function not accepting col.names

2004-05-26 Thread Wolski
Hi!

?

1.
?lapply

mydataframelist<- lapply(listwithpathstofile, 
read.table,col.names=names,na.strings="-999.00")

If you like to do more with the read in table say read.table and than some name 
assignments
you can also define a own function and pass it to lapply.
(or use the for loop.)


* by the way,by defining the variable names you mask the function names.

2.
Not shure if I understand you problem.
lapply returns a list and not a data.frame 
you can access each data.frame by eg. mydataframelist[[1]] etc. separatly



Eryk.

Ps. At 13.5.2004 there where an e-mail exchange concerning reading.tables.

*** REPLY SEPARATOR  ***

On 5/26/2004 at 2:45 PM Laura Quinn wrote:

>Thank you for your earlier help, I have a couple of related questions.
>
>With the lapply function, is it still possible to assign column names to
>each column of every data frame, again I have tried and it doesn't seem to
>like it..
>
>and is it also possible to assign names to each data frame when I do
>lapply rather than each one being a subset of a larger frame (I don't seem
>to be able to attach these as individual objects).
>
>Thanks again,
>Laura
>
>On Wed, 26 May 2004, Wolski wrote:
>
>> Hi!
>>
>> 1.
>> assuning that names is the vector with the names.
>> try col.names=names instead of "names"
>>
>> 2.
>> Several ways
>> a)
>> use
>> lapply(listwithpathstofiles,read.tabel,remaining, options) //u will get
>it stored in the list.
>> b)
>> or use for loop and append to list. mylist<-list()
>> c)
>> or look
>> ?assing
>> to generate several hundred objects in the envrovment.
>>
>> Sincerely Eryk
>>
>> *** REPLY SEPARATOR  ***
>>
>> On 5/26/2004 at 12:51 PM Laura Quinn wrote:
>>
>> >I am using R-1.8.0 on Debian.
>> >
>> >I'm trying to read in a large table (1441*16) which currently has no
>> >header line. I have set up a list of column names which is 16 names
>long.
>> >
>> >when i try the following:
>> >
>>
>>myfiledate.01<-read.table("filenamedate.01",row.names=NULL,col.names="names",na.strings="-999.00")
>> >
>> >I am returned with an error saying there are more columsh than column
>> >names. I am sure I have done this successfully in the past so can't
>> >understand the problem. I have done the read.table function without
>> >specifying col.names and it works fine and i end up with a 1441*16
>> >data.frame.
>> >
>> >Also as I have several hundred of these tables to read into R, all
>having
>> >the same dimension and all having the same column names, is it possible
>to
>> >automate R so they will all be read in at once - each table represents a
>> >different days worth of data.
>> >
>> >Thanks
>> >
>> >Laura
>> >
>> >__
>> >[EMAIL PROTECTED] mailing list
>> >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>> >PLEASE do read the posting guide!
>http://www.R-project.org/posting-guide.html
>>
>>
>>
>> Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic
>> Ihnestrasse 63-73 14195 Berlin   'v'
>> tel: 0049-30-83875219   /   \
>> mail: [EMAIL PROTECTED]---W-W   
>http://www.molgen.mpg.de/~wolski
>>
>>



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] Common principle components

2004-05-26 Thread J. Pedro Granadeiro
I am sorry for not being clear. I meant the methods detailed in:

Flury, B. (1988). Common Principle Components Analysis and Related 
Multivariate Models, John Wiley and Sons, New York. 

(see also:
http://www.quantlet.com/mdstat/scripts/mva/htmlbook/mvahtmlframe97.html).

Thank you very much.

José Pedro Granadeiro

On Quarta Maio 26 2004 13:31, you wrote:
> Not sure what that (Common pc) is, but check prcomp() and princomp().
> Hank Stevens
>
> On May 26, 2004, at 6:40 AM, J. Pedro Granadeiro wrote:
> > Dear all,
> >
> > Can anyone point me to a package that can perform Common principle
> > components?
> >
> > Thank you.
> >
> > José P. Granadeiro
> >
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
>
> Dr. Martin Henry H. Stevens, Assistant Professor
> 338 Pearson Hall
> Botany Department
> Miami University
> Oxford, OH 45056
>
> Office: (513) 529-4206
> Lab: (513) 529-4262
> FAX: (513) 529-4243
> http://www.cas.muohio.edu/botany/bot/henry.html
> http://www.muohio.edu/ecology/
> http://www.muohio.edu/botany/

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


Re: [R] I/O fortran instructions and dyn.load

2004-05-26 Thread Gilles GUILLOT
It works with  R CMD SHLIB test.f
Thanks.

Gilles 

> Try
>
> R CMD SHLIB test.f
>
> If SHLIB know it has to deal with Fortran code, it adds the appropriate
> libraries.
>
> On Wed, 26 May 2004, Gilles GUILLOT wrote:
> > I have the following Fortran code
> >
> > subroutine sub(path)
> > character*100 path
> > open(10,file=path)
> > end
> >
> > saved as test.f
> >
> > which I compile with
> > g77 -c test.f
> >
> > then I make the shared libary in R (Version 1.9.0) with
> > system("R CMD SHLIB test.o")
> >
> > so far, everything OK.
> >
> > But
> > dyn.load("test.so")
> > returns the following error message:
> > Error in dyn.load(x, as.logical(local), as.logical(now)) :
> > unable to load shared library "test.so":
> >   test.so: undefined symbol: f_open
> >
> > I get similar error messages with r/w Fortran instructions like
> > write(*,*) , read(*,*)
> >
> > I used to use such programs on my computer under mandrake linux 10.
> > The problem reported occurs on a new server operating under
> > another linux distrib (debian).
> >
> > Thanks in advance for any help,
> > Gilles

-- 
_
Gilles GUILLOT
INRA -Département Mathématiques et Informatique Appliquées

Unité de Mixte de Recherche
INRA - INAPG - ENGREF
Institut National Agronomique de Paris-Grignon
16 rue Claude Bernard
75231 Paris cedex 5

Aile Claude Bernard
Niveau cours +3 étages

tel : +33 (0)1 44 08 72 71
fax : +33 (0)1 44 08 16 66
http://www.inapg.fr/ens_rech/mathinfo/personnel/guillot/welcome.html

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


[R] (BRMA) NTI - Internet Controlada

2004-05-26 Thread BRmultiaccess

NTI - Internet Controlada

E-mail bloqueado devido a restrições no servidor de e-mail, o e-mail possuia um virus, 
qualquer duvida contactar o Departamento de Informática. Gaia Importação e Exportação 
Ltda

Para:  [EMAIL PROTECTED]
Assunto:  Information

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


FW: [R] is.weekend() odd behaviour

2004-05-26 Thread Matthew Dowle

Kurt,

Uwe suggested I write to you as maintainer of chron ... at the start of
is.weekend, in the check on the argument type, maybe just change chron() to
as.chron()? This would ensure as.chron.POSIXt gets called on POSIXt
arguments, and (I think) fixes the problem. I tested and it seems ok. No
warning/error required.

> is.weekend
function(x)
{
if(!inherits(x, "dates"))
if(is.character(x) || is.numeric(x))
x <- as.chron(x)   # was  x <- chron(x)
else stop("x must inherit from dates")

}

-Original Message-
From: Uwe Ligges [mailto:[EMAIL PROTECTED] 
Sent: 26 May 2004 13:20
To: Matthew Dowle
Cc: '[EMAIL PROTECTED]'
Subject: Re: [R] is.weekend() odd behaviour


Matthew Dowle wrote:

> Thanks. When is.weekend() is given an object it doesn't know about, 
> could a warning or error be added? At the moment, I think you're 
> agreeing, that it silently returns a random TRUE/FALSE.

It's not random, it depends on the value of Sys.time(), which also 
includes seconds .
I agree that a warning or error might be sensible. So I think you are 
about to write a note to the maintainer of package "chron" including 
patches for is.weekend() and friends?

Uwe Ligges





> -Original Message-
> From: Uwe Ligges [mailto:[EMAIL PROTECTED]
> Sent: 26 May 2004 11:55
> To: Matthew Dowle
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: [R] is.weekend() odd behaviour
> 
> 
> Matthew Dowle wrote:
> 
> 
>>It seems is.weekend() is unsure ?
> 
> 
> It is completely sure, if an object is given is.weekend() knows about 
> as in:
> 
> table(is.weekend(sapply(1:100,
> function(i){Sys.sleep(0.05);as.chron(Sys.time())})))
> 
> (note the as.chron() call!)
> 
> Uwe Ligges
> 
> 
> 
> 
>># Start R 1.9.0 with --vanilla on windows xp
>># load package chron
>>
>>
>>
>>>table(is.weekend(sapply(1:100,
>>>function(i){Sys.sleep(0.05);Sys.time()})))
>>
>>FALSE  TRUE 
>>   6832 
>>
>>
>>>date()
>>
>>[1] "Wed May 26 11:18:56 2004"
>>
>>
>>
>>>version _  
>>
>>platform i386-pc-mingw32
>>arch i386   
>>os   mingw32
>>system   i386, mingw32  
>>status  
>>major1  
>>minor9.0
>>year 2004   
>>month04 
>>day  12 
>>language R  
>>
>>
>>
>>  [[alternative HTML version deleted]]
>>
>>__
>>[EMAIL PROTECTED] mailing list
>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide! 
>>http://www.R-project.org/posting-guide.html

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


Re: [R] I/O fortran instructions and dyn.load

2004-05-26 Thread Prof Brian Ripley
Try

R CMD SHLIB test.f

If SHLIB know it has to deal with Fortran code, it adds the appropriate 
libraries.

On Wed, 26 May 2004, Gilles GUILLOT wrote:

> I have the following Fortran code
> 
> subroutine sub(path)
> character*100 path
> open(10,file=path)
> end
> 
> saved as test.f
> 
> which I compile with
> g77 -c test.f
> 
> then I make the shared libary in R (Version 1.9.0) with
> system("R CMD SHLIB test.o")
> 
> so far, everything OK.
> 
> But
> dyn.load("test.so")
> returns the following error message:
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
> unable to load shared library "test.so":
>   test.so: undefined symbol: f_open
> 
> I get similar error messages with r/w Fortran instructions like 
> write(*,*) , read(*,*)
> 
> I used to use such programs on my computer under mandrake linux 10.
> The problem reported occurs on a new server operating under 
> another linux distrib (debian).
> 
> Thanks in advance for any help, 
> Gilles 
> 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] cor and missing values. Bug?

2004-05-26 Thread Robert W. Baer, Ph.D.
> Not to put too fine a point on it, but did you consider checking the
> NEWS file for the most recent version (1.9.0,
> http://cran.r-project.org/src/base/NEWS)?
>
> o   The cor() function did not remove missing values in the
> non-Pearson case.


There is still something a little strange in version 1.9.0. What  is the
source of the discrpancy between cor() and cor.test()?

> vec1 <- 1:10
> vec2 <- 2*vec1
> vec1[c(1, 5)] <- NA
> cor(vec1[-c(1,5)], vec2[-c(1,5)], use="pair", method="spearman")
[1] 1
> cor(vec1, vec2, use="complete", method="spearman")
[1] 0.99544
> cor.test(vec1, vec2, use="complete", method="spearman")

Spearman's rank correlation rho

data:  vec1 and vec2
S = 0, p-value = 4.96e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
  1

Rob Baer

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


[R] power analysis

2004-05-26 Thread Ruben Real
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Received-SPF: none (hypatia: domain of [EMAIL PROTECTED] does not designate permitted 
sender hosts)
X-Virus-Scanned: by amavisd-new
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on hypatia.math.ethz.ch
X-Spam-Level: *
X-Spam-Status: No, hits=1.6 required=5.0 tests=BAYES_60 autolearn=no version=2.63

Hello,

do you know if there is a R-package on power analysis for planned contrasts (and the 
like)?

thanks

Ruben
___
Moechten Sie Ihre SMS noch ausdrucksstaerker und emotionaler gestalten?

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


[R] I/O fortran instructions and dyn.load

2004-05-26 Thread Gilles GUILLOT
I have the following Fortran code

subroutine sub(path)
character*100 path
open(10,file=path)
end

saved as test.f

which I compile with
g77 -c test.f

then I make the shared libary in R (Version 1.9.0) with
system("R CMD SHLIB test.o")

so far, everything OK.

But
dyn.load("test.so")
returns the following error message:
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "test.so":
  test.so: undefined symbol: f_open

I get similar error messages with r/w Fortran instructions like 
write(*,*) , read(*,*)

I used to use such programs on my computer under mandrake linux 10.
The problem reported occurs on a new server operating under 
another linux distrib (debian).

Thanks in advance for any help, 
Gilles 
-- 
_
Gilles GUILLOT
INRA -Département Mathématiques et Informatique Appliquées

Unité de Mixte de Recherche
INRA - INAPG - ENGREF
Institut National Agronomique de Paris-Grignon
16 rue Claude Bernard
75231 Paris cedex 5

Aile Claude Bernard
Niveau cours +3 étages

tel : +33 (0)1 44 08 72 71
fax : +33 (0)1 44 08 16 66
http://www.inapg.fr/ens_rech/mathinfo/personnel/guillot/welcome.html

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


Re: [R] Turning pass/fail results into a proportion

2004-05-26 Thread Gabor Grothendieck
Matthew Walker  massey.ac.nz> writes:
 
: I have a data frame that contains a number of pass/fails for certain 
: variable sizes.  From that, I would like to form another data frame that 
: contains the proportions of pass/fails per variable.
: 
: So, for example:
: df <- data.frame( Var=c(3,3,3,4,4), 
: Result=c("pass","fail","fail","pass","pass"), SampleSize=c(3,3,3,2,2))
: 
: And I'd like to produce the equivalent of:
: data.frame( Var=c(3,4), ProportionPass=c(0.33, 1) )


Try using aggregate like this:

 aggregate( data.frame(ProportionPass = as.numeric(df$Result)-1), 
  list(Var = df$Var), mean)

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


Re: [R] thanks again

2004-05-26 Thread partha_bagchi
Uh-oh .. the Dalgaard's Box has been reopened 





Peter Dalgaard <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
05/25/2004 04:17 PM

 
To: "Philippe Grosjean" <[EMAIL PROTECTED]>
cc: Chad Shaw <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject:Re: [R] thanks again


"Philippe Grosjean" <[EMAIL PROTECTED]> writes:

> Chad,
>
> Do not forget that, due to the contaminant character of the GPL license, 
if
> you put a R logo on a t-shirt, you have to share and distribute it 
freely to
> the community,... and do not forget to distribute the source with it ;-)

And don't forget to implement the impossible-to-take-it-off feature,
so that we can use it for capture-recapture experiments to estimate
the size of the R user base.

--
O__   Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

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


[[alternative HTML version deleted]]

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


Re: [R] multi read.table function and read.table function not accepting col.names

2004-05-26 Thread Laura Quinn
Thank you for your earlier help, I have a couple of related questions.

With the lapply function, is it still possible to assign column names to
each column of every data frame, again I have tried and it doesn't seem to
like it..

and is it also possible to assign names to each data frame when I do
lapply rather than each one being a subset of a larger frame (I don't seem
to be able to attach these as individual objects).

Thanks again,
Laura

On Wed, 26 May 2004, Wolski wrote:

> Hi!
>
> 1.
> assuning that names is the vector with the names.
> try col.names=names instead of "names"
>
> 2.
> Several ways
> a)
> use
> lapply(listwithpathstofiles,read.tabel,remaining, options) //u will get it stored in 
> the list.
> b)
> or use for loop and append to list. mylist<-list()
> c)
> or look
> ?assing
> to generate several hundred objects in the envrovment.
>
> Sincerely Eryk
>
> *** REPLY SEPARATOR  ***
>
> On 5/26/2004 at 12:51 PM Laura Quinn wrote:
>
> >I am using R-1.8.0 on Debian.
> >
> >I'm trying to read in a large table (1441*16) which currently has no
> >header line. I have set up a list of column names which is 16 names long.
> >
> >when i try the following:
> >
> >myfiledate.01<-read.table("filenamedate.01",row.names=NULL,col.names="names",na.strings="-999.00")
> >
> >I am returned with an error saying there are more columsh than column
> >names. I am sure I have done this successfully in the past so can't
> >understand the problem. I have done the read.table function without
> >specifying col.names and it works fine and i end up with a 1441*16
> >data.frame.
> >
> >Also as I have several hundred of these tables to read into R, all having
> >the same dimension and all having the same column names, is it possible to
> >automate R so they will all be read in at once - each table represents a
> >different days worth of data.
> >
> >Thanks
> >
> >Laura
> >
> >__
> >[EMAIL PROTECTED] mailing list
> >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
> Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic
> Ihnestrasse 63-73 14195 Berlin   'v'
> tel: 0049-30-83875219   /   \
> mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski
>
>

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


Re: [R] Venn diagrams

2004-05-26 Thread Chuck Cleland
http://www.stats.uwo.ca/faculty/murdoch/software/
  Also, a google search [Venn r-project] returns a number of 
promising hits.

hope this helps,
Chuck Cleland
Wayne Jones wrote:
Does anyone know how to plot venn diagrams in R?
Ive searched the mail archive lists but to no avail. 
--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Venn diagrams

2004-05-26 Thread Wayne Jones

Hello there, 

Does anyone know how to plot venn diagrams in R?
Ive searched the mail archive lists but to no avail. 

Regards, 

Wayne Jones


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

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


Re: [R] is.weekend() odd behaviour

2004-05-26 Thread Gabor Grothendieck
Uwe Ligges  statistik.uni-dortmund.de> writes:
> Matthew Dowle wrote:
> > 
> >>table(is.weekend(sapply(1:100, function(i){Sys.sleep(0.05);Sys.time()})))
> > 
> > FALSE  TRUE 
> >6832 
> 
> > It seems is.weekend() is unsure ?
> 
> It is completely sure, if an object is given is.weekend() knows about as in:
> 
> table(is.weekend(sapply(1:100, 
> function(i){Sys.sleep(0.05);as.chron(Sys.time())})))
> 
> (note the as.chron() call!)

Note that converting a POSIXct to chron using as.chron uses
the GMT datetime, not the datetime in your timezone.  So if its the
weekend in the GMT timezone but not in yours it will indicate that
its the weekend.  Similarly if its the weekend in your timezone
but not in the GMT timezone then it will indicate its not in the
weekend.

If you want the result relative to your timezone convert
to chron like this:

   now <- Sys.time()
   chron(unclass(as.Date(format(now

or even easier:

chron(unclass(Sys.Date()))

Now apply is.weekend to that.

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


[R] lattice/postscript/pdf: size of striptext and xlab and other strings

2004-05-26 Thread Wolfram Fischer
PROBLEM_

When comparing the output from:
data(barley); dotplot(variety ~ yield | year * site, data = barley)

run with R 1.8.1 and with R 1.9.0, one gets different
sizes of striptexts and xlabs.

OBSERVATIONS

- The result is the same when the output is redirected
  by postscript() or by pdf().

- trellis.par.get() shows the same cex-values in both R versions.

QUESTION

How can I get the same text sizes as in R 1.8.1 for lattice output
using R 1.9.0? (And hopefully reuse older scripts without changing
their code?)

Thanks Wolfram

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


Re: [R] is.weekend() odd behaviour

2004-05-26 Thread Uwe Ligges
Matthew Dowle wrote:
Thanks. When is.weekend() is given an object it doesn't know about, could a
warning or error be added? At the moment, I think you're agreeing, that it
silently returns a random TRUE/FALSE.
It's not random, it depends on the value of Sys.time(), which also 
includes seconds .
I agree that a warning or error might be sensible. So I think you are 
about to write a note to the maintainer of package "chron" including 
patches for is.weekend() and friends?

Uwe Ligges


-Original Message-
From: Uwe Ligges [mailto:[EMAIL PROTECTED] 
Sent: 26 May 2004 11:55
To: Matthew Dowle
Cc: '[EMAIL PROTECTED]'
Subject: Re: [R] is.weekend() odd behaviour

Matthew Dowle wrote:

It seems is.weekend() is unsure ?

It is completely sure, if an object is given is.weekend() knows about as in:
table(is.weekend(sapply(1:100, 
function(i){Sys.sleep(0.05);as.chron(Sys.time())})))

(note the as.chron() call!)
Uwe Ligges


# Start R 1.9.0 with --vanilla on windows xp
# load package chron

table(is.weekend(sapply(1:100, 
function(i){Sys.sleep(0.05);Sys.time()})))
FALSE  TRUE 
  6832 


date()
[1] "Wed May 26 11:18:56 2004"

version _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor9.0
year 2004   
month04 
day  12 
language R  


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


Re: [R] multi read.table function and read.table function not accepting col.names

2004-05-26 Thread Wolski
Hi!

1.
assuning that names is the vector with the names.
try col.names=names instead of "names"

2.
Several ways
a)
use 
lapply(listwithpathstofiles,read.tabel,remaining, options) //u will get it stored in 
the list.
b)
or use for loop and append to list. mylist<-list()
c)
or look
?assing
to generate several hundred objects in the envrovment.

Sincerely Eryk

*** REPLY SEPARATOR  ***

On 5/26/2004 at 12:51 PM Laura Quinn wrote:

>I am using R-1.8.0 on Debian.
>
>I'm trying to read in a large table (1441*16) which currently has no
>header line. I have set up a list of column names which is 16 names long.
>
>when i try the following:
>
>myfiledate.01<-read.table("filenamedate.01",row.names=NULL,col.names="names",na.strings="-999.00")
>
>I am returned with an error saying there are more columsh than column
>names. I am sure I have done this successfully in the past so can't
>understand the problem. I have done the read.table function without
>specifying col.names and it works fine and i end up with a 1441*16
>data.frame.
>
>Also as I have several hundred of these tables to read into R, all having
>the same dimension and all having the same column names, is it possible to
>automate R so they will all be read in at once - each table represents a
>different days worth of data.
>
>Thanks
>
>Laura
>
>__
>[EMAIL PROTECTED] mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] Page's trend test?

2004-05-26 Thread Vaclav Petricek

Hello

Is there an R implementation of the "Page's trend test" as described
in http://en.wikipedia.org/wiki/Page%27s_trend_test or something
equivalent?

Thanks for your help,

Vaclav

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


RE: [R] is.weekend() odd behaviour

2004-05-26 Thread Matthew Dowle

Thanks. When is.weekend() is given an object it doesn't know about, could a
warning or error be added? At the moment, I think you're agreeing, that it
silently returns a random TRUE/FALSE.

-Original Message-
From: Uwe Ligges [mailto:[EMAIL PROTECTED] 
Sent: 26 May 2004 11:55
To: Matthew Dowle
Cc: '[EMAIL PROTECTED]'
Subject: Re: [R] is.weekend() odd behaviour


Matthew Dowle wrote:

> It seems is.weekend() is unsure ?

It is completely sure, if an object is given is.weekend() knows about as in:

table(is.weekend(sapply(1:100, 
function(i){Sys.sleep(0.05);as.chron(Sys.time())})))

(note the as.chron() call!)

Uwe Ligges



> # Start R 1.9.0 with --vanilla on windows xp
> # load package chron
> 
> 
>>table(is.weekend(sapply(1:100, 
>>function(i){Sys.sleep(0.05);Sys.time()})))
> 
> FALSE  TRUE 
>6832 
> 
>>date()
> 
> [1] "Wed May 26 11:18:56 2004"
> 
> 
>>version _  
> 
> platform i386-pc-mingw32
> arch i386   
> os   mingw32
> system   i386, mingw32  
> status  
> major1  
> minor9.0
> year 2004   
> month04 
> day  12 
> language R  
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> [EMAIL PROTECTED] mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

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


[R] multi read.table function and read.table function not accepting col.names

2004-05-26 Thread Laura Quinn
I am using R-1.8.0 on Debian.

I'm trying to read in a large table (1441*16) which currently has no
header line. I have set up a list of column names which is 16 names long.

when i try the following:

myfiledate.01<-read.table("filenamedate.01",row.names=NULL,col.names="names",na.strings="-999.00")

I am returned with an error saying there are more columsh than column
names. I am sure I have done this successfully in the past so can't
understand the problem. I have done the read.table function without
specifying col.names and it works fine and i end up with a 1441*16
data.frame.

Also as I have several hundred of these tables to read into R, all having
the same dimension and all having the same column names, is it possible to
automate R so they will all be read in at once - each table represents a
different days worth of data.

Thanks

Laura

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


Re: [R] is.weekend() odd behaviour

2004-05-26 Thread Uwe Ligges
Matthew Dowle wrote:
It seems is.weekend() is unsure ?
It is completely sure, if an object is given is.weekend() knows about as in:
table(is.weekend(sapply(1:100, 
function(i){Sys.sleep(0.05);as.chron(Sys.time())})))

(note the as.chron() call!)
Uwe Ligges

# Start R 1.9.0 with --vanilla on windows xp
# load package chron

table(is.weekend(sapply(1:100, function(i){Sys.sleep(0.05);Sys.time()})))
FALSE  TRUE 
   6832 

date()
[1] "Wed May 26 11:18:56 2004"

version _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor9.0
year 2004   
month04 
day  12 
language R  


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


AW: [R] Question

2004-05-26 Thread TEMPL Matthias
A small comment:
The code of Agnes is written in Fortran. Following book give more details:

 Kaufman, L. and Rousseeuw, P.J. (1990). _Finding Groups in Data:
 An Introduction to Cluster Analysis_. Wiley, New York.

The 'hclust' function is based an Algorithm contributed to STATLIB
by F. Murtagh and the code is written in C.

Probably the differences between agnes and hclust causes from the different code and 
the different implementation.

Matthias

> -Ursprüngliche Nachricht-
> Von: n.bouget [mailto:[EMAIL PROTECTED] 
> Gesendet: Dienstag, 25. Mai 2004 09:39
> An: R-help
> Betreff: [R] Question
> 
> 
> [R]:Agnes vs Hclust
> 
> Hi,
> I want to know if there is a difference between the two 
> hierarchical methods Agnes and hclust when there are used 
> with the same method and the same metric on the same data! I 
> ask this question because I've got a difference, the clusters 
> are not the same even if there are some similarities... Is 
> anybody know why i have this difference? Thanks Nicolas BOUGET 
> 
> Accédez au courrier électronique de La Poste : www.laposte.net ; 
> 3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)
> 
> __
> [EMAIL PROTECTED] mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> PLEASE 
> do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

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


[R] Common principle components

2004-05-26 Thread J. Pedro Granadeiro
Dear all,

Can anyone point me to a package that can perform Common principle components?

Thank you.

José P. Granadeiro

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


[R] Once again in search of memory

2004-05-26 Thread Eric Lecoutre
Hello any R user,
Working on R 1.8.1 or R 1.9 on Windows, 256 Mb RAM.
I am trying to debug/correct/speedup the execution of one of our student's 
program. Basically, we perform simulations.
R is launched with high memory-limits.
One execution of the program requires nearly 200 Mbs and is OK the first 
time.  Then, launching it again does strange things: seen from Windows 
manager, the RAM used by R never exceed those 200 Mbs (often near 130Mb). 
seen from R:

> gc(TRUE)
Garbage collection 280 = 85+59+136 (level 2) ...
396784 cons cells free (40%)
145.7 Mbytes of heap free (53%)
   used  (Mb) gc trigger  (Mb)
Ncells   587240  15.7 984024  26.3
Vcells 16866491 128.7   35969653 274.5
And then each new call to the function
foo()
will always imply a grow of this memory use (Vcells)
How comes Windows Manager states R only uses 71 Mb RAM as seen in the 
attached screenshot?
Is this a known issue? Is there any tip to "really" release memory for all 
those objects we dont use anymore?

I tried also memory.profile() which states there are more list-type 
objects. We wanipulated matrices. Could they come from calls to 'apply'?

Thansk for insights and advices on how to handle memory. I am turning and 
turning round on help pages.

Eric


Eric Lecoutre
UCL /  Institut de Statistique
Voie du Roman Pays, 20
1348 Louvain-la-Neuve
Belgium
tel: (+32)(0)10473050
[EMAIL PROTECTED]
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
If the statistics are boring, then you've got the wrong numbers. -Edward 
Tufte

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


[R] is.weekend() odd behaviour

2004-05-26 Thread Matthew Dowle

It seems is.weekend() is unsure ?

# Start R 1.9.0 with --vanilla on windows xp
# load package chron

> table(is.weekend(sapply(1:100, function(i){Sys.sleep(0.05);Sys.time()})))
FALSE  TRUE 
   6832 
> date()
[1] "Wed May 26 11:18:56 2004"

> version _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor9.0
year 2004   
month04 
day  12 
language R  
> 


[[alternative HTML version deleted]]

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


[R] Using R in C++

2004-05-26 Thread Jörgen Wallerman
Hello,

Is it possible to use R functions (in my case: ks.test()) from C++
-applications? That is, I get the impression R can execute C/C++ code, but
is there any possibility to do the opposite? Where can I find help?


---
Ph. D. Jörgen Wallerman
Swedish University of Agricultural Sciences
Remote Sensing Laboratory
S901 83 UMEÅ
 
###

This message has been scanned by F-Secure 
Anti-Virus for Microsoft Exchange.

###

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


RE: [R] Metafiiles into Word R 1.9.0

2004-05-26 Thread Jesus Frias
Hi again,

Thanks a lot to Jason Turner for the hint to the FAQ-windows. savePlot()
seems to be in trouble with lattice objects as much as any other device,
which I did not know. I can generate now the metafiles:

> library(lattice)
> example(xyplot)
> win.metafile()
> print(dotplot(variety ~ yield | year * site, data = barley))
> dev.off()
windows
  2

This gives an alternative solution to the problem I had with the drop-down
menu on the windows() device "Copy as metafile".

best regards,

Jesus

--
Jesús María Frías Celayeta
School of Food Sci. and Env. Health.
Faculty of Tourism and Food
Dublin Institute of Technology
Cathal Brugha St., Dublin 1. Ireland
t +353 1 4024459 f +353 1 4024495
w www.dit.ie/DIT/tourismfood/science/staff/frias.html
--

> -Original Message-
> From: Jason Turner [mailto:[EMAIL PROTECTED]
> Sent: 26 May 2004 22:11
> To: Jesus Frias
> Subject: RE: [R] Metafiiles into Word R 1.9.0
>
>
> > There is one more thing that might shed some light (or not)
> on it: I have
> > just found that I can actually copy-paste a plot in the device
> coming from
> > a
> > plot call but not from a lattice object call. There it is my
> toy example:
> >
> >> example(plot)
> >> savePlot("exampleplot.wmf",type="wmf")
> >> library(lattice)
> >> example(xyplot)
> >> savePlot("examplexyplot.wmf",type="wmf")
> >
> > I have no problem importing exampleplot.wmf into Word, but
> I can't do the
> > same with examplexyplot.wmf. The file seems empty, it has only
> 696 bytes.
> >
>
> Yes, it does shed light.  This is a FAQ.
>
> http://cran.au.r-project.org/doc/FAQ/R-FAQ.html#Why%20do%20lattice
%2ftrellis%20graphics%20not%20work%3f

Cheers

Jason

--
This message has been scanned for content and
viruses by the DIT Information Services MailScanner
Service, and is believed to be clean.
http://www.dit.ie


-- 
This message has been scanned for content and 
viruses by the DIT Information Services MailScanner 
Service, and is believed to be clean.
http://www.dit.ie

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


Re: [R] pmvt problem in multcomp

2004-05-26 Thread Chihiro Kuroki
Dear Mr.Torsten:

At Sun, 23 May 2004 11:40:51 +0200 (CEST),
Torsten Hothorn wrote:
> 
> Yes, `pmvt' returns NaN without indicating this error. We need to check.
> Thanks for the report (and *please* cc emails reporting problems with
> packages to the maintainer!),

I am dreadfully sorry I did not cc mail to you. 

> If the question relates to a package that is downloaded from
> CRAN try contacting the package maintainers first.

I overlooked the above-mentioned sentence.


BTW, I have another strange example of simtest. I want to know
why simtest returns these p-values.

-- example 1 ---
rm(list = ls())
require(multcomp)
y1 <- c(seq(3,7),seq(3,7))
y2 <- c(rep(c(6,7,8,9),7))
sort(runif(28),index=T) -> a
y3 <- numeric(0)
for(i in 1:28){
  y3[i] <- y2[a$ix[i]]
}
y4 <- c(y1,y3,14,18)

f2 <- factor(c(rep(1,10),rep(2,8),rep(3,8),rep(4,8),rep(5,6)))
dat2 <- cbind(as.data.frame(y4),f2)
summary(simtest(y4 ~ f2, data=dat2, type="Dunnett"))

> dat2
   y4 f2
1   3  1
2   4  1
3   5  1
4   6  1
5   7  1
6   3  1
7   4  1
8   5  1
9   6  1
10  7  1
11  6  2
12  7  2
13  6  2
14  9  2
15  7  2
16  8  2
17  6  2
18  8  2
19  9  3
20  8  3
21  7  3
22  9  3
23  6  3
24  8  3
25  9  3
26  7  3
27  7  4
28  9  4
29  6  4
30  6  4
31  9  4
32  8  4
33  7  4
34  9  4
35  6  5
36  8  5
37  8  5
38  7  5
39 14  5
40 18  5
> summary(simtest(y4 ~ f2, data=dat2, type="Dunnett"))

 Simultaneous tests: Dunnett contrasts 

Call: 
simtest.formula(formula = y4 ~ f2, data = dat2, type = "Dunnett")

 Dunnett contrasts for factor f2

Contrast matrix:
  f21 f22 f23 f24 f25
f22-f21 0  -1   1   0   0   0
f23-f21 0  -1   0   1   0   0
f24-f21 0  -1   0   0   1   0
f25-f21 0  -1   0   0   0   1


Absolute Error Tolerance:  0.001 

Coefficients:
Estimate t value Std.Err. p raw p Bonf p adj
f25-f215.167  -4.6441.022 0.000  0.000 0.000
f23-f212.875  -2.8131.022 0.008  0.024 0.022
f24-f212.625  -2.5691.022 0.015  0.029 0.028
f22-f212.125  -2.0791.113 0.045  0.045 0.045
-

I got the following inequality from the appended chart of a
book.

2.558 < d(5, 35, 0.4263464, 0.05) < 2.598

Are these "p adj" values right?
Or do I misunderstand some? 
-- 
kuroki
GnuPG fingerprint = 90FD FE79 905F 26F9 29C4  096F 8AA2 2C42 5130 1469

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