[R] Rd.sty not found -

2003-12-23 Thread Arnab mukherji
Hi 

 I  am still trying to wrap up a package using Rcmd (in windows 2000 professional with 
R 1.8.1). I have made some progress - and now at least Rcmd check works - it still 
giving me an error message when it creates latex help files though. Thus I get:

c:\rpack> Rcmd check test
* checking for working latex ... OK
* using log directory 'C:/rpacks/test.Rcheck'
* checking for file 'test/DESCRIPTION' ... OK
* checking if this is a source package ... OK

-- Making package test 
  adding build stamp to DESCRIPTION
  installing R files
  installing man source files
  installing indices
  installing help
 >>> Building/Updating help pages for package 'test'
 Formats: text html latex example 
  test  texthtmllatex   example
 >>> Building/Updating help pages for package 'test'
 Formats: chm 
make[2]: `test.chm' is up to date.
  adding MD5 sums

installing R.css in C:/rpacks/test.Rcheck

...
* checking Rd \usage sections ... OK
* checking examples ... OK
* creating test-manual.tex ... OK
* checking test-manual.tex ... ERROR
LaTeX errors when creating DVI version.
This typically indicates Rd problems.

Everything is handled smoothly except for creating the test-manual. I looked at the 
error log and it told me that this was due to :

! LaTeX Error: File `Rd.sty' not found.

Now I do have Rd.sty in my $HOME\share directory - so i tried to check the 
configurations of MikTeX. I even tried adding the share directory to PATH to see if 
that helped; it didn't.  I am not sure what else I can do to get MikTeX to recognize 
Rd.sty in the R directory.

I would be grateful for any suggestions.

thank you.


Arnab

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] revision of posting guide

2003-12-23 Thread Tony Plate
I've placed a revision of the posting guide at 
http://pws.prserv.net/tap/posting-guide-draft2.html. (Posted there to make the HTML 
formatting easy to read.)  I've tried to incorporate the suggestions people posted and 
mailed to me.  Quite a few were of the form "too long, but you should add this..." :-)

Brian Ripley, Jason Turner, Peter Dalgard, Patrick Burns, Frank Harrell, Gabor 
Grothendieck, Spencer Graves, and Patrick Connolly all made valuable suggestions that 
I've tried to incorporate (apologies if I omitted anyone!)  Jonathan Baron gave some 
much appreciated suggestions on how to make it more concise, which I have probably not 
heeded as much as I should have.  I did try to put the more important material at the 
top of the document.

Suggestions and comments on the revised version are welcome -- deletions, additions, 
corrections, changes all considered.  In the absence of such, I'm pretty much ready to 
hand this over to the R-project.org site maintainers for posting (let me know if there 
are any formatting changes needed to make it easy to use there.)  

Based on the widely held fear that posters won't read a long document before posting, 
this guide should probably go on its own page at r-project.org (which might help 
prevent it getting lost as part of a larger document).  One way to make this 
information readily visible and accessible would be to have the mail software place an 
additional line at the bottom of every post, something like "Read the  
before posting here".  Several correspondents liked this idea.  Is this desirable 
and/or doable?

thanks for all the assistance,

Tony Plate

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Rd.sty not found -

2003-12-23 Thread Prof Brian Ripley
On Tue, 23 Dec 2003, Arnab mukherji wrote:

> Hi 
> 
>  I  am still trying to wrap up a package using Rcmd (in windows 2000 professional 
> with R 1.8.1). I have made some progress - and now at least Rcmd check works - it 
> still giving me an error message when it creates latex help files though. Thus I get:
> 
> c:\rpack> Rcmd check test
> * checking for working latex ... OK
> * using log directory 'C:/rpacks/test.Rcheck'
> * checking for file 'test/DESCRIPTION' ... OK
> * checking if this is a source package ... OK
> 
> -- Making package test 
>   adding build stamp to DESCRIPTION
>   installing R files
>   installing man source files
>   installing indices
>   installing help
>  >>> Building/Updating help pages for package 'test'
>  Formats: text html latex example 
>   test  texthtmllatex   example
>  >>> Building/Updating help pages for package 'test'
>  Formats: chm 
> make[2]: `test.chm' is up to date.
>   adding MD5 sums
> 
> installing R.css in C:/rpacks/test.Rcheck
> 
> ...
> * checking Rd \usage sections ... OK
> * checking examples ... OK
> * creating test-manual.tex ... OK
> * checking test-manual.tex ... ERROR
> LaTeX errors when creating DVI version.
> This typically indicates Rd problems.
> 
> Everything is handled smoothly except for creating the test-manual. I
> looked at the error log and it told me that this was due to :
> 
> ! LaTeX Error: File `Rd.sty' not found.
> 
> Now I do have Rd.sty in my $HOME\share directory - so i tried to check

But it's the one in R_HOME/share/texmf you want.

> the configurations of MikTeX. I even tried adding the share directory to
> PATH to see if that helped; it didn't.  I am not sure what else I can do
> to get MikTeX to recognize Rd.sty in the R directory.

It should be looking in TEXINPUTS, as is the point of the following in the 
check script

$ENV{'TEXINPUTS'} =
  env_path(&file_path($R::Vars::R_HOME, "share", "texmf"),
   $ENV{'TEXINPUTS'});

So you could try adding to TEXINPUTS yourself, and you should certainly
check the current setting of the environment variable (unset is fine).

Perhaps someone who uses MikTeX can help or assist -- the recommendation 
is fptex, which is also what is on TeXLive.

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


[R] unary operations

2003-12-23 Thread Fredrik Lundgren
Hello,

I had expected that the following should work

mat <- matrix(c(5, 7, 6, 7, 8, 10, 17, 28, 36, 41, 46, 140), nrow = 2, byrow = T)
mat

apply(mat, 2, function(e1,e2) e1*e2)
apply(mat, 2, function(e1,e2) e1+e2)
apply(mat, 2, function(e1,e2) e1-e2)
apply(mat, 2, function(e1,e2) e1/e2)

but I get 

Error in FUN(newX[, i], ...) : Argument "e2" is missing, with no default

What do I do wrong?

Sincerely Fredrik Lundgren

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] draft of posting guide

2003-12-23 Thread Pascal . Niklaus
Having followed the discussion about this posting guide, I'd like to add a few 
comments. While I think that the *content* is fully appropriate, I am not sure 
whether the *form* is the appropriate, for the following reason: 
 
- The folks posting "questions" like "I've installed R two minutes ago, what 
do I do next?" obviously do not even try to read *any* documentation, and they 
obviously will also ignore the posting guide. So the posting guide will not 
fix that problem. 
 
- People tending not to dare to ask questions because they are intimidated by 
some aspects of the list (and after the r-beginner discussion we now know that 
some feel like that) would be helped by a more positive wording of the same 
issues in posting guide. The motto should be "help to write better questions" 
rather than "stop asking poor questions". The content is all there in the 
draft, it is more about changing individual words. Re-posting it monthly on 
the list is a good idea. 
 
- It would probably also help to add a search form for the mailing list 
archives to the "Documentation -> Help Pages" section of R-help. I know it is 
on r-project.org, but you need *less* mouse clicks to subscribe than to get to 
the search form! Also, it is at the very bottom of the respective web page. 
 
- Wasn't there an article on how to get help in a recent issue of R-news? 
Maybe it could be placed at a prominent placed in the "Help Pages" as well. 
 
Pascal 
 
 
 

-
This mail sent through IMP: http://horde.org/imp/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] unary operations

2003-12-23 Thread Barry Rowlingson
Fredrik Lundgren wrote:

apply(mat, 2, function(e1,e2) e1*e2)

but I get 

Error in FUN(newX[, i], ...) : Argument "e2" is missing, with no default

What do I do wrong?
 Misunderstand what 'apply' does perhaps?

 It applies your function to columns (the '2') of the matrix, and so 
the function should only expect one argument, for example:

> apply(mat, 2, function(e1){print(e1)})
[1]  5 17
[1]  7 28
[1]  6 36
[1]  7 41
[1]  8 46
[1]  10 140
 - in this toy example,my function is called with e1 set to columns of 
the matrix.

 So what were you trying to do with apply(mat, 2, function(e1,e2) e1*e2)?

Baz

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


AW: [R] unary operations

2003-12-23 Thread "Unternährer Thomas, uth"


Hi, 

This should do what you are looking for:

x <- matrix(1:10, byrow = TRUE, nrow = 2)
mapply(function(x1, x2) x1+x2, x[1, ], x[2, ])  

But have also a look at colSums and colMeans


HTH

Thomas


-Ursprüngliche Nachricht-
Von: Fredrik Lundgren [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 23. Dezember 2003 10:00
An: R-help
Betreff: [R] unary operations


Hello,

I had expected that the following should work

mat <- matrix(c(5, 7, 6, 7, 8, 10, 17, 28, 36, 41, 46, 140), nrow = 2, byrow = T) mat

apply(mat, 2, function(e1,e2) e1*e2)
apply(mat, 2, function(e1,e2) e1+e2)
apply(mat, 2, function(e1,e2) e1-e2)
apply(mat, 2, function(e1,e2) e1/e2)

but I get 

Error in FUN(newX[, i], ...) : Argument "e2" is missing, with no default

What do I do wrong?

Sincerely Fredrik Lundgren

__
[EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] What's "latex" for?

2003-12-23 Thread [EMAIL PROTECTED]
As an R absolute beginner when I update my R 1.8.1, after installing
the packages I see the various updated commands orderly running in a
table on the screen where, among other things, "latex" and "example"
are indicated.

1) Being an old user of latex what **exactly** the "latex" label on a
command mean and how, in what context, can it be used?

2) How can I see the same table running on the screen /or at least the
same info while not updating?

Ciao from Rome
Vittorio

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] error propagation - hope it is correct subject

2003-12-23 Thread Petr Pikal
Hallo Thomas

Thank you for your answer, even I am not sure how to do it in R (or maybe at 
all). My mathematics background is only faint so I drop the first possibility which 
is for me rather cryptic. 

Does your second suggestion mean:

1:  compute random variable  y <- f(rnorm(n,mymeanx1,mysdx1), 
rnorm(n,mymeanx2, ...), ...)

according to my function f  (based on assumption x variables values can be 
considered normally distributed and and independent)

2:  sd(y)

can be considered as variation of y?
Or is it necessary to do something like

vysled<-NULL
for (i in 1:300) vysled[i]<-sd(sample(y,100))
mean(vysled)

to get bootstraped estimation of sd(y)

My actual data have some missing values and some outliers which I can either 
remove or to use some robust statistics for mean and variation estimates.

Thank you and have a nice Christmas

Petr

On 22 Dec 2003 at 8:56, Thomas W Blackwell wrote:

> Petr  -
> 
> Very briefly, I think of three ways to approximate the standard
> deviation of  y = f(x1,x2,x3).
> 
>   (1) linearise f() and use the covariance matrix of [x1,x2,x3].
>   (2) simulate draws from the joint distribution of [x1,x2,x3],
>  then compute the sample std dev of resulting f()s.
>   (3) go back to the original data set from which [x1,x2,x3] were
>  estimated as parameters, re-sample rows with replacement,
>  estimate [x1,x2,x3] and compute f, then take sample std dev.
> 
> Other names for these three would be (1) the "delta method" or
> Taylor series expansion, (2) parametric bootstrap, (3) bootstrap.
> 
> Different choices are appropriate in different situations.
> 
> If the std devs of x1,x2,x3 are small relative to the curvature
> (2nd derivative) in f(), then use (1) and compute by matrix algebra
> 
> Var(f(x1,x2,x3))  approx  t(grad f) %*% Cov(x1,x2,x3) %*% grad f.
> 
> If the curvature in f() is an issue, use (2) with draws of x1,x2,x3
> from some parametric distribution (eg, rnorm()) with each component
> properly conditioned on the ones already drawn.
> 
> Only if there were no set of intermediate parameters [x1,x2,x3]
> would I use (3) to get the precision of f directly.  I'm sure
> Brad Efron would say something different.  (3) is the only one
> that is canned in R, simply because the other two are practically
> one-liners.
> 
> -  tom blackwell  -  u michigan medical school  -  ann arbor  -
> 
> On Mon, 22 Dec 2003, Petr Pikal wrote:
> 
> > Dear all
> >
> > Please, can you advice me how to compute an error, standard
> > deviation or another measure of variability of computed value.
> >
> > I would like to do something like:
> >
> > var(y) = some.function(var(x1),var(x2),var(x3))
> >
> > for level F1 (2,3,...)
> >
> > Let say I have some variables - x1, x2, x3 (two computed for levels
> > of factor F and one which is same for all levels) and I want to
> > compute
> >
> > y = f(x1,x2,x3)
> >
> > for some levels of factor F
> >
> > I can compute variation of variables for levels of F, I know a
> > variation of one variable but I am not sure how to transfer it to
> > variation of y within respective levels.
> >
> > I found some methods which I can use but I wonder if  there is some
> > method implemented in R (Manly B.F. Biom.J.28,949,(1986), some local
> > statistical books available to me).
> >
> > I have a feeling I could use bootstrap method for this but I am not
> > sure how.
> >
> > Thank you and merry Christmas to all
> >
> > Petr Pikal
> > [EMAIL PROTECTED]
> >
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Petr Pikal
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Memory allocation

2003-12-23 Thread JFRI (Jesper Frickmann)
Go download R version 1.8.1 (or later if available). They fixed
something with memory management from 1.8.0 to 1.8.1 which helped me out
of the exact same problem. I think it has to do with memory
fragmentation; R cannot find any chunk big enough for even a small
vector after some time.

Kind regards, 
Jesper Frickmann 
Statistician, Quality Control 
Novozymes North America Inc. 
Tel. +1 919 494 3266
Fax +1 919 494 3460

-Original Message-
From: Richards, Thomas [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 22, 2003 3:11 PM
To: '[EMAIL PROTECTED]'
Subject: [R] Memory allocation


Hello:

I am trying to work with a couple of microarray data sets, using

platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor8.1
year 2003   
month11 
day  21 
language R  


In the shortcut for invoking R I have set --max-mem-size=1024M, so that
I get

> memory.limit()
[1] 1073741824

Below is an example of what keeps happening as I am working. Any
suggestions as to how I can stop running out of mermory?

> memory.size()
[1] 502904736
> log2.harvAD <- log2.harvAD[log2.harvAD$Probesets %in%
harvard.genes$probeset,]
Error: cannot allocate vector of size 49 Kb
> log2.harvAD <- log2.harvAD[,c(1,1+order(names(log2.harvAD)[-1]))]
Error: cannot allocate vector of size 49 Kb
> log2.harvAD.annot <- 
> unlist(lapply(strsplit(names(log2.harvAD),split=":"),
+   function(L) L[1]))[-1]
> log2.harvAD$probeset <- as.character(log2.harvAD$probeset)
Error: cannot allocate vector of size 49 Kb
> memory.size()
[1] 502912536
> gc()
   used  (Mb) gc trigger  (Mb)
Ncells  2586025  69.16812252 182.0
Vcells 20108076 153.5   41205530 314.4
> memory.size()
[1] 330645720
> memory.limit()/memory.size()
[1] 3.247408
> ##  Try again:
> log2.harvAD <- log2.harvAD[log2.harvAD$Probesets %in%
harvard.genes$probeset,]
Error: cannot allocate vector of size 49 Kb

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R]plot.survfit

2003-12-23 Thread Fredrik Lundgren
Hello,

How do I get plot.survfit to draw a survival curve with prespecified time periods, say 
1 month, 2, months, 3 months, 6 months, 1 year, 2 years etc) instead of the individual 
times of all events?

Sincerely Fredrik Lundgren

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] How can I put error bars on a barplot() ?

2003-12-23 Thread olivier
Hi all,

I am a relatively new R user... trying to put error bars (from SD values) on my data 
represented with barplot(). But I can't find any function or instruction to do so.
Is there an easier way to do this than using segments() as I saw in an example in the 
R reference manual ? Then, can I define there graphical apparence ?

Thanks for help.

Regards

Olivier BUHARD

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] How can I put error bars on a barplot() ?

2003-12-23 Thread Marc Schwartz
On Tue, 2003-12-23 at 08:04, olivier wrote:
> Hi all,
> 
> I am a relatively new R user... trying to put error bars (from SD
> values) on my data represented with barplot(). But I can't find any
> function or instruction to do so.
> Is there an easier way to do this than using segments() as I saw in an
> example in the R reference manual ? Then, can I define there graphical
> apparence ?
> 
> Thanks for help.
> 
> Regards
> 
> Olivier BUHARD


Olivier,

You can use either segments() or arrows() to place error bars on
barplots. 

Also, there is barplot2() in the gregmisc package on CRAN, which
provides this functionality and enables you to pass the error bar values
as arguments to the function.

As you may have noted, if you use either segments() or arrows(), the key
is to get the bar midpoints for proper line placement. The bar midpoints
are returned from the barplot() function and that is described in the
help for barplot().

If you should elect to use barplot2(), let me know if you have any
questions on its use.

Best regards,

Marc Schwartz

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] (no subject)

2003-12-23 Thread Fam. Stallforth
Hello!

I am trying to import data to R. The programm always responds with:
"incomplete final line found by readTableHeader on Data.doc"

What does that mean, and what could I change?

Thank you very much in advance.
Regards Florian Stallforth

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] error propagation - hope it is correct subject

2003-12-23 Thread Thomas W Blackwell
Petr  -

Yes, you are interpreting the second suggestion exactly correctly,
apart from concern for possible correlations among x1,x2,x3.
If one can treat them as independent, I would do exactly as you
show:  generate a vector of, say, n = 1 simulated draws from
x1, another vector of the same length for x2, and another for x3,
then calculate  sd(f(x1,x2,x3))  as an approximation to the std
dev of f().

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Tue, 23 Dec 2003, Petr Pikal wrote:

> Hallo Thomas
>
> Thank you for your answer, even I am not sure how to do it in R (or maybe at
> all). My mathematics background is only faint so I drop the first possibility which
> is for me rather cryptic.
>
> Does your second suggestion mean:
>
> 1:compute random variable  y <- f(rnorm(n,mymeanx1,mysdx1),
> rnorm(n,mymeanx2, ...), ...)
>
> according to my function f  (based on assumption x variables values can be
> considered normally distributed and and independent)
>
> 2:sd(y)
>
> can be considered as variation of y?
> Or is it necessary to do something like
>
> vysled<-NULL
> for (i in 1:300) vysled[i]<-sd(sample(y,100))
> mean(vysled)
>
> to get bootstraped estimation of sd(y)
>
> My actual data have some missing values and some outliers which I can either
> remove or to use some robust statistics for mean and variation estimates.
>
> Thank you and have a nice Christmas
>
> Petr
>
> On 22 Dec 2003 at 8:56, Thomas W Blackwell wrote:
>
> > Petr  -
> >
> > Very briefly, I think of three ways to approximate the standard
> > deviation of  y = f(x1,x2,x3).
> >
> >   (1) linearise f() and use the covariance matrix of [x1,x2,x3].
> >   (2) simulate draws from the joint distribution of [x1,x2,x3],
> >  then compute the sample std dev of resulting f()s.
> >   (3) go back to the original data set from which [x1,x2,x3] were
> >  estimated as parameters, re-sample rows with replacement,
> >  estimate [x1,x2,x3] and compute f, then take sample std dev.
> >
> > Other names for these three would be (1) the "delta method" or
> > Taylor series expansion, (2) parametric bootstrap, (3) bootstrap.
> >
> > Different choices are appropriate in different situations.
> >
> > If the std devs of x1,x2,x3 are small relative to the curvature
> > (2nd derivative) in f(), then use (1) and compute by matrix algebra
> >
> > Var(f(x1,x2,x3))  approx  t(grad f) %*% Cov(x1,x2,x3) %*% grad f.
> >
> > If the curvature in f() is an issue, use (2) with draws of x1,x2,x3
> > from some parametric distribution (eg, rnorm()) with each component
> > properly conditioned on the ones already drawn.
> >
> > Only if there were no set of intermediate parameters [x1,x2,x3]
> > would I use (3) to get the precision of f directly.  I'm sure
> > Brad Efron would say something different.  (3) is the only one
> > that is canned in R, simply because the other two are practically
> > one-liners.
> >
> > -  tom blackwell  -  u michigan medical school  -  ann arbor  -
> >
> > On Mon, 22 Dec 2003, Petr Pikal wrote:
> >
> > > Dear all
> > >
> > > Please, can you advice me how to compute an error, standard
> > > deviation or another measure of variability of computed value.
> > >
> > > I would like to do something like:
> > >
> > > var(y) = some.function(var(x1),var(x2),var(x3))
> > >
> > > for level F1 (2,3,...)
> > >
> > > Let say I have some variables - x1, x2, x3 (two computed for levels
> > > of factor F and one which is same for all levels) and I want to
> > > compute
> > >
> > > y = f(x1,x2,x3)
> > >
> > > for some levels of factor F
> > >
> > > I can compute variation of variables for levels of F, I know a
> > > variation of one variable but I am not sure how to transfer it to
> > > variation of y within respective levels.
> > >
> > > I found some methods which I can use but I wonder if  there is some
> > > method implemented in R (Manly B.F. Biom.J.28,949,(1986), some local
> > > statistical books available to me).
> > >
> > > I have a feeling I could use bootstrap method for this but I am not
> > > sure how.
> > >
> > > Thank you and merry Christmas to all
> > >
> > > Petr Pikal
> > > [EMAIL PROTECTED]
> > >
> > > __
> > > [EMAIL PROTECTED] mailing list
> > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > >
> >
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
> Petr Pikal
> [EMAIL PROTECTED]
>
>
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] (no subject)

2003-12-23 Thread Thomas W Blackwell
Florian  -

One thing to *try* would be:  work from the R
command line and set the parameter "nlines" in
read.table()  to one less than the number of
lines of data in the file.  If this works, then
you can at least read in all but the last line.

I suspect something like a missing newline
character at the end of the file, or a strange
file format, but that is just a guess.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Tue, 23 Dec 2003, Fam. Stallforth wrote:

> Hello!
>
> I am trying to import data to R. The programm always responds with:
> "incomplete final line found by readTableHeader on Data.doc"
>
> What does that mean, and what could I change?
>
> Thank you very much in advance.
> Regards Florian Stallforth
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Warning when reading data files (was Re: [R] (no subject))

2003-12-23 Thread Prof Brian Ripley
On 23 Dec 2003, Fam. Stallforth wrote:

> Hello!
> 
> I am trying to import data to R. The programm always responds with:
> "incomplete final line found by readTableHeader on Data.doc"
> 
> What does that mean, and what could I change?

It means the final line is incomplete, and you should complete it!
Does it actually have a EOL mark, that is CR or LF or CRLF depending on 
your operating system?  The message come up when the EOF is found before 
EOL.

I believe this is just a warning and the process continues correctly, but 
only believe 

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


[R] R[Mailman] question: contour plot for discrete data

2003-12-23 Thread Dieter Menne
You wrote:
---
I have matrix (n x3) that represents discrete data. 
Each row of matrix is 3-D point (x,y,z). I would like 
to get contour map (z value) at two dimension 
(x,y). How can I use related contour function to do 
this job?
---

Paul Murrell ([EMAIL PROTECTED]) sent me his little
clines package some time ago. I will mail you (LZ) a copy

(Paul, I assume this is ok?).

Dieter

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] What's "latex" for?

2003-12-23 Thread Thomas Lumley
On Tue, 23 Dec 2003, [EMAIL PROTECTED] wrote:

> As an R absolute beginner when I update my R 1.8.1, after installing
> the packages I see the various updated commands orderly running in a
> table on the screen where, among other things, "latex" and "example"
> are indicated.
>
> 1) Being an old user of latex what **exactly** the "latex" label on a
> command mean and how, in what context, can it be used?

It means that a LaTeX version of the help page has been produced (it is
stored in the package directory, in the latex/ subdirectory).  It is used
to produce the PDF manuals, and by help(offline=TRUE).  The necessary
style file is in RHOME/share/texmf/

-thomas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R]plot.survfit

2003-12-23 Thread Thomas Lumley
On Tue, 23 Dec 2003, Fredrik Lundgren wrote:

> Hello,
>
> How do I get plot.survfit to draw a survival curve with prespecified
> time periods, say 1 month, 2, months, 3 months, 6 months, 1 year, 2
> years etc) instead of the individual times of all events?
>

Why would you want to do that?

If you have only one survival curve you can create a function that
describes it

survfun<-approxfun(fit$time,fit$surv,yleft=1,f=0,method="constant")

and then evaluate and plot this function whereever you want.

-thomas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] [R-pkgs] circular package

2003-12-23 Thread Claudio Agostinelli
Dear All,
Ulric Lund and me are developing a new package called 'circular' that as
soon as possible will substitute 'CircStats' package.
A pre-released is available at:
http://www.dst.unive.it/~claudio/R/circular_0.1.tar.gz
I kindly ask everybody is using CircStats to check this new package
and send me comments, suggestions and bugs to [EMAIL PROTECTED] and not to
the list.
As soon as the package will work fine we will ask the R core to make it
available on CRAN.

Bests,
Claudio Agostinelli

--
Claudio Agostinelli
Dipartimento di Statistica
Universita' Ca' Foscari di Venezia
Campiello San Agostin, 2347 San Polo
30125 Venezia
Tel: 041 2347432, Fax: 041 710355
email: [EMAIL PROTECTED], www: www.dst.unive.it/~claudio
--
Per favore non mandatemi allegati in Word o PowerPoint.
Si veda http://www.fsf.org/philosophy/no-word-attachments.html

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

___
R-packages mailing list
[EMAIL PROTECTED]
https://www.stat.math.ethz.ch/mailman/listinfo/r-packages

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Sweave question

2003-12-23 Thread Rafael A. Irizarry
Using Sweave in the tools library (R version 1.8.0: sorry i havent 
upgraded), it seems i cant use if statements in R chunks that make graphs. 
i have this:

<>=
par(mfrow=c(1,1))
if(exists("x")) 
plot(x,x)
else{
  plot(1,1,type="n")
  text(1,1,"data not available.\n")
}
@

and I get this error:

Error:  chunk 6
Error in parse(file, n, text, prompt) : parse error

any help is appreciated.

thanks and apologies if this not a problem in R 1.8.1
rafael

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Sweave question

2003-12-23 Thread Prof Brian Ripley
This is the standard problem with if ... else: that will not work at the
command line either.  Use braces like

if(exists("x")) {
  plot(x,x)
} else {
   plot(1,1,type="n")
   text(1,1,"data not available.\n")
}

which should do the trick.

On Tue, 23 Dec 2003, Rafael A. Irizarry wrote:

> Using Sweave in the tools library (R version 1.8.0: sorry i havent
> upgraded), it seems i cant use if statements in R chunks that make graphs.
> i have this:
>
> <>=
> par(mfrow=c(1,1))
> if(exists("x"))
>   plot(x,x)
> else{
>   plot(1,1,type="n")
>   text(1,1,"data not available.\n")
> }
> @
>
> and I get this error:
>
> Error:  chunk 6
> Error in parse(file, n, text, prompt) : parse error
>
> any help is appreciated.
>
> thanks and apologies if this not a problem in R 1.8.1
> rafael
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>

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


RE: [R] draft of posting guide

2003-12-23 Thread Tony Plate
I do share Eryk Wolski's and Pascal Nicklaus' concerns that my revision of 
the posting guide is somewhat unfriendly and negative.  My problem here was 
to keep it to a reasonable length, which meant eliminating sentences whose 
function was mainly to be positive and friendly.  Pascal put it nicely:

>- People tending not to dare to ask questions because they are intimidated by
>some aspects of the list (and after the r-beginner discussion we now know 
>that
>some feel like that) would be helped by a more positive wording of the same
>issues in posting guide. The motto should be "help to write better questions"
>rather than "stop asking poor questions". The content is all there in the
>draft, it is more about changing individual words. Re-posting it monthly on
>the list is a good idea.

I shall reread and see if any of it can be written in a more positive 
manner without increasing the length.  I am however reminded of Aesp's 
fable "You can't please everyone" 
(http://home1.gte.net/deleyd/prose/aesop63.htm).

The guide does contain a lot of statements that sound like "rules".  As 
others noted, it is just a guide.  However, it is my observation that 
people are occasionally admonished on R-help for violations of these 
"rules".  I think this is what is intimidating to some.  Part of my 
intention with writing the guide was to try to make explicit and put down 
in one accessible place what these "rules" are. This, I hope, will make it 
easier for beginners and those reluctant to post to know what they should 
actually do, so as to better avoid the acute embarrassment that can come 
from public admonishments.  I also tried to merely reflect the tone of the 
list rather than trying to set the tone.  I suspect that a concise and 
informative guide would be less of an intimidation to posting than seeing 
public admonishments of others and being in the dark about what is actually 
expected of posters (and would be more likely to be read than a longer, 
more chatty and friendly guide.)

I also agree that posting questions to R-help should not be the absolute 
last resort.  That's why I split the suggestions on research into two 
sections: "Do your homework before posting" and "Further resources".  It 
has been my observation that people are sometimes called to task if they 
ask questions without obviously having done the things in the "homework" 
section, but things in the "Further resources" sections are often mentioned 
in responses as friendly suggestions without any implication that the 
poster was negligent for not trying them before posting.

I do like the idea of a brief introduction to the guide, to say something 
like "This guide is intended to help you get the most out of the R mailing 
lists, and to avoid embarrassment.  Like many responses posted on the list, 
it is written in a concise manner.  This is not intended to be unfriendly - 
it is more a consequence of allocating limited time and space to technical 
issues rather than to social niceties."

Both Tom Mulholland and Patrick Burns suggested a checklist section, 
containing things to check before posting.  While I also like this idea, 
most of the content is already there under "homework" and "common 
mistakes". I'm not sure that changing the format will enhance the document 
that much, but I'm perfectly willing to hear opinions.

Please let me know if the following is incorrect: "For questions about 
functions in packages distributed with R (see the FAQ 
Add-on 
packages in R), ask questions on R-help. If the question relates to a 
package that is downloaded from CRAN try contacting the package maintainers 
first."

Comments welcome, however, at this point, perhaps it would be better to 
send comments to me privately, as most people have probably had enough of 
this discussion.

cheers,

Tony Plate

PS.  There is a slightly corrected and revised version at 
http://pws.prserv.net/tap/posting-guide-draft3.html.  I think it's beyond 
my skills to make it more "friendly" without making it longer.  If anyone 
else wants to take a go at it, feel free!  In the absence of such attempts, 
I'm pretty much done with it.

Tony Plate   [EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Sweave question

2003-12-23 Thread Thomas Lumley
On Tue, 23 Dec 2003, Rafael A. Irizarry wrote:

> Using Sweave in the tools library (R version 1.8.0: sorry i havent
> upgraded), it seems i cant use if statements in R chunks that make graphs.
> i have this:
>
> <>=
> par(mfrow=c(1,1))
> if(exists("x"))
>   plot(x,x)
> else{
>   plot(1,1,type="n")
>   text(1,1,"data not available.\n")
> }
> @
>

I think your problem is with the `else'.  The `if' part of the statement
is syntactically complete, so the parser isn't expecting an `else'.  You
need something like

  if (exists("x")){
plot(x,x)
  } else {
plot(1,1,type="n")
  }



-thomas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Re: if .. else parse error {was "Sweave question"}

2003-12-23 Thread Martin Maechler
> "Rafael" == Rafael A Irizarry <[EMAIL PROTECTED]>
> on Tue, 23 Dec 2003 10:44:38 -0500 (EST) writes:

Rafael> Using Sweave in the tools library (R version 1.8.0:
Rafael> sorry i havent upgraded), it seems i cant use if
Rafael> statements in R chunks that make graphs.  i have
Rafael> this:

Rafael> <>=
Rafael> par(mfrow=c(1,1))
Rafael> if(exists("x")) 
Rafael>plot(x,x)
Rafael> else{
Rafael>plot(1,1,type="n")
Rafael>text(1,1,"data not available.\n")
Rafael> }
Rafael> @

Rafael> and I get this error:

Rafael> Error:  chunk 6
Rafael> Error in parse(file, n, text, prompt) : parse error


This has nothing to do with Sweave;
it's a famous "beginner"s (;-) mistake:

?if   has the explanation :

 if> Note that it is a common mistake to forget putting braces ('{ ..}') 
 if> around your statements, e.g., after 'if(..)' or 'for()'.
 if> In particular, you should not have a newline between '}' and 
 if> 'else' to avoid a syntax error in entering a 'if ... else'
 if> construct at the keyboard or via 'source'. For that reason, one
 if> (somewhat extreme) attitude of defensive programming uses braces
 if> always, e.g., for 'if' clauses.

Regards,
and Merry Christmas to all R-help readers!
Martin

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R[Mailman] question: contour plot for discrete data

2003-12-23 Thread Paul Murrell
Hi

Renaud Lancelot wrote:
Dieter Menne a écrit :

You wrote:
---
I have matrix (n x3) that represents discrete data. Each row of matrix 
is 3-D point (x,y,z). I would like to get contour map (z value) at two 
dimension (x,y). How can I use related contour function to do this job?
---

Paul Murrell ([EMAIL PROTECTED]) sent me his little
clines package some time ago. I will mail you (LZ) a copy
(Paul, I assume this is ok?).

Dieter

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

The package clines is now on CRAN.


Also, be aware that in the next R release there will be a contourLines() 
function as part of R which will make the clines package redundant.

Paul
--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] test h-f sphericity test?

2003-12-23 Thread John Christie
	I posted some R code that could be an h-f sphericity test.  Is there 
anyone out there with SPSS, Systat, or some other package that has a 
built in test who can verify whether it is accurate or not?

John

(here is the code again)
# This returns the Huynh-Feldt or "Box Correction" for degrees of 
freedom
hf <- function(m){
	# m is a matrix with subjects as rows and conditions as columns
	# note that checking for worst case scenarios F correction first might
	# be a good idea using J/(J-1) as the df correction factor
	n<- length(m[,1])
	J<-length(m[1,])
	X<-cov(m)*(n-1)
	r<- length(X[,1])
	D<-0
	for (i in 1: r) D<- D+ X[i,i]
	D<-D/r
	SPm<- mean(X)
	SPm2<- sum(X^2)
	SSrm<-0
	for (i in 1: r) SSrm<- SSrm + mean(X[i,])^2
	epsilon<- (J^2*(D-SPm)^2) / ((J-1) * (SPm2 - 2*J*SSrm + J^2*SPm^2))
	epsilon
}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] draft of posting guide. Sorry.

2003-12-23 Thread Patrick Connolly
On Tue, 23-Dec-2003 at 05:31AM +0100, Eryk Wolski wrote:

[]

|> I cooled down now and therefore give me a chance to explain why
|> that user guide scares me.

A few comments:



|> As I said, the guide had given me the feeling that someone wants to
|> censor me. 

You mean you reacted in a way that gave you that feeling.  Let's get
cause and effect straight.

|> Especially the first section of the Posting Guide: "How to ask good
|> questions that prompt useful answers" does this. The guide starts
|> with talking mainly about what you should not, or what you must not
|> do.

If I want something to work, I take notice of what the suppliers
suggest is a good way to get it to work.  I never take such suggestions
as being prescriptive.  Once I know more about it, I feel free to
disregard any of them.  Posters can ignore anything in the guide if
they so wish.  Robust debate gets the brain working, but some feathers
might get ruffled in the process.


|> At last I like to mention one important source of help which are missing
|> in the posting guide, and which I forgot these days by myself: R CMD -help
|> and R --help are also very important help sources! If I had remembered it

A good suggestion.


-- 
Patrick Connolly
HortResearch
Mt Albert
Auckland
New Zealand 
Ph: +64-9 815 4200 x 7188
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Is there an R or S implementation of PAMSIL or PAMMEDSIL

2003-12-23 Thread Mulholland, Tom
I have some data that is dwarfed by one large cluster. I came across a
paper titled "A New Partitioning Around Medoids Algorithm" (van der
Laan, Pollard & Bryan, 2002) http://www.bepress.com/ucbbiostat/paper105/
that describes PAMSIL and PAMMEDSIL that look as though they might be
more appropriate for the data I have. 

There does not appear to be much out there which is describing itself by
these names. So any help would be appreciated.

Tom

_
 
Tom Mulholland
Senior Policy Officer
WA Country Health Service
Tel: (08) 9222 4062
 
The contents of this e-mail transmission are confidential an...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] question: DLL or EXE from R procedures

2003-12-23 Thread PaTa PaTaS
Hi,
I wonder if it is possible to create an DLL or EXE file performing R procedures. 
Instead of running R, reading data and calling some procedures, I would like to use R 
functions in the following way: "C:\linearRegression.exe data.txt" which would produce 
let's say file "output.txt" with the results. Is there some way how to do it?
Thanks a lot. Pavel Vanecek

Eurotel Data Nonstop  - neomezený přístup na internet za 649,- (s DPH 681,45)  Kč 
měsíčně! 
http://ad2.seznam.cz/redir.cgi?instance=67071%26url=http://www.eurotel.cz/site/cz/servicesAndTariffs/specialOffer.html?list=34995

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] draft of posting guide

2003-12-23 Thread Patrick Burns
I think the idea of answering simple questions if it hasn't
been answered after 4 * runif(1) hours is a brilliant idea
(well done Tony -- I'm jealous).  However, a slight tweak
would be even better.
It should be

number of years you've used S times runif(1) hours.  

This encourages more people to start answering questions.
While there has been some disagreement about other issues,
there seems to be consensus that building a large, strong
community of R users is a good thing.  Probably the easiest
way for people to contribute -- and hence feel a part of the
community -- is to respond to R-help questions.
(By the way, I'm not at all concerned that the "checklist" is
called "common mistakes".)
Patrick Burns

Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")
Tony Plate wrote:

I do share Eryk Wolski's and Pascal Nicklaus' concerns that my revision of 
the posting guide is somewhat unfriendly and negative.  My problem here was 
to keep it to a reasonable length, which meant eliminating sentences whose 
function was mainly to be positive and friendly.  Pascal put it nicely:

 

- People tending not to dare to ask questions because they are intimidated by
some aspects of the list (and after the r-beginner discussion we now know 
that
some feel like that) would be helped by a more positive wording of the same
issues in posting guide. The motto should be "help to write better questions"
rather than "stop asking poor questions". The content is all there in the
draft, it is more about changing individual words. Re-posting it monthly on
the list is a good idea.
   

I shall reread and see if any of it can be written in a more positive 
manner without increasing the length.  I am however reminded of Aesp's 
fable "You can't please everyone" 
(http://home1.gte.net/deleyd/prose/aesop63.htm).

The guide does contain a lot of statements that sound like "rules".  As 
others noted, it is just a guide.  However, it is my observation that 
people are occasionally admonished on R-help for violations of these 
"rules".  I think this is what is intimidating to some.  Part of my 
intention with writing the guide was to try to make explicit and put down 
in one accessible place what these "rules" are. This, I hope, will make it 
easier for beginners and those reluctant to post to know what they should 
actually do, so as to better avoid the acute embarrassment that can come 
from public admonishments.  I also tried to merely reflect the tone of the 
list rather than trying to set the tone.  I suspect that a concise and 
informative guide would be less of an intimidation to posting than seeing 
public admonishments of others and being in the dark about what is actually 
expected of posters (and would be more likely to be read than a longer, 
more chatty and friendly guide.)

I also agree that posting questions to R-help should not be the absolute 
last resort.  That's why I split the suggestions on research into two 
sections: "Do your homework before posting" and "Further resources".  It 
has been my observation that people are sometimes called to task if they 
ask questions without obviously having done the things in the "homework" 
section, but things in the "Further resources" sections are often mentioned 
in responses as friendly suggestions without any implication that the 
poster was negligent for not trying them before posting.

I do like the idea of a brief introduction to the guide, to say something 
like "This guide is intended to help you get the most out of the R mailing 
lists, and to avoid embarrassment.  Like many responses posted on the list, 
it is written in a concise manner.  This is not intended to be unfriendly - 
it is more a consequence of allocating limited time and space to technical 
issues rather than to social niceties."

Both Tom Mulholland and Patrick Burns suggested a checklist section, 
containing things to check before posting.  While I also like this idea, 
most of the content is already there under "homework" and "common 
mistakes". I'm not sure that changing the format will enhance the document 
that much, but I'm perfectly willing to hear opinions.

Please let me know if the following is incorrect: "For questions about 
functions in packages distributed with R (see the FAQ 
Add-on 
packages in R), ask questions on R-help. If the question relates to a 
package that is downloaded from CRAN try contacting the package maintainers 
first."

Comments welcome, however, at this point, perhaps it would be better to 
send comments to me privately, as most people have probably had enough of 
this discussion.

cheers,

Tony Plate

PS.  There is a slightly corrected and revised version at 
http://pws.prserv.net/tap/posting-guide-draft3.html.  I think it's beyond 
my skills to make it more "friendly" without making it longer.  If anyone 
else wants