Re: [R] A question about is.interger function

2006-04-26 Thread Dieter Menne
Leon amstat2006 at gmail.com writes:

 
 Hi, All
 I am using is.integer function to examine whether an object is an integer or 
not, but I get such results,
 
  x-3
  is.integer(x)
 [1] FALSE

x - 3
typeof(3)
[1] double

This may not be a wise decision in hindsight, but probably was made to avoid 
conversion when in the next step you do

x[2] = 1.5

y - as.integer(3)
 typeof(y)
[1] integer
 
  x-3:4
  x
 [1] 3 4
  is.integer(x)
 [1] TRUE

Here R seems to know that 3 is an integer, which I believe is a bit 
inconsistent, but wise, because mostly you use integers here. Mostly; because 

1.5:3.5 

gives a reasonable result

[1] 1.5 2.5 3.5

Dieter

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


Re: [R] Help needed

2006-04-26 Thread Petr Pikal
Hi

you experienced difference between matrix (cbind()) and data 
frame (data.frame(..)) or you have some NA value in your BMIGRP1

try:
maxcls-max(dset[,2], na.rm=T)
if you have some NA values
or use
str(dset) to look what types are your variables.

HTH
Petr


On 25 Apr 2006 at 18:16, Anamika Chaudhuri wrote:

Date sent:  Tue, 25 Apr 2006 18:16:42 -0700 (PDT)
From:   Anamika Chaudhuri [EMAIL PROTECTED]
To: Richard M. Heiberger [EMAIL PROTECTED], 
r-help@stat.math.ethz.ch
Subject:Re: [R] Help needed

 As my earlier email said I am not getting the maxcls. I do get numbers
 coded as 1,2,3 for BMIGRP(when I print BMIGRP) but not getting the max
 of (1,2,3) which should be 3, I guess.
 
   Thanks for your help
   Anamika
 
 
 Anamika Chaudhuri [EMAIL PROTECTED] wrote:
  dset1-cbind(AGE,BMI,DEATH)
  BMIGRP-cut(BMI,breaks=c(14,20,25,57),right=TRUE)
  levels(BMIGRP)
 [1] (14,20] (20,25] (25,57]
  BMIGRP1-as.numeric(BMIGRP)
  AGEGRP-floor(AGE/10)-2
  dset-cbind(AGEGRP,BMIGRP1,DEATH)
  maxage-max(dset[,1])
  minage-min(dset[,1])
  maxcls-max(dset[,2])
  maxcls
 [1] NA
 
   Why doesnt it give me a no for maxcls then?
 
   Thanks.
 
 
 Richard M. Heiberger [EMAIL PROTECTED] wrote:
x - rnorm(100)
  xx - cut(x,3)
  levels(xx)
 [1] (-2.37,-0.716] (-0.716,0.933] (0.933,2.58] 
  as.numeric(xx)
 
 
 -
 
 
 
 -
 
  [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

Petr Pikal
[EMAIL PROTECTED]

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


Re: [R] www.r-project.org

2006-04-26 Thread Romain Francois
Hi,

To sum up :
* yes, the R website is operationnal. There is no reason whatsoever to 
change its content.
* no javascript, no flash, no chartjunk !!
* rework the style, start wih the css file(s)
* stop with those frames, and use css to place some kind of fake frames
* maybe store the name of your CRAN in a cookie

What about
- place somewhere a div called 'Focus on a package' where we could have 
a short presentation of a package, etc ... or for a CRAN task view (to 
do that, php would be great, but we can do I don't know perl scripts to 
generate static html pages)
- a direct link to download R, which will redirect to the appropriate 
CRAN thanks to cookies
- Propose the Table of Contents of the last volume of R news.
- reduce the ratio (size of the head page graphic) / (information 
directly accesible)
- move search, task views, and documentation from cran to www


Romain



 From roger bos :
 After all, the r-help list doesn't even like HTML in email, so it may 
 not like too many fancy stuff on their website either.
html in email is evil. html in a website is normal.


 From Jon Baron :
 The only thing I might change is to replace the frames with some
 sort of CSS-based positioning.  HOWEVER, the new version of
 Internet Explorer may totally destroy the usefulness of CSS, so
 maybe it is better to leave things as they are for now.
What ! IE is not the only browser, and so not the better. Despite is 
dominant position, i don't think all website will abandon doing css  
because microsoft is not able to make its browser understand it.



-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

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


[R] Is there a way....

2006-04-26 Thread Levent TERLEMEZ
Hello,

I would like to get rid of counting lines in fix() when i made a 
mistake in coding? Is there an easy way to an line numbers to editor? 
Thanks.

Levent TERLEMEZ.

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


[R] environment

2006-04-26 Thread Romain Francois
Hi,

Consider the code :

g - function(){
  print(.x)
 .x - 3
}

f - function(){
  environment(g) - environment()
  .x - 2
  g()
  .x
}

  f()
[1] 2
[1] 2


I would like f() to return 3. How can I do that ? Am I completely out of 
place ?
Doing that, I want to avoid to pass .x as a parameter in f, because in 
real life .x is pretty big and g() is called over and over in a loop.

Thanks

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

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


[R] program and comment

2006-04-26 Thread Guojun Zhu
Hi.  I am a newbie to R. I need to do a courses
projects with some manipulation lots of data record
and some back-and-forth linear regression.  I do not
want to spend $100 for a SAS lincence, which professor
used.  So I decide to start to learn R to finish it. 
I am using R in Windows.  I feel it is somehow works
like mathemica.  I try to write the work into a little
program for future reference. (My data soon exceeds
the workplace.) So that should be a script, right? 
Then I can load it in file/source R code.  One thing
puzzles me is that how to write  comments in the
script.  I googled internet and the archive and did
not find any clues.  

First, can anyone confirm that I took the correct
approach for the problem?  I understand R is quite
different from program language like C/Pascal which I
am familiar with and seems people write it with quite
different style.  Second, can anyone show me some idea
about how to write  the comment.  Thanks.

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


Re: [R] program and comment

2006-04-26 Thread Dirk De Becker
Guojun Zhu wrote:

Hi.  I am a newbie to R. I need to do a courses
projects with some manipulation lots of data record
and some back-and-forth linear regression.  I do not
want to spend $100 for a SAS lincence, which professor
used.  So I decide to start to learn R to finish it. 
I am using R in Windows.  I feel it is somehow works
like mathemica.  I try to write the work into a little
program for future reference. (My data soon exceeds
the workplace.) So that should be a script, right? 
Then I can load it in file/source R code.  One thing
puzzles me is that how to write  comments in the
script.  I googled internet and the archive and did
not find any clues.  

First, can anyone confirm that I took the correct
approach for the problem?  I understand R is quite
different from program language like C/Pascal which I
am familiar with and seems people write it with quite
different style.  Second, can anyone show me some idea
about how to write  the comment.  Thanks.
  

It seems a good idea to me to add all your commands in a script and to 
source it in order to execute it.
Comments can be added in R simply by starting a line with a #

Greetz,

Dirk

-- 
Dirk De Becker
Work: Kasteelpark Arenberg 30
  3001 Heverlee
  phone: ++32(0)16/32.14.44
  fax: ++32(0)16/32.85.90
Home: Waversebaan 90
  3001 Heverlee
  phone: ++32(0)16/23.36.65
[EMAIL PROTECTED]
mobile phone: ++32(0)498/51.19.86


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

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


Re: [R] program and comment

2006-04-26 Thread Hans-Peter
2006/4/26, Guojun Zhu [EMAIL PROTECTED]:
 Hi.  I am a newbie to R. I need to do a courses

*do* have a look at e.g.:
- http://cran.r-project.org/manuals.html (An Introduction to R)
- http://www.ms.unimelb.edu.au/~andrewpr/r-users/icebreakeR.pdf 
(contributed manual)
- http://cran.r-project.org/doc/contrib/Short-refcard.pdf  (reference-card)

to search the archives you can use:
- http://tolstoy.newcastle.edu.au/R/about.html
- http://finzi.psych.upenn.edu/search.html

 I am using R in Windows.

Have a look at Tinn-R  (editor)

 like mathemica.  I try to write the work into a little
 program for future reference. (My data soon exceeds
 the workplace.) So that should be a script, right?

yes

 Then I can load it in file/source R code.

source( yourScript.R )

check working path: getwd()
if you don't know what this is:
  ?getwd
  ?source

 First, can anyone confirm that I took the correct
 approach for the problem?

yes

I understand R is quite
 different from program language like C/Pascal which I
 am familiar with and seems people write it with quite
 different style.

it's a functional language and inherits from LISP (Scheme). You need
to read the manual.

Second, can anyone show me some idea
 about how to write  the comment.  Thanks.

# this is a comment

--
Regards,
Hans-Peter

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


Re: [R] environment

2006-04-26 Thread Peter Dalgaard
Romain Francois [EMAIL PROTECTED] writes:

 Hi,
 
 Consider the code :
 
 g - function(){
   print(.x)
  .x - 3
 }
 
 f - function(){
   environment(g) - environment()
   .x - 2
   g()
   .x
 }
 
   f()
 [1] 2
 [1] 2
 
 
 I would like f() to return 3. How can I do that ? Am I completely out of 
 place ?
 Doing that, I want to avoid to pass .x as a parameter in f, because in 
 real life .x is pretty big and g() is called over and over in a loop.

If you want to assign into the environment of g, you'll need - ,
otherwise you  assign to a local variable. 

Another possibility involves assign(..., parent.frame()) 

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

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


[R] Minimum Volume Ellipsoid Estimator (cov.mve??)

2006-04-26 Thread Öhagen Patrik
Dear All,

The Minimum Volume Ellipsoid estimator (cov.mve) was part of S+ but I cannot 
find it in R. Where can I find it? Why was it excluded?

Cheers, Patrik
Sweden

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


Re: [R] environment

2006-04-26 Thread Romain Francois
Le 26.04.2006 11:02, Peter Dalgaard a écrit :
 Romain Francois [EMAIL PROTECTED] writes:

   
 Hi,

 Consider the code :

 g - function(){
   print(.x)
  .x - 3
 }

 f - function(){
   environment(g) - environment()
   .x - 2
   g()
   .x
 }

   f()
 [1] 2
 [1] 2


 I would like f() to return 3. How can I do that ? Am I completely out of 
 place ?
 Doing that, I want to avoid to pass .x as a parameter in f, because in 
 real life .x is pretty big and g() is called over and over in a loop.
 

 If you want to assign into the environment of g, you'll need - ,
 otherwise you  assign to a local variable. 

 Another possibility involves assign(..., parent.frame()) 
   
Oh yes,
sorry for posting. I knew that.

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

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


Re: [R] Generalized linear mixed models

2006-04-26 Thread Prof Brian Ripley
On Tue, 25 Apr 2006, Peter Tait wrote:

 Hi,

 I would like to fit a generalized linear mixed model (glmm) with a 3
 level response.

 My data is from a longitudinal study with multiple observations/patient
 and multiple patients / country.

 Is there an R package that will fit a proportional odds, continuation
 ratio, or adjacent categories glmm?

Those are not GLMs, so the generalization would not be a glmm.  It is not 
even clear what you would want to be random: just the intercepts?

Perhaps you need to find literature discussing relevant models and see 
what software it proposes?

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

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


Re: [R] Minimum Volume Ellipsoid Estimator (cov.mve??)

2006-04-26 Thread Prof Brian Ripley

On Wed, 26 Apr 2006, Öhagen Patrik wrote:


Dear All,

The Minimum Volume Ellipsoid estimator (cov.mve) was part of S+ but I 
cannot find it in R. Where can I find it?


help.search(cov.mve)  gives

cov.rob(MASS)   Resistant Estimation of Multivariate Location
and Scatter

so you see not to know how to search.


Why was it excluded?


R is not a clone of S-PLUS (sic), but a different system based on the S 
language.  Often there is better functionality in R (and indeed in this 
case there is later enhanced functionality in S-PLUS too).


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

Re: [R] Partially crossed and nested random factors in lme/lmer

2006-04-26 Thread Spencer Graves
  1.  Are you familiar with Pinheiro and Bates (2000) Mixed-Effects 
Models in S and S-Plus (Springer)?  I've learned a lot from this book 
both about mixed models generally and about lme in particular -- and 
even indirectly about lmer.  Examples in this book would, I believe, 
help you figure out how to get what you want from lme.  Files 
containing virtually all the R commands in that book can be found in 
~\library\nlme\scripts in your R installation directory.  You can make 
a local copy and walk through the code line by line, trying various 
modifications as you go.

  2.  Are you familiar both with Doug Bates' recent article on mixed 
models in R News and with his mlmRev package and MlmSoftRev 
vignette?  You can get an R script file of virtually all the R commands 
in the *.PDF file accompanying the vignette, which you can then modify 
as you wish to help you learn from the vignette.  Examples in the 
vignette help file tell you how to do this.  [If you use XEmacs, the 
edit(v1) line there may not work.  Instead, try Stangle(v1$file) 
then look for a new *.R file in your working directory -- identified by 
getwd().]

  If you've spent some time with both of these and still would like 
further help from this group, please submit another post -- after first 
reading the posting guide! www.R-project.org/posting-guide.html, 
especially the bit about providing a self-contained example.  Many 
different things might contribute to the problem you describe that the 
program terminates with the second lmer example.  I tried copying your 
script into R and got, 'object duration.root.transf not found' from 
both lmer and lme.  If your example had been self-contained -- and 
the simpler the better -- I might have been able to help more.

  hope this helps,
  spencer graves

Corsin Müller, Zoologisches Inst. wrote:

 Hi all,
 
 I am not a very proficient R-user yet, so I hope I am not wasting people’s 
 time. I want to run a linear mixed model with 3 random factors (A, B, C) 
 where A and B are partially crossed and C is nested within B. I understand 
 that this is not easily possible using lme but it might be using lmer. I 
 encountered two problems when trying:
 
 Firstly, I can enter two random factors in lmer but I do not get complete 
 outputs using both anova () and summary (). For instance, I only get df, SS, 
 and MS using anova(). Even so the model runs without giving an error 
 message.
 
 
lmer.inspection - lmer(
duration.root.transf~
sex*sample.sex+age+sample.age+sample.type+
first.bout+location+sample.source +
(1|acceptor.grp) + (1|donor.grp))
anova (lmer.inspection)
 
 Analysis of Variance Table
 Df  Sum Sq Mean Sq
 sex 1 0.06653 0.06653
 sample.sex  1 0.60389 0.60389
 …
 
 Running the same model in lme using only one random factor works fine.
 
 
lme.inspection - lme(
duration.root.transf~
sex*sample.sex+age+sample.age+sample.type+
first.bout+location+sample.source, random=~1|acceptor.grp)
anova (lme.inspection)
 
 numDF denDF  F-value p-value
 (Intercept)1  4427 47690.12  .0001
 sex1  4427 7.93  0.0049
 sample.sex 1  442765.71  .0001
 …
 
 Running the example given  in “?lmer” also does not give a complete anova 
 table. However, the example discussed in the email by Jacob Michaelson on 
 the 24th of April 2005 “[R] random interactions in lme” gives a complete 
 output. So I seem to miss out on something.
 
 Secondly, I am at a loss with how I can enter the third random factor, which 
 should be nested within acceptor.grp. When trying the to me intuitively 
 sensible
 
 
lmer.inspection - lmer(duration.root.transf~ … + (1|acceptor.grp/id) + 
(1|donor.grp))
 
 the program terminates
 
 I am grateful for any suggestions.
 
 Version used: R 2.2.1 for Windows
 
 Thanks,
 Corsin Mueller
 
 
 
 Corsin Mueller
 Universität of Zuerich
 Zoological Institute
 Winterthurerstr. 190
 8057 Zuerich
 Switzerland
 
 fon +41-(0)44-63 55277
 fax +41-(0)44-63 55490
 email [EMAIL PROTECTED]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] www.r-project.org

2006-04-26 Thread Prof Brian Ripley
The webmasters have not AFAICS replied in this thread, and perhaps you 
should wait for them.

In particular, making cran.r-project.org an autodirector to the nearest 
mirror and replacing frames have I believe already been agreed and just 
need resources to implement (and first www. and cran.r-project.org are 
being moved to new hardware at a different physical site).

Please remember that as always R has very limited human resources and is 
the web site a high priority within those resources? (I don't judge it 
so.)

You will find discussion of frames vs css in the archives.


On Wed, 26 Apr 2006, Romain Francois wrote:

 Hi,

 To sum up :
 * yes, the R website is operationnal. There is no reason whatsoever to
 change its content.
 * no javascript, no flash, no chartjunk !!
 * rework the style, start wih the css file(s)
 * stop with those frames, and use css to place some kind of fake frames
 * maybe store the name of your CRAN in a cookie

 What about
 - place somewhere a div called 'Focus on a package' where we could have
 a short presentation of a package, etc ... or for a CRAN task view (to
 do that, php would be great, but we can do I don't know perl scripts to
 generate static html pages)
 - a direct link to download R, which will redirect to the appropriate
 CRAN thanks to cookies
 - Propose the Table of Contents of the last volume of R news.
 - reduce the ratio (size of the head page graphic) / (information
 directly accesible)
 - move search, task views, and documentation from cran to www


 Romain



 From roger bos :
 After all, the r-help list doesn't even like HTML in email, so it may
 not like too many fancy stuff on their website either.
 html in email is evil. html in a website is normal.


 From Jon Baron :
 The only thing I might change is to replace the frames with some
 sort of CSS-based positioning.  HOWEVER, the new version of
 Internet Explorer may totally destroy the usefulness of CSS, so
 maybe it is better to leave things as they are for now.
 What ! IE is not the only browser, and so not the better. Despite is
 dominant position, i don't think all website will abandon doing css
 because microsoft is not able to make its browser understand it.





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

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


[R] new.frame()

2006-04-26 Thread Anna Whitfield
Hello,

I would like to know whether R has a homogeneous function
of S-plus's new.frame(), which create explicit frames in
the evaluator and provide a locale for computations that
can be shared among various functions.

new.frame() in S-plus:
http://www.uni-muenster.de/ZIV/Mitarbeiter/BennoSueselbeck/s-html/helpfiles/new.frame.html

Thanks.

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


Re: [R] [O/T] undergrads and R

2006-04-26 Thread Ales Ziberna
Dear John Fox,

thank you for your reply. I appologize for not finding the sort.names 
option myself.

As for the option of choosing several variables at a time, I would like 
to see this possibility everywhere where possible. Let me give a few 
examples:
1. Calculating the mean of several variables (for example, I often want 
to compute the mean of a set of variables measuring the same concept)
2. Recoding a set of variables with the same rule
3. Transforming a set of variables from factor to numeric or vice verse. 
(This would be especially useful when using data read from SPSS, as all 
variables with labels are converted to factors. These are often ordinal 
variables measured on 5 or more point scale, which are often as close as 
you can get in social sciences to interval variables. However for most 
of the analysis (like regression, factor analysis ...), they have to be 
treated as numeric.)

As to how this should be done, I agree that a check-box to select all 
numeric variables might be to no thingking approach. I would just like 
to have an option to select several variables, the same way as is done 
now in for example factor analysis.

I do understand that you want the students to think what they are doing. 
However I would like to present them the R commander as an alternative 
to SPSS also for doing their assignments for other courses and I do not 
believe they would be willing to make the change if they have to do so 
much clicks just to compute averages for let say 20 variables.

I personally think that it is enough that the software does not allow 
you (or the students) to do wrong things (like computing a mean of the 
factor), especially not without thinking about it.

Another option I would like are:
1. An option to save (or actually to not delete) the results of let say 
factor analysis, so I could use them for further analysis.
2. Currently, if I create a factor via command line, it is not 
recognized my the menus (for example, I can not do a frequency table). 
  If I select a different data frame and then again the previous one as 
the active data frame, the new factor is now recognized in the menus. So 
I would also be satisfied by a refresh option for the active data frame.

That would be all for now. Thanks again for the reply and for creating 
Rcmdr in the first place.

Best regards,
Ales


John Fox pravi:
 Dear Ales,
 
 -Original Message-
 From: Ales Ziberna [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, April 25, 2006 1:15 AM
 To: Richard M. Heiberger
 Cc: r-help@stat.math.ethz.ch; John Fox
 Subject: Re: [R] [O/T] undergrads and R

 I will be also using R commander with undergrad students, who 
 actually already have some experience with R, however they 
 have been using it more as programing language than a 
 statistical tool and I want to get them more familiar with 
 this aspect of R.

 First, when I had my first look at R commander, I really 
 liked it, however, when I did a little more experiments, I 
 found it quite frustrating at times, especially by the fact 
 that when computing a certain statistics (for example mean), 
 you can select only one variable at the time. Are there any 
 plans to change this, so that a number of variables could be 
 chosen? 
 
 This was a deliberate choice, made to discourage students from computing
 statistics without thinking about them, but perhaps it's wrongheaded. I'd be
 interested to hear what people think. 
 
 It would be very simple to change the Numerical Summaries dialog to permit
 more than one variable to be selected (in fact you could do it and recompile
 the package if you wished). Are you referring only to the Statistics -
 Summaries - Numerical summaries dialog, or are there other places where
 you'd like more than one variable to be selected? Would you like a check-box
 to select all numeric variables?
 
 More generally, I'm open to considering suggestions for improving the Rcmdr.
 
 I would also prefer to have the variables sorted the 
 same way as they are in the data frame and and not 
 alphabetically. 
 
 See the sort.names Rcmdr option, described in ?Commander.
 
 Regards,
  John
 
 If this two (what I believe minor) things 
 could be improved, I would find R commander much more usable.

 Otherwise, I find it a grate package, especially when working 
 with social sciences students.

 Does anyone else have similar filings.

 Best regards,
 Ales Ziberna

 Richard M. Heiberger pravi:
 This semester for the first time I have been using the 
 combination of 
 R, R Commander (John Fox's package providing a menu-driven 
 interface 
 to R), and RExcel (Erich Neuwirth's package for interfacing R with 
 Excel).  The audience is the introductory Statistics class for 
 Business undergradutes.  The short summary is that I think the 
 combination works well for this audience.

 I will be talking on my experience at the useR! conference 
 in June.  I 
 added several additional menu items to Rcmdr for our group.  I sent 
 the January 

Re: [R] new.frame()

2006-04-26 Thread Prof Brian Ripley
?new.env
?local

should help you.  R works with environments, basically a frame plus an 
enclosure.

On Wed, 26 Apr 2006, Anna Whitfield wrote:

 Hello,

 I would like to know whether R has a homogeneous function
 of S-plus's new.frame(), which create explicit frames in
 the evaluator and provide a locale for computations that
 can be shared among various functions.

 new.frame() in S-plus:
 http://www.uni-muenster.de/ZIV/Mitarbeiter/BennoSueselbeck/s-html/helpfiles/new.frame.html

 Thanks.

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


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

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


Re: [R] regression modeling

2006-04-26 Thread John Maindonald
An interesting example of this is the forest cover data set that is
available from http://www.ics.uci.edu/~mlearn
The proportions of the different cover types change systematically
as one moves through the file.  It seems that distance through the
file is a proxy for the geographical co-ordinates.  Fitting a tree-based
or suchlike model to the total data is not the way to go, unless one
is going to model the pattern of change through the file as part of the
modeling exercise.  In any case, some preliminary exploration of the
data is called for, so that such matters come to attention.  For my
money, the issue is not ease of performing regression with huge data
sets, but ease of data exploration.

John Maindonald email: [EMAIL PROTECTED]
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Mathematical Sciences Institute, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.


On 26 Apr 2006, at 8:00 PM, [EMAIL PROTECTED] wrote:

 From: Berton Gunter [EMAIL PROTECTED]
 Date: 26 April 2006 6:47:12 AM
 To: 'Weiwei Shi' [EMAIL PROTECTED], 'bogdan romocea'  
 [EMAIL PROTECTED]
 Cc: 'r-help' R-help@stat.math.ethz.ch
 Subject: Re: [R] regression modeling


 May I offer a perhaps contrary perspective on this.

 Statistical **theory** tells us that the precision of estimates  
 improves as
 sample size increases. However, in practice, this is not always the  
 case.
 The reason is that it can take time to collect that extra data, and  
 things
 change over time. So the very definition of what one is measuring, the
 measurement technology by which it is measured (think about  
 estimating tumor
 size or disease incidence or underemployment, for example), the  
 presence or
 absence of known or unknown large systematic effects, and so forth may
 change in unknown ways. This defeats, or at least complicates, the
 fundamental assumption that one is sampling from a (fixed)  
 population or
 stable (e.g. homogeneous, stationary) process, so it's no wonder  
 that all
 statistical bets are off. Of course, sometimes the necessary  
 information to
 account for these issues is present, and appropriate (but often  
 complex)
 statistical analyses can be performed. But not always.

 Thus, I am suspicious, cynical even, about those who advocate  
 collecting
 all the data and subjecting the whole vast heterogeneous mess to  
 arcane
 and ever more computer intensive (and adjustable parameter ridden)  
 data
 mining algorithms to detect trends or discover knowledge. To  
 me, it
 sounds like a prescription for turning on all the equipment and  
 waiting to
 see what happens in the science lab instead of performing careful,
 well-designed experiments.

 I realize, of course, that there are many perfectly legitimate  
 areas of
 scientific research, from geophysics to evolutionary biology to  
 sociology,
 where one cannot (easily) perform planned experiments. But my point  
 is that
 good science demands that in all circumstances, and especially when  
 one
 accumulates and attempts to aggregata data taken over spans of time  
 and
 space, one needs to beware of oversimplification, including  
 statistical
 oversimplification. So interrogate the measurement, be skeptical of
 stability, expect inconsistency. While all models are wrong but  
 some are
 useful (George Box), the second law tells us that entropy still  
 rules.

 (Needless to say, public or private contrary views are welcome).

 -- Bert Gunter
 Genentech Non-Clinical Statistics
 South San Francisco, CA

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

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


Re: [R] www.r-project.org

2006-04-26 Thread Barry Rowlingson
Romain Francois wrote:

 
 What about
 - place somewhere a div called 'Focus on a package' where we could have 
 a short presentation of a package, etc ... or for a CRAN task view (to 
 do that, php would be great, but we can do I don't know perl scripts to 
 generate static html pages)
 - a direct link to download R, which will redirect to the appropriate 
 CRAN thanks to cookies
 - Propose the Table of Contents of the last volume of R news.
 - reduce the ratio (size of the head page graphic) / (information 
 directly accesible)
 - move search, task views, and documentation from cran to www
 

  Now maybe my original assessment that a CMS wasn't worth investing in 
needs a rethink.

Suppose www.r-project.org was rebuilt with Plone: http://plone.org/

You'd get:

  * An easy-to-edit set of accessible web pages

  * A thorough search of site content

  * News and Events objects

  * Replace CRAN with Plone Software Center: 
http://plone.org/products/plonesoftwarecenter - as used to display plone 
Products here: http://plone.org/products

  * Use Plone Help Center for documentation, as used here: 
http://plone.org/documentation

  * Use poi to replace the R-bugs system: http://plone.org/products/poi 
- although plone itself has moved to using 'trac' 
http://www.edgewall.com/trac/

  Of course, it requires time, hosting, and enthusiasm I'm currently 
lacking all three.

Barry

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


Re: [R] lwd - Windows

2006-04-26 Thread Prof Brian Ripley
On Wed, 26 Apr 2006, Francisco J. Zagmutt wrote:

 Dear all

 Is there a way or trick in windows to plot a line width that is not an
 integer i.e 1.5?
 I am aware that the documentation for window devices states Line widths as
 controlled by par(lwd=) are in multiples of the pixel size, and multiples 
 1 are silently converted to 1 but I was wondering if there is a workaround
 this.

That's not what it says in R 2.3.0 (nor in my copy of 2.2.1)!  ?windows 
says

  Line widths as controlled by 'par(lwd=)' are in multiples of
  1/96inch.  Multiples less than 1 are allowed, down to one pixel
  width.

 Also, IMHO the documentation for lwd in par may need some clarification
 since it states:
 The line width, a positive number, defaulting to 1. The interpretation is
 device-specific, and some devices do not implement line widths less than
 one.  Perhaps it would be useful for the users to describe the behavior for
 the most important devices, and also to state that the number is an integer
 (at least for windows) and not just a positive number?

False premise.  Please don't ask for the documentation to be changed to 
your personal misreading of it.

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

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


Re: [R] www.r-project.org

2006-04-26 Thread Romain Francois
Le 26.04.2006 12:14, Prof Brian Ripley a écrit :
 The webmasters have not AFAICS replied in this thread, and perhaps you 
 should wait for them.

 In particular, making cran.r-project.org an autodirector to the 
 nearest mirror and replacing frames have I believe already been agreed 
 and just need resources to implement (and first www. and 
 cran.r-project.org are being moved to new hardware at a different 
 physical site).

 Please remember that as always R has very limited human resources and 
 is the web site a high priority within those resources? (I don't judge 
 it so.)

Absolutely. This is so not a priority for the core team.
You are doing a wonderful job improving R, and I do not want in any case 
divert you from that.

But, some people (like me) don't have the same abilities in R 
programming, but can (to some extent) contribute efforts in designing 
web pages.
 
 You will find discussion of frames vs css in the archives.
I'm on my way ...

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

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


Re: [R] new.frame()

2006-04-26 Thread Gabor Grothendieck
Also, the proto and R.oo packages provide object oriented
ways of working with environments.

On 4/26/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:
 ?new.env
 ?local

 should help you.  R works with environments, basically a frame plus an
 enclosure.

 On Wed, 26 Apr 2006, Anna Whitfield wrote:

  Hello,
 
  I would like to know whether R has a homogeneous function
  of S-plus's new.frame(), which create explicit frames in
  the evaluator and provide a locale for computations that
  can be shared among various functions.
 
  new.frame() in S-plus:
  http://www.uni-muenster.de/ZIV/Mitarbeiter/BennoSueselbeck/s-html/helpfiles/new.frame.html
 
  Thanks.
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 

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

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


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


Re: [R] environment

2006-04-26 Thread Gabor Grothendieck
A third possibility is to using the proto package and define
a proto object (an environment with special meaning for $)
containing the two components .x and g like this:

library(proto)
p - proto(.x = 2, g = function(.) { print(.$.x); .$.x - 3 })
p$.x  # 2
print(p$g())  # 2, 3
p$.x # 3

or you can write the print statement as with(., print(.x))

On 26 Apr 2006 11:02:58 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote:
 Romain Francois [EMAIL PROTECTED] writes:

  Hi,
 
  Consider the code :
 
  g - function(){
print(.x)
   .x - 3
  }
 
  f - function(){
environment(g) - environment()
.x - 2
g()
.x
  }
 
f()
  [1] 2
  [1] 2
 
 
  I would like f() to return 3. How can I do that ? Am I completely out of
  place ?
  Doing that, I want to avoid to pass .x as a parameter in f, because in
  real life .x is pretty big and g() is called over and over in a loop.

 If you want to assign into the environment of g, you'll need - ,
 otherwise you  assign to a local variable.

 Another possibility involves assign(..., parent.frame())

And a third possibility is:

library(proto)

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


Re: [R] Partially crossed and nested random factors in lme/lmer

2006-04-26 Thread Corsin Müller, Zoologisches Inst.
I do have Pinheiro and Bates 2000 and went through it several times – 
unfortunately without success for my particular issue. I was not aware of 
the article in R news or the mlmRev package you referred to, though. I will 
try with that.

The example I gave was not self-contained. Sorry, my fault.

Cheers,
Corsin


On Wed, 26 Apr 2006 03:11:52 -0700
  Spencer Graves [EMAIL PROTECTED] wrote:
 1.  Are you familiar with Pinheiro and Bates (2000) Mixed-Effects 
Models in S and S-Plus (Springer)?  I've learned a lot from this book both 
about mixed models generally and about lme in particular -- and even 
indirectly about lmer.  Examples in this book would, I believe, help you 
figure out how to get what you want from lme.  Files containing virtually 
all the R commands in that book can be found in ~\library\nlme\scripts in 
your R installation directory.  You can make a local copy and walk through 
the code line by line, trying various modifications as you go.
 
 2.  Are you familiar both with Doug Bates' recent article on mixed 
models in R News and with his mlmRev package and MlmSoftRev vignette? 
 You can get an R script file of virtually all the R commands in the *.PDF 
file accompanying the vignette, which you can then modify as you wish to 
help you learn from the vignette.  Examples in the vignette help file 
tell you how to do this.  [If you use XEmacs, the edit(v1) line there may 
not work.  Instead, try Stangle(v1$file) then look for a new *.R file in 
your working directory -- identified by getwd().]
 
 If you've spent some time with both of these and still would like 
further help from this group, please submit another post -- after first 
reading the posting guide! www.R-project.org/posting-guide.html, 
especially the bit about providing a self-contained example.  Many 
different things might contribute to the problem you describe that the 
program terminates with the second lmer example.  I tried copying your 
script into R and got, 'object duration.root.transf not found' from both 
lmer and lme.  If your example had been self-contained -- and the 
simpler the better -- I might have been able to help more.
 
 hope this helps,
 spencer graves
 
 Corsin Müller, Zoologisches Inst. wrote:
 
 Hi all,
 
 I am not a very proficient R-user yet, so I hope I am not wasting people’s 
 time. I want to run a linear mixed model with 3 random factors (A, B, C) 
 where A and B are partially crossed and C is nested within B. I understand 
 that this is not easily possible using lme but it might be using lmer. I 
 encountered two problems when trying:
 
 Firstly, I can enter two random factors in lmer but I do not get complete 
 outputs using both anova () and summary (). For instance, I only get df, 
SS, 
 and MS using anova(). Even so the model runs without giving an error 
 message.
 
 
lmer.inspection - lmer(
 duration.root.transf~
 sex*sample.sex+age+sample.age+sample.type+
 first.bout+location+sample.source +
 (1|acceptor.grp) + (1|donor.grp))
anova (lmer.inspection)
 
 Analysis of Variance Table
 Df  Sum Sq Mean Sq
 sex 1 0.06653 0.06653
 sample.sex  1 0.60389 0.60389
 …
 
 Running the same model in lme using only one random factor works fine.
 
 
lme.inspection - lme(
 duration.root.transf~
 sex*sample.sex+age+sample.age+sample.type+
 first.bout+location+sample.source, random=~1|acceptor.grp)
anova (lme.inspection)
 
 numDF denDF  F-value p-value
 (Intercept)1  4427 47690.12  .0001
 sex1  4427 7.93  0.0049
 sample.sex 1  442765.71  .0001
 …
 
 Running the example given  in “?lmer” also does not give a complete anova 
 table. However, the example discussed in the email by Jacob Michaelson on 
 the 24th of April 2005 “[R] random interactions in lme” gives a complete 
 output. So I seem to miss out on something.
 
 Secondly, I am at a loss with how I can enter the third random factor, 
which 
 should be nested within acceptor.grp. When trying the to me intuitively 
 sensible
 
 
lmer.inspection - lmer(duration.root.transf~ … + (1|acceptor.grp/id) + 
(1|donor.grp))
 
 the program terminates
 
 I am grateful for any suggestions.
 
 Version used: R 2.2.1 for Windows
 
 Thanks,
 Corsin Mueller
 
 
 
 Corsin Mueller
 Universität of Zuerich
 Zoological Institute
 Winterthurerstr. 190
 8057 Zuerich
 Switzerland
 
 fon +41-(0)44-63 55277
 fax +41-(0)44-63 55490
 email [EMAIL PROTECTED]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html





Corsin Müller
Universität Zürich
Zoologisches Institut
Winterthurerstr. 190
8057 Zürich
Switzerland

Tel +41-(0)44-63 55277
Fax +41-(0)44-63 55490
Email [EMAIL PROTECTED]


Re: [R] Is there a way....

2006-04-26 Thread Uwe Ligges
Levent TERLEMEZ wrote:

 Hello,
 
 I would like to get rid of counting lines in fix() when i made a 
 mistake in coding? Is there an easy way to an line numbers to editor? 

I think the feature you are requesting is not available.
Beside, it is a good idea to use some appropriate editor and source() 
your function rather than using the fix() function.

Uwe Ligges





 Thanks.
 
 Levent TERLEMEZ.
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] environment

2006-04-26 Thread Gabor Grothendieck
Also, if you don;t need to create child objects which override .x,
and I don't think you do here, p could be further simplified to
this (only the print statement has been changed):

p - proto(.x = 2, g = function(.) { print(.x); .$.x - 3 })


On 4/26/06, Gabor Grothendieck [EMAIL PROTECTED] wrote:
 A third possibility is to using the proto package and define
 a proto object (an environment with special meaning for $)
 containing the two components .x and g like this:

 library(proto)
 p - proto(.x = 2, g = function(.) { print(.$.x); .$.x - 3 })
 p$.x  # 2
 print(p$g())  # 2, 3
 p$.x # 3

 or you can write the print statement as with(., print(.x))

 On 26 Apr 2006 11:02:58 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote:
  Romain Francois [EMAIL PROTECTED] writes:
 
   Hi,
  
   Consider the code :
  
   g - function(){
 print(.x)
.x - 3
   }
  
   f - function(){
 environment(g) - environment()
 .x - 2
 g()
 .x
   }
  
 f()
   [1] 2
   [1] 2
  
  
   I would like f() to return 3. How can I do that ? Am I completely out of
   place ?
   Doing that, I want to avoid to pass .x as a parameter in f, because in
   real life .x is pretty big and g() is called over and over in a loop.
 
  If you want to assign into the environment of g, you'll need - ,
  otherwise you  assign to a local variable.
 
  Another possibility involves assign(..., parent.frame())

 And a third possibility is:

 library(proto)


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


Re: [R] Is there a way....

2006-04-26 Thread Pfaff, Bernhard Dr.
Hello Levent,

there has recently been a thread on the ESS list by using setnu in EMACS:

https://stat.ethz.ch/pipermail/ess-help/2006-April/003450.html 


Bernhard

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Uwe Ligges
Gesendet: Mittwoch, 26. April 2006 13:38
An: Levent TERLEMEZ
Cc: r-help@stat.math.ethz.ch
Betreff: Re: [R] Is there a way

Levent TERLEMEZ wrote:

 Hello,
 
 I would like to get rid of counting lines in fix() when i made a 
 mistake in coding? Is there an easy way to an line numbers to editor? 

I think the feature you are requesting is not available.
Beside, it is a good idea to use some appropriate editor and source() 
your function rather than using the fix() function.

Uwe Ligges





 Thanks.
 
 Levent TERLEMEZ.
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
*
Confidentiality Note: The information contained in this mess...{{dropped}}

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


Re: [R] Is there a way....

2006-04-26 Thread François Pinard
[Levent TERLEMEZ]

I would like to get rid of counting lines in fix() when i made 
a mistake in coding? Is there an easy way to an line numbers to editor?

You may configure R to use the editor you want, the way you want.  For 
example, if you want fix() to start Vim in graphical mode, highlighting 
file contents using R syntax, and numbering source lines, you might use
the following R command:

options(editor = gvim -c \set nu\ -c \set ft=r\)

Of course, how to do this much depends on each editor.  Some simpler 
editors may not have options for displaying the line number on each 
line.  Yet, most keep the line counter for the cursor position updated 
in some mode or status bar, so if nothing better, you can learn to 
position the cursor while keeping an eye on that. :-)

Once you find the proper incantation for your editor, and if you always 
want it activated, save the R command within your ~/.Rprofile file.


P.S. - By the way, much congratulations and thanks to the R Core team 
for the recent publication of R 2.3.0.

-- 
François Pinard   http://pinard.progiciels-bpi.ca

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


[R] The beautiful math plot

2006-04-26 Thread Daniel Yang
Dear R-help,

How can I replicate the beautiful math plot found in the right-hand side of 
http://www.r-project.org/screenshots/desktop.jpg? I tried the following code 
but didn't obtain something as beautiful.

r - seq(-10, 10, len=100)
y - cos(r^2)*exp(-r/6)
par(pty=s)
plot(r,y,type=l)

Thanks in advance!
Yung-jui Yang
[[alternative HTML version deleted]]

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


[R] The beautiful math plot

2006-04-26 Thread Daniel Yang
Dear R-help,

How can I replicate the beautiful math plot found in the right-hand side of 
http://www.r-project.org/screenshots/desktop.jpg? I tried the following code 
but didn't obtain something as beautiful.

r - seq(-10, 10, len=100)
y - cos(r^2)*exp(-r/6)
par(pty=s)
plot(r,y,type=l)



Thanks in advance!
Yung-jui Yang
[[alternative HTML version deleted]]

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


Re: [R] The beautiful math plot

2006-04-26 Thread Gesmann, Markus
See:
?image


Markus Gesmann
FPMA
Lloyd's Market Analysis
Lloyd's * One Lime Street * London * EC3M 7HA
Telephone +44 (0)20 7327 6472
Facsimile +44 (0)20 7327 5718
http://www.lloyds.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Daniel Yang
Sent: 26 April 2006 13:39
To: R-help@stat.math.ethz.ch
Subject: [R] The beautiful math plot


Dear R-help,

How can I replicate the beautiful math plot found in the right-hand side
of http://www.r-project.org/screenshots/desktop.jpg? I tried the
following code but didn't obtain something as beautiful.

r - seq(-10, 10, len=100)
y - cos(r^2)*exp(-r/6)
par(pty=s)
plot(r,y,type=l)



Thanks in advance!
Yung-jui Yang
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
**
The information in this E-Mail and in any attachments is CON...{{dropped}}

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


[R] About regression and plot

2006-04-26 Thread Daniel Yang
Dear R-help,

This is my first R day.  I want to ask some more beginner's questions.

Q1. How can I obtain the covariance matrix for parameter estimates of a 
multiple regression?  I checked ?lm but didn't get the information.

Q2. How can I see the old graphs in the graph window?

Q3. Can R plot animated graph?  For example, I want to see the dynamic change 
of a 2D graph during a time period.

Thanks in advance!
Yung-jui Yang
[[alternative HTML version deleted]]

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


[R] About regression and plot

2006-04-26 Thread Daniel Yang
--- I changed to format to text instead of html ---

Dear R-help,

This is my first R day.  I want to ask some more beginner's questions.

Q1. How can I obtain the covariance matrix for parameter estimates of a
multiple regression?  I checked ?lm but didn't get the information.

Q2. How can I see the old graphs in the graph window?

Q3. Can R plot animated graph?  For example, I want to see the dynamic
change of a 2D graph during a time period.

Thanks in advance!
Yung-jui Yang

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

Re: [R] About regression and plot

2006-04-26 Thread Romain Francois
Le 26.04.2006 15:16, Daniel Yang a écrit :
 Dear R-help,

 This is my first R day.  I want to ask some more beginner's questions.

 Q1. How can I obtain the covariance matrix for parameter estimates of a 
 multiple regression?  I checked ?lm but didn't get the information.

 Q2. How can I see the old graphs in the graph window?

 Q3. Can R plot animated graph?  For example, I want to see the dynamic change 
 of a 2D graph during a time period.

 Thanks in advance!
 Yung-jui Yang
   
Welcome here,

You might want to learn R a few days, read the docs, etc .. and then 
come back with questions.
That's how you will get the most of R.

R2 :
you can't, but you can open more than one graph at a time, with 
?windows, or ?x11 or send a graphic to a file : ?pdf, ?png, ...
Or you reexecute the commands

R3 :
For a live animation :
x - rnorm(100)
for(i in 1:100){
  plot(1:i, x[1:i], xlim=c(0,100), ylim=range(x), type=l)
  Sys.sleep(.1)
}

You may want to save each graphic in a file and then build an animation 
using convert (from ImageMagick) or whatever tools you have.

In R :

png('gr_%04d.png', width=600, height=400)
x - rnorm(100)
for(i in 1:100){
  plot(1:i, x[1:i], xlim=c(0,100), ylim=range(x), type=l)
}
dev.off()

 From a shell :
$ convert *.png out.gif

See also :
http://pinard.progiciels-bpi.ca/plaisirs/animations/index.html
http://dirk.eddelbuettel.com/code/rquantlib-rgl.html

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

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


Re: [R] About regression and plot

2006-04-26 Thread Gabor Grothendieck
On 4/26/06, Daniel Yang [EMAIL PROTECTED] wrote:
 --- I changed to format to text instead of html ---

 Dear R-help,

 This is my first R day.  I want to ask some more beginner's questions.

Read the posting guide at the bottom of each post to r-help.


 Q1. How can I obtain the covariance matrix for parameter estimates of a
 multiple regression?  I checked ?lm but didn't get the information.


?vcov

 Q2. How can I see the old graphs in the graph window?

Assuming you are using Windows, create a plot, e.g. plot(1),
change focus to the plot, i.e. left click it, and choose Recording
from the History menu.  From that point on in the session (or
until you turn it off), it will record your plots and you can change
focus to the plot window and use PageUp and PageDn keys to
move through them.


 Q3. Can R plot animated graph?  For example, I want to see the dynamic
 change of a 2D graph during a time period.

RSiteSearch(animation)

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


Re: [R] nls and factor

2006-04-26 Thread Christian Ritz

Hi Manuel,

an alternative to the approach pointed out by Prof. Ripley is to use
the package 'drc' which allows one or more parameters in a non-linear
regression model to depend on a factor.  

You will need the latest version available at www.bioassay.dk (an older
version is available on CRAN).


Bconc - runif(30,0.1,10)
Aconc - runif(30,0.1,10)
At - runif(30,1,30)
Bt - runif(30,1,30)

BKm - 1
AKm - 0
EBoth - -0.41

yB - 100*exp(EBoth*Bt)*Bconc/(BKm+Bconc)+rnorm(30,0,1)
yA - 75*exp(EBoth*At)*Aconc/(AKm+Aconc)+rnorm(30,0,1)


## Constructing the dataset
tvalues - c(At,  Bt)
conc - c(Aconc, Bconc)
yfactor - factor(rep(c(A, B), c(30, 30)))
y - c(yA, yB)


## Defining the non-linear function
twodimMM - function()
{
fct - function(x, parm)
{
parm[, 1]*exp(parm[, 2]*x[, 1])*x[, 2]/(parm[, 3] + x[, 2])
}

ssfct - function(dataset)  # a very simple self starter function
{
return(c(90, -0.5, 0.8))
}

names - c(lev, Ev, km)  # parameter names

return(list(fct=fct, ssfct=ssfct, names=names))
}


library(drc)

model1 - multdrc(y~cbind(tvalues,conc), yfactor, fct=twodimMM())
summary(model1)


## Collapsing the Ev parameters into a single parameter
model2 - multdrc(y~cbind(tvalues,conc), yfactor,
collapse=data.frame(yfactor,1,yfactor), fct=twodimMM())

anova(model2, model1)  # model reduction is insignificant
summary(model2)



Christian

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


Re: [R] Running R on Windows 2000 Terminal Services

2006-04-26 Thread Duncan Murdoch
Barry Rowlingson wrote:
 Gavin Simpson wrote:
 
Dear list,

My employer uses a Windows 2000 Terminal Server-based system for its
college-wide managed computer service - computers connect directly to
the WTS servers for their sessions, using a Citrix ICA client. When I
asked them to install R (Windows) on an older version of this service
the IT guys installed it but pulled it for performance issues. I am
trying to get them to try again but receiving little encouragement from
them.
 
 
   'performance issues'? Well, if you have 100 students running MCMC 
 simulations on one Windows 2000 TS box then you may well have 
 'performance issues'!
 
   Perhaps the TS service isn't intended for people to do real computer 
 work on, but is just for Office apps. Then you come along and want your 
 students to do serious number crunching. At that point the MS Word 
 writers experience what we used to call 'lag'.
 
 
Does anyone on the list have experience of a similar set-up? If you do,
I could use that as part of my argument to invest some time in sorting
these issues out. I really want to get the Windows version of R
installed for teaching because at the moment I subject my students to
the rather hostile world of an archaic UNIX session to run R - for them
at least.
 
 
   We have a couple of labs that are similar - we use Wyse Thin Client 
 Xterminals which boot Thinstation Linux from a server and then connect 
 to Windows 2003 TS machines using RDP or Ubuntu Linux boxes using XDMCP. 
 We dont use Citrix ICA.
 
   'Performance issues' will depend very much on what you are doing. As a 
 quick benchmark, last term we had 24 users in a lab all running Windows 
 and running Matlab, Firefox, that kind of stuff. One dual 2.6GHz Xeon 
 Dell with 4G Ram never went above 60% CPU usage. And we had another 
 three similar Dells sitting idle waiting for installation. Sessions with 
 R run regularly in these labs and we've never had 'performance issues'.

Back in September there was some issue with your setup, but I forget the 
details.  Do you remember?  Is it something we ended up working around, 
or did the 2.2 release fix it?

Duncan
 
   So possibly your IT support are stalling. Do they regularly say Have 
 you tried switching it off and on again? in response to a support query 
 [1]?
 
 Barry
 
 [1] Catchphrase of the tech support guys in comedy series 'The IT Crowd'
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] Generalized linear mixed models

2006-04-26 Thread mike waters
Peter,

The types of model you are looking to fit are *nonlinear* models. In fact,
to be more precise, they are examples of nonlinear ordinal regression
models. Check out the nordr package in R. a link to documentation is:

http://rss.acs.unt.edu/Rdoc/library/gnlm/html/nordr.html 

Regards,

Mike

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Peter Tait
Sent: 26 April 2006 03:28
To: r-help@stat.math.ethz.ch
Subject: [R] Generalized linear mixed models

Hi,

I would like to fit a generalized linear mixed model (glmm) with a 3 level
response.

My data is from a longitudinal study with multiple observations/patient and
multiple patients / country.

Is there an R package that will fit a proportional odds, continuation ratio,
or adjacent categories glmm?

Thanks
Peter

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

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


Re: [R] www.r-project.org

2006-04-26 Thread Duncan Murdoch
Romain Francois wrote:
 Dear R users and developpers,
 
 My question is adressed to both of you, so I choose R-help to post it.
 
 Are there any plans to jazz up the main R website : http://www.r-project.org
 The look it have now is the same for a long time and kind of sad 
 compared to other statistical package's website. Of course, the 
 comparison is not fair, since companies are paying web designers to draw 
 lollipop websites ...

There have been various suggestions along these lines (check the 
archives), but there are a number of constraints that make the problem 
difficult:

  - there are two web sites, www.r-project.org and cran.r-project.org 
with different needs.  In particular, CRAN must be very low tech because 
it is mirrored on very diverse sites (including local copies, e.g. on a 
CDROM).

  - There are a lot of busy people who need to edit these pages 
occasionally, so a stable, standard, simple setup is extremely 
desirable.  That means simple HTML to be edited in a text editor, no 
special CMS.

These requirements are quite hard to meet, so expect changes to the web 
sites to be very time consuming, and possibly rejected en masse in the end.

Duncan Murdoch

 
 My first idea was to organize some kind of web designing contest.
 But, I had a small talk with Friedrich Leisch about that, who said that 
 I shouldn't expect too many competitors.
 So, what about creating a small team, create a home page project and 
 then propose it to the core team.
 It goes without saying it : The core team has the final word.
 
 What do you think ? Who would like to play ?
 
 Romain


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


Re: [R] www.r-project.org

2006-04-26 Thread Jacques Veslot
what about improving the Links page, with for instance a list of links 
- such as thoses in task views - grouped by theme, instead of modifying 
r-project site ?



-- 
---
[EMAIL PROTECTED]
CNRS UMR 8090 - http://www-good.ibl.fr
Génomique et physiologie moléculaire des maladies métaboliques
I.B.L 2eme etage - 1 rue du Pr Calmette, B.P.245, 59019 Lille Cedex
Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31

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


Re: [R] [Rd] R 2.3.0: Use of NULL as an environment is deprecated

2006-04-26 Thread Antonio, Fabio Di Narzo
2006/4/26, Uwe Ligges [EMAIL PROTECTED]:

 Pfaff, Bernhard Dr. wrote:
 BernPf == Pfaff, Bernhard Dr [EMAIL PROTECTED]
 on Wed, 26 Apr 2006 08:28:34 +0100 writes:
 
 
  BernPf Dear Andy, Uwe and remaining list subscribers,
  BernPf now, coming closer to the evil's root. Yesterday, I source
  compiled on a
  BernPf Linux box at home and the result is the same behaviour as
  pointed out
  BernPf below. This is regardless of the package version of 'urca'.
  Aside of
  BernPf 'urca', other packages that have Imports/Depends entries in
  the
  BernPf DESCRIPTION to packages that are shipped within the standard
  library of
  BernPf R show the warning too, e.g. fMultivar, VLMC, to name but a
  few.
  BernPf I do have set on both OS, i.e. Windows and Linux, a second
  library tree
  BernPf in Renviron.site with R-LIBS. If I comment this out and do a
  reinstall
  BernPf of the packages, i.e. the packages are now installed in the
  standard
  BernPf library, the warning does not show up any longer. Has
  something changed
  BernPf with regard to additional libraries that slipped my notice
  by upgrading
  BernPf to version 2.3.0?
 
  I don't think so.
  I ***NEVER*** install a package into the standard library.
  We have all CRAN packages in a different library,
  (and Bioconductor too) and I typically use about 6 library (paths),
  and I don't have your problem.
 
  I only get your warning if I get a version of a package that was
  installed previous to 2.3.0 (or it's alpha / beta / rc ) versions.
 
  BernPf Is it possible that during startup the environment is
  handeld/passed
  BernPf differently for standard and additional libraries? Would
  this odd
  BernPf behaviour qualify as a bug?
 
  If it was general, yes, but I think it's not.
 
 
  Hello Martin and all others involved in this thread,
 
  thank you very much for your time and patience. After having updated the
  packages in the standard library, too, the warning message does indeed
  not show up any longer by issuing the command library(urca) and similar
  with other packages. Just out of curiosity, I wonder what has changed in
  these packages (i.e. nlme, foreign, cluster and VR got updated) from
  downloading the '.exe' or the tarball in the official 2.3.0 release up
  to now?


 For sure you got (or still had in front of your R_LIBS path) packages
 that were compiled for R  2.3.0! That's it. Very simple.

 Uwe Ligges


  Best,
  Bernhard
  *
  Confidentiality Note: The information contained in this message,
  and any attachments, may contain confidential and/or privileged
  material. It is intended solely for the person(s) or entity to
  which it is addressed. Any review, retransmission, dissemination,
  or taking of any action in reliance upon this information by
  persons or entities other than the intended recipient(s) is
  prohibited. If you received this in error, please contact the
  sender and delete the material from any computer.
  *

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel


I'm happy the problem was solved. I had the same problem with a package of
mines (not on CRAN). The problem was an imported package that was compiled
for R-2.2.0.
Tnx all for solving my problem just before posting it on the list:D

Antonio, Fabio Di Narzo.

[[alternative HTML version deleted]]

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


[R] installation problem with 2.3.0

2006-04-26 Thread Eric Evans
Hello,

I'm in the process of trying to upgrade our R software from version 2.2.3 
to 2.3.0 on our Sun workstations.  In the installation process I'm 
encountering some puzzling errors whe I do the 'make install.'  After 
installing the doc files successfully the installation process crashes 
while trying to install the etc files, with the following messages:

make[1]: Leaving directory `/usr/local/R-2.3.0/doc'
make[1]: Entering directory `/usr/local/R-2.3.0/etc'
installing etc ...
/bin/bash: -c: line 1: syntax error near unexpected token `;'
/bin/bash: -c: line 1: `for f in ; do  ../tools/install-sh -c -m 644 ${f} 
/usr/local/lib/R/etc;  done'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/usr/local/R-2.3.0/etc'
make: *** [install] Error 1

I've been studying the Makefile trying to figure out what would cause such 
an error but so far I haven't been able to figure it out.  We are using 
Solaris 8 with GNU make version 3.79.1.  I've also tried using the Sun 
default make (i.e. /usr/ccs/bin/make) but I get the same result.  I've 
installed R (previous versions) many times on Solaris previously without 
any problems and I'm puzzled as to why we're encountering this problem in 
2.3.0.  Does anybody have any suggestions for things I can try to remedy 
this problem?

Thanks very much,
Eric

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


Re: [R] lwd - Windows

2006-04-26 Thread Francisco J. Zagmutt
Dear Prof Brian Ripley

Thanks for replying to my question.  I am sorry but it is still not clear to 
me if there is a way to handle an intermediate line width.  In my windows 
system when I create a figure with 4 plots par(mfrow=c(2,2),lwd=1) the lines 
look a bit too thin and using lwd=2 makes them look a bit too thick, and if 
I use 1.5 it makes no difference. i.e

par(mfrow=c(2,2))
plot(sin,lwd=1)#Too thin
plot(sin,lwd=1.5)#Same as lwd=1
plot(sin,lwd=1.99)#Same as lwd=1
plot(sin,lwd=2)#Too thick


Regards

Francisco


From: Prof Brian Ripley [EMAIL PROTECTED]
To: Francisco J. Zagmutt [EMAIL PROTECTED]
CC: R-help@stat.math.ethz.ch
Subject: Re: [R] lwd - Windows
Date: Wed, 26 Apr 2006 11:34:05 +0100 (BST)

On Wed, 26 Apr 2006, Francisco J. Zagmutt wrote:

Dear all

Is there a way or trick in windows to plot a line width that is not an
integer i.e 1.5?
I am aware that the documentation for window devices states Line widths 
as
controlled by par(lwd=) are in multiples of the pixel size, and multiples 

1 are silently converted to 1 but I was wondering if there is a 
workaround
this.

That's not what it says in R 2.3.0 (nor in my copy of 2.2.1)!  ?windows 
says

  Line widths as controlled by 'par(lwd=)' are in multiples of
  1/96inch.  Multiples less than 1 are allowed, down to one pixel
  width.

Also, IMHO the documentation for lwd in par may need some clarification
since it states:
The line width, a positive number, defaulting to 1. The interpretation is
device-specific, and some devices do not implement line widths less than
one.  Perhaps it would be useful for the users to describe the behavior 
for
the most important devices, and also to state that the number is an 
integer
(at least for windows) and not just a positive number?

False premise.  Please don't ask for the documentation to be changed to 
your personal misreading of it.

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

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


Re: [R] environment

2006-04-26 Thread Thomas Lumley
On Wed, 26 Apr 2006, Romain Francois wrote:

 Hi,

 Consider the code :

 g - function(){
  print(.x)
 .x - 3
 }

 f - function(){
  environment(g) - environment()
  .x - 2
  g()
  .x
 }

  f()
 [1] 2
 [1] 2


 I would like f() to return 3. How can I do that ? Am I completely out of
 place ?
 Doing that, I want to avoid to pass .x as a parameter in f, because in
 real life .x is pretty big and g() is called over and over in a loop.


As long as .x doesn't get modified it probably won't be copied, so this is 
unlikely to make any difference to memory use even if you work out how to 
do it.

-thomas

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


[R] cdf of weibull distribution

2006-04-26 Thread Sachin J
Hi,
   
  I have a data set which is assumed to follow weibull distr'. How can I find 
of cdf for this data. For example, for normal data I used (package - lmomco)
   
  cdfnor(15,parnor(lmom.ub(c(df$V1 
   
  Also, lmomco package does not have functions for finding cdf for some of the 
distributions like lognormal. Is there any other package, which can handle 
these distributions?
   
  Thanx in advance
  Sachin
   
   


-

[[alternative HTML version deleted]]

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


Re: [R] cdf of weibull distribution

2006-04-26 Thread Peter Dalgaard
Sachin J [EMAIL PROTECTED] writes:

 Hi,

   I have a data set which is assumed to follow weibull distr'. How can I find 
 of cdf for this data. For example, for normal data I used (package - lmomco)

   cdfnor(15,parnor(lmom.ub(c(df$V1 

   Also, lmomco package does not have functions for finding cdf for some of 
 the distributions like lognormal. Is there any other package, which can 
 handle these distributions?


What's wrong with pweibull, plnorm, etc.? Or pnorm for that matter

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

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


Re: [R] [O/T] undergrads and R

2006-04-26 Thread John Fox
Dear Ales,

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Ales Ziberna
 Sent: Wednesday, April 26, 2006 5:21 AM
 To: John Fox
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] [O/T] undergrads and R
 
 Dear John Fox,
 
 thank you for your reply. I appologize for not finding the 
 sort.names 
 option myself.
 
 As for the option of choosing several variables at a time, I 
 would like to see this possibility everywhere where possible. 
 Let me give a few
 examples:
 1. Calculating the mean of several variables (for example, I 
 often want to compute the mean of a set of variables 
 measuring the same concept) 2. Recoding a set of variables 
 with the same rule

These would be useful and easy to do (though for 2. I'd have to provide a
way to name the new variables). BTW, it would help to have a complete set of
suggestions: I'd probably not have thought of 2. (You could send me your
suggestions off-list.) I intend to work on a new version of the Rcmdr this
summer, and, although I can't promise to incorporate all suggestions, I'll
certainly consider them carefully.

 3. Transforming a set of variables from 
 factor to numeric or vice verse. 

This could get a bit convoluted, since the numeric-to-factor dialog asks you
(optionally) to specify level names and rename the factor. I don't currently
provide for converting factors to numeric, and would worry about misuse
(though you can do this as a recode).

 (This would be especially useful when using data read from 
 SPSS, as all variables with labels are converted to factors. 
 These are often ordinal variables measured on 5 or more point 
 scale, which are often as close as you can get in social 
 sciences to interval variables. However for most of the 
 analysis (like regression, factor analysis ...), they have to 
 be treated as numeric.)
 

Couldn't you do this with a redesigned Recode dialog?

 As to how this should be done, I agree that a check-box to 
 select all numeric variables might be to no thingking 
 approach. I would just like to have an option to select 
 several variables, the same way as is done now in for example 
 factor analysis.
 
 I do understand that you want the students to think what they 
 are doing. 
 However I would like to present them the R commander as an 
 alternative to SPSS also for doing their assignments for 
 other courses and I do not believe they would be willing to 
 make the change if they have to do so much clicks just to 
 compute averages for let say 20 variables.
 
 I personally think that it is enough that the software does 
 not allow you (or the students) to do wrong things (like 
 computing a mean of the factor), especially not without 
 thinking about it.
 
 Another option I would like are:
 1. An option to save (or actually to not delete) the results 
 of let say factor analysis, so I could use them for further analysis.

What would you like to save? Currently, you can save factor scores. The R
Commander is designed around an active data set and an active statistical
model. I'm open to incorporating other data structures, but suspect that in
most instances that would lead me outside the boundaries of the R Commander
or require a major redesign. Anyway, it's hard to tell without some more
information about what you'd like.

 2. Currently, if I create a factor via command line, it is 
 not recognized my the menus (for example, I can not do a 
 frequency table). 
   If I select a different data frame and then again the 
 previous one as the active data frame, the new factor is now 
 recognized in the menus. So I would also be satisfied by a 
 refresh option for the active data frame.
 

If I follow this properly, then it doesn't seem to be correct. For example,
if the data frame Data is the Rcmdr active data set then the command

Data$new.variable - ...

executed in the R console or in the Rcmdr Command window will immediately
make the variable new.variable accessible in the Rcmdr.

Regards,
 John

 That would be all for now. Thanks again for the reply and for 
 creating Rcmdr in the first place.
 
 Best regards,
 Ales
 
 
 John Fox pravi:
  Dear Ales,
  
  -Original Message-
  From: Ales Ziberna [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, April 25, 2006 1:15 AM
  To: Richard M. Heiberger
  Cc: r-help@stat.math.ethz.ch; John Fox
  Subject: Re: [R] [O/T] undergrads and R
 
  I will be also using R commander with undergrad students, who 
  actually already have some experience with R, however they 
 have been 
  using it more as programing language than a statistical tool and I 
  want to get them more familiar with this aspect of R.
 
  First, when I had my first look at R commander, I really liked it, 
  however, when I did a little more experiments, I found it quite 
  frustrating at times, especially by the fact that when computing a 
  certain statistics (for example mean), you can select only one 
  variable at the time. Are there any plans to change this, 
 

[R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Albert Sorribas
This is a generic request concerning were to look for finding
appropriate information on a precise procedure in R.
I’m using R for teaching introductory statistics and my students are
learning how to deal with it. However, I find it difficult to locate
some of the procedures. For instance, for basic crosstabulation, it is
obvious that basic functions as table, ftable, and prop.table can be
used. But there is a CrossTable function that is very useful. This is
hidden in gmodels and gregmisc, as far as I’ve been able to explore the
packages. However, there is no way (unless I sit down to r-help for
hours) to be sure if there is some other place in which a very useful
function is hidden for table manipulation (for instance controlling for
other variables). This is only an example. But there are many more. Were
to look for CI for proportions? I can find it but it is not easy.

I understand R is more appropriate for difficult statistical procedures
(glm and similar), BUT students need to start somewhere….

My specific claim is about the need for a sort of guide in which the
different procedures could be classified (and some redundancies could be
deleted…..by the way). Is there something similar around? Any project
working on this? Any clue for?

If not, I would suggest starting some kind of easy reference based on
the problem to solve. This could indicate were to look for. Last day I
find in package vcd that a function exist for testing the
goodness-of-fit of a sample to binomial and other distributions….but
this was VERY difficult to locate. 

Any way, as usual, any indication will be very useful (spaecially for my
students!!!)



Albert Sorribas
Professor of Statistics and Operational Research
Departament de Ciències Mèdiques Bàsiques
Universitat de Lleida
Montserrat Roig 2
25008-Lleida (Espanya)
web.udl.es/Biomath/Group
 


[[alternative HTML version deleted]]

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

Re: [R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Dimitris Rizopoulos
you may find RSiteSearch() and help.search() functions useful for this 
purpose, considering usually different key words for the same topic.

Best,
Dimitris


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

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


- Original Message - 
From: Albert Sorribas [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Wednesday, April 26, 2006 5:31 PM
Subject: [R] Were to find appropriate functions for a given task in R


This is a generic request concerning were to look for finding
appropriate information on a precise procedure in R.
I'm using R for teaching introductory statistics and my students are
learning how to deal with it. However, I find it difficult to locate
some of the procedures. For instance, for basic crosstabulation, it is
obvious that basic functions as table, ftable, and prop.table can be
used. But there is a CrossTable function that is very useful. This is
hidden in gmodels and gregmisc, as far as I've been able to explore 
the
packages. However, there is no way (unless I sit down to r-help for
hours) to be sure if there is some other place in which a very useful
function is hidden for table manipulation (for instance controlling 
for
other variables). This is only an example. But there are many more. 
Were
to look for CI for proportions? I can find it but it is not easy.

I understand R is more appropriate for difficult statistical 
procedures
(glm and similar), BUT students need to start somewhere..

My specific claim is about the need for a sort of guide in which the
different procedures could be classified (and some redundancies could 
be
deleted...by the way). Is there something similar around? Any project
working on this? Any clue for?

If not, I would suggest starting some kind of easy reference based on
the problem to solve. This could indicate were to look for. Last day I
find in package vcd that a function exist for testing the
goodness-of-fit of a sample to binomial and other distributions..but
this was VERY difficult to locate.

Any way, as usual, any indication will be very useful (spaecially for 
my
students!!!)



Albert Sorribas
Professor of Statistics and Operational Research
Departament de Ciències Mèdiques Bàsiques
Universitat de Lleida
Montserrat Roig 2
25008-Lleida (Espanya)
web.udl.es/Biomath/Group



[[alternative HTML version deleted]]







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


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

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


Re: [R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Berton Gunter
1. Check out the R reference card at
http://www.rpad.org/Rpad/Rpad-refcard.pdf . There are also several others
available from the CRAN website.

2. Check out TINN-R, a Windows text/R code editor that integrates the above
and provides function tips inline to give the syntax of many R functions.

3. ?help.search

4. ?RSiteSearch (or search CRAN directly using Jon Baron's search engine).

These do not eliminate the problem, but hopefully mitigate it. Given that
there are several thousand R functions spread among hundreds of packages at
at least three separate repositories (CRAN, BioConductor, and Omegahat),
it's clearly a nontrivial issue. But that's why Google and other search
services are multibillion dollar companies.

HTH

Cheers,
Bert
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Albert Sorribas
 Sent: Wednesday, April 26, 2006 8:32 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] Were to find appropriate functions for a given task in R
 
 This is a generic request concerning were to look for finding
 appropriate information on a precise procedure in R.
 Im using R for teaching introductory statistics and my students are
 learning how to deal with it. However, I find it difficult to locate
 some of the procedures. For instance, for basic crosstabulation, it is
 obvious that basic functions as table, ftable, and prop.table can be
 used. But there is a CrossTable function that is very useful. This is
 hidden in gmodels and gregmisc, as far as Ive been able to 
 explore the
 packages. However, there is no way (unless I sit down to r-help for
 hours) to be sure if there is some other place in which a very useful
 function is hidden for table manipulation (for instance 
 controlling for
 other variables). This is only an example. But there are many 
 more. Were
 to look for CI for proportions? I can find it but it is not easy.
 
 I understand R is more appropriate for difficult statistical 
 procedures
 (glm and similar), BUT students need to start somewhere.
 
 My specific claim is about the need for a sort of guide in which the
 different procedures could be classified (and some 
 redundancies could be
 deleted..by the way). Is there something similar around? Any project
 working on this? Any clue for?
 
 If not, I would suggest starting some kind of easy reference based on
 the problem to solve. This could indicate were to look for. Last day I
 find in package vcd that a function exist for testing the
 goodness-of-fit of a sample to binomial and other distributions.but
 this was VERY difficult to locate. 
 
 Any way, as usual, any indication will be very useful 
 (spaecially for my
 students!!!)
 
 
 
 Albert Sorribas
 Professor of Statistics and Operational Research
 Departament de Cihncies Mhdiques B`siques
 Universitat de Lleida
 Montserrat Roig 2
 25008-Lleida (Espanya)
 web.udl.es/Biomath/Group
  
 
 
   [[alternative HTML version deleted]]
 


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


Re: [R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Gabor Grothendieck
There is a reference sheet here:
   http://www.rpad.org/Rpad/R-refcard.pdf
a function finder here:
   http://biostat.mc.vanderbilt.edu/s/finder/find.html
and task views here:
   http://cran.r-project.org/src/contrib/Views/

Also use of RSiteSearch and help.search from within R
can be helpful.

On 4/26/06, Albert Sorribas [EMAIL PROTECTED] wrote:
 This is a generic request concerning were to look for finding
 appropriate information on a precise procedure in R.
 I'm using R for teaching introductory statistics and my students are
 learning how to deal with it. However, I find it difficult to locate
 some of the procedures. For instance, for basic crosstabulation, it is
 obvious that basic functions as table, ftable, and prop.table can be
 used. But there is a CrossTable function that is very useful. This is
 hidden in gmodels and gregmisc, as far as I've been able to explore the
 packages. However, there is no way (unless I sit down to r-help for
 hours) to be sure if there is some other place in which a very useful
 function is hidden for table manipulation (for instance controlling for
 other variables). This is only an example. But there are many more. Were
 to look for CI for proportions? I can find it but it is not easy.

 I understand R is more appropriate for difficult statistical procedures
 (glm and similar), BUT students need to start somewhere….

 My specific claim is about the need for a sort of guide in which the
 different procedures could be classified (and some redundancies could be
 deleted…..by the way). Is there something similar around? Any project
 working on this? Any clue for?

 If not, I would suggest starting some kind of easy reference based on
 the problem to solve. This could indicate were to look for. Last day I
 find in package vcd that a function exist for testing the
 goodness-of-fit of a sample to binomial and other distributions….but
 this was VERY difficult to locate.

 Any way, as usual, any indication will be very useful (spaecially for my
 students!!!)



 Albert Sorribas
 Professor of Statistics and Operational Research
 Departament de Ciències Mèdiques Bàsiques
 Universitat de Lleida
 Montserrat Roig 2
 25008-Lleida (Espanya)
 web.udl.es/Biomath/Group



[[alternative HTML version deleted]]



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



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


[R] garchFit from fSeries

2006-04-26 Thread Erin Hodgess
Dear R People:

I'm trying to use the garchFit function from the library(fSeries)

However, R freezes every time that I use it.

Is anyone else having this problem, please?

Thanks in advance!

R Version 2.2.1 Windows.

Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: [EMAIL PROTECTED]

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


Re: [R] www.r-project.org

2006-04-26 Thread Gabor Grothendieck
Maybe a separate web site that shows R off or maybe just
a pointer to the R Graph Gallery.

On 4/26/06, Duncan Murdoch [EMAIL PROTECTED] wrote:
 Romain Francois wrote:
  Dear R users and developpers,
 
  My question is adressed to both of you, so I choose R-help to post it.
 
  Are there any plans to jazz up the main R website : http://www.r-project.org
  The look it have now is the same for a long time and kind of sad
  compared to other statistical package's website. Of course, the
  comparison is not fair, since companies are paying web designers to draw
  lollipop websites ...

 There have been various suggestions along these lines (check the
 archives), but there are a number of constraints that make the problem
 difficult:

  - there are two web sites, www.r-project.org and cran.r-project.org
 with different needs.  In particular, CRAN must be very low tech because
 it is mirrored on very diverse sites (including local copies, e.g. on a
 CDROM).

  - There are a lot of busy people who need to edit these pages
 occasionally, so a stable, standard, simple setup is extremely
 desirable.  That means simple HTML to be edited in a text editor, no
 special CMS.

 These requirements are quite hard to meet, so expect changes to the web
 sites to be very time consuming, and possibly rejected en masse in the end.

 Duncan Murdoch

 
  My first idea was to organize some kind of web designing contest.
  But, I had a small talk with Friedrich Leisch about that, who said that
  I shouldn't expect too many competitors.
  So, what about creating a small team, create a home page project and
  then propose it to the core team.
  It goes without saying it : The core team has the final word.
 
  What do you think ? Who would like to play ?
 
  Romain
 

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


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


[R] garch in tseries

2006-04-26 Thread Erin Hodgess
Hello again!

Is there a way to include a mean in the garch function in the
library(tseries), please?

I tried include.mean=T in the function statement but it didn't work

thanks in advance!

R Version 2.2.1 Windows
Sincerely,
Erin 
mailto: [EMAIL PROTECTED]

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


[R] stl function

2006-04-26 Thread Andrea Toreti
Hi,
I have a monthly time series with missing values and I would use stl function 
to identify seasonality. 
I tried all settings of na.action but the result is the same:

 stl(tm245,s.window=11, na.action=na.pass)
Error in stl(tm245, s.window = 11, na.action = na.pass) : 
NA/NaN/Inf in foreign function call (arg 1)

Can you help me?

Thanks 

Andrea Toreti
[[alternative HTML version deleted]]

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


Re: [R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Albert Sorribas
Thanks for the indications. All these suggestion will help a lot. The
TINN-R application is impressive.

However, I think something more PROBLEM directed is needed. I agree that
Google and the ?RSiteSearch helps a lot, but yet the explanations (like
this discussion) are not clear enough in many cases. Any way, this is my
impression as a technical user. The R stuff is really good, but it is
difficult to find what you need in many instances. Then, people tend to
define its own functions (I'm doing this too), and a lack of
standardization makes it difficult to keep everything into control.



Albert Sorribas
Professor of Statistics and Operational Research
Departament de Ciències Mèdiques Bàsiques
Universitat de Lleida
Montserrat Roig 2
25008-Lleida (Espanya)
web.udl.es/Biomath/Group
 

-Mensaje original-
De: Gabor Grothendieck [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 26 de abril de 2006 17:47
Para: Albert Sorribas
CC: r-help@stat.math.ethz.ch
Asunto: Re: [R] Were to find appropriate functions for a given task in R

There is a reference sheet here:
   http://www.rpad.org/Rpad/R-refcard.pdf
a function finder here:
   http://biostat.mc.vanderbilt.edu/s/finder/find.html
and task views here:
   http://cran.r-project.org/src/contrib/Views/

Also use of RSiteSearch and help.search from within R
can be helpful.

On 4/26/06, Albert Sorribas [EMAIL PROTECTED] wrote:
 This is a generic request concerning were to look for finding
 appropriate information on a precise procedure in R.
 I'm using R for teaching introductory statistics and my students are
 learning how to deal with it. However, I find it difficult to locate
 some of the procedures. For instance, for basic crosstabulation, it is
 obvious that basic functions as table, ftable, and prop.table can be
 used. But there is a CrossTable function that is very useful. This is
 hidden in gmodels and gregmisc, as far as I've been able to explore
the
 packages. However, there is no way (unless I sit down to r-help for
 hours) to be sure if there is some other place in which a very useful
 function is hidden for table manipulation (for instance controlling
for
 other variables). This is only an example. But there are many more.
Were
 to look for CI for proportions? I can find it but it is not easy.

 I understand R is more appropriate for difficult statistical
procedures
 (glm and similar), BUT students need to start somewhere….

 My specific claim is about the need for a sort of guide in which the
 different procedures could be classified (and some redundancies could
be
 deleted…..by the way). Is there something similar around? Any project
 working on this? Any clue for?

 If not, I would suggest starting some kind of easy reference based on
 the problem to solve. This could indicate were to look for. Last day I
 find in package vcd that a function exist for testing the
 goodness-of-fit of a sample to binomial and other distributions….but
 this was VERY difficult to locate.

 Any way, as usual, any indication will be very useful (spaecially for
my
 students!!!)



 Albert Sorribas
 Professor of Statistics and Operational Research
 Departament de Ciències Mèdiques Bàsiques
 Universitat de Lleida
 Montserrat Roig 2
 25008-Lleida (Espanya)
 web.udl.es/Biomath/Group



[[alternative HTML version deleted]]



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



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


[R] help using tapply

2006-04-26 Thread Dimitri Szerman
Dear R-mates,

# Here's what I am trying to do. I have a dataset like this:

id = c(rep(1,8), rep(2,8))
dur1 - c( 17,18,19,18,24,19,24,24 )
est1 - c( rep(1,5), rep(2,3) )
dur2 - c(1,1,3,4,8,12,13,14)
est2 - rep(1,8)

mydata = data.frame(id,
estat=c(est1, est2),
durat=c(dur1, dur2))


# I want to one have this:

id = c(rep(1,8), rep(2,8))
dur1 - c( 17,18,19,20,28,1,2,3 )
est1 - c( rep(1,5), rep(2,3) )
dur2 - c(1,2,3,4,12,13,14,15)
est2 - rep(1,8)

mydata2 = = data.frame(id,
estat=c(est1, est2),
durat=c(dur1, dur2))


# What is happening here? I have a longitudinal dataset.
# Individuals are observed 8 times, and each time each of them are in a
certain state J (here, J={1,2}).
# Each observation is one unit of time away from the following one, except
observations 4 and 5, which are 8 units of time away from each other.
# So here we have individual 1 migrating from state 1 to state 2 at
observation #6,
# while individual 2 stays in state 1 as long as we can observe her.
# I am interested in the spell (duration) of each state.
# However, the durations are clearly mismesuared, and now I am trying to
give some consistency to the data.
# I am assuming that the first duration is correct. Departing from this, I
wrote the following function:

d - function(dur,est)
{
if ( sum( diff(est) )==0 ) # for those who didn't change state
{
for( i in c(2:4))
dur[i] - dur[i-1] + 1

dur[5] - dur[4] + 8

for( i in c(6:8) )
dur[i] - dur[i-1] + 1
}
if ( sum( diff(est) )!=0 ) # for those who changed state
{
 j = which(diff(est)!=0) + 1# j is when the change occured
 dur[j] = 1

 k0  = which( c(1:8)  j )[-c(1)]
 k1  = which( c(1:8)  j )
 if(length(j)  1)
{
for( i in 1:(length(j)-1) )
k2 = c(1:8)[c(1:8) j[i]  c(1:8) j[i+1]]
k = unique( c(k0,k1,k2) )
}
 k = unique( c(k0,k1) )
 k = k[!k%in%j]
 if(5%in%k)
{
 k = k[k != 5]
 for(i in k[k5])
dur[i] = dur[i-1] + 1

 dur[5] = dur[4] + 8

 for(i in k[k5])
dur[i] = dur[i-1] + 1
} else
  {
for(i in k)
dur[i] = dur[i-1] + 1
  }
}
dur

}

# Now, if a do

d(dur1, est1)
# and
d(dur2,est2)
# I get what I want, except from the fact that I couldn't do this for a
large dataset.
# So I decide to use tapply. But this gives me

new.durat - tapply(mydata$durat, IND=mydata$id, FUN=d,
est=mydata$estat)
mydata$new.durat - unlist(new.durat)

mydata
id   estat durat new.durat
1   1 11717
2   1 11818
3   1 11919
4   1 11820
5   1 12428
6   1 21929
7   1 22430
8   1 22431
9   2 1 1 1
10  2 1 1 2
11  2 1 3 3
12  2 1 4 4
13  2 1 812
14  2 11213
15  2 11314
16  2 11415

# what is not what I want. I can't figure it out why, but when I use tapply,
# the logical expression sum( diff(est) )==0 turns out to be true for both
individuals
# (whereas we know this is true only for individual #2).
# I am sorry for the long message. I will be very grateful for any help with
this problem.

[[alternative HTML version deleted]]

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


Re: [R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Xiaohua Dai
 Hi Albert,

Maybe you can summarize what you find during your teaching and put them on
one website. Everyone gives a piece of firewood, then we can build up a
strong fire.

Thanks
 Xiaohua



On 4/26/06, Albert Sorribas [EMAIL PROTECTED] wrote:

 Thanks for the indications. All these suggestion will help a lot. The
 TINN-R application is impressive.

 However, I think something more PROBLEM directed is needed. I agree that
 Google and the ?RSiteSearch helps a lot, but yet the explanations (like
 this discussion) are not clear enough in many cases. Any way, this is my
 impression as a technical user. The R stuff is really good, but it is
 difficult to find what you need in many instances. Then, people tend to
 define its own functions (I'm doing this too), and a lack of
 standardization makes it difficult to keep everything into control.



 Albert Sorribas
 Professor of Statistics and Operational Research
 Departament de Ciències Mèdiques Bàsiques
 Universitat de Lleida
 Montserrat Roig 2
 25008-Lleida (Espanya)
 web.udl.es/Biomath/Group


 -Mensaje original-
 De: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
 Enviado el: miércoles, 26 de abril de 2006 17:47
 Para: Albert Sorribas
 CC: r-help@stat.math.ethz.ch
 Asunto: Re: [R] Were to find appropriate functions for a given task in R

 There is a reference sheet here:
   http://www.rpad.org/Rpad/R-refcard.pdf
 a function finder here:
   http://biostat.mc.vanderbilt.edu/s/finder/find.html
 and task views here:
   http://cran.r-project.org/src/contrib/Views/

 Also use of RSiteSearch and help.search from within R
 can be helpful.

 On 4/26/06, Albert Sorribas [EMAIL PROTECTED] wrote:
  This is a generic request concerning were to look for finding
  appropriate information on a precise procedure in R.
  I'm using R for teaching introductory statistics and my students are
  learning how to deal with it. However, I find it difficult to locate
  some of the procedures. For instance, for basic crosstabulation, it is
  obvious that basic functions as table, ftable, and prop.table can be
  used. But there is a CrossTable function that is very useful. This is
  hidden in gmodels and gregmisc, as far as I've been able to explore
 the
  packages. However, there is no way (unless I sit down to r-help for
  hours) to be sure if there is some other place in which a very useful
  function is hidden for table manipulation (for instance controlling
 for
  other variables). This is only an example. But there are many more.
 Were
  to look for CI for proportions? I can find it but it is not easy.
 
  I understand R is more appropriate for difficult statistical
 procedures
  (glm and similar), BUT students need to start somewhere….
 
  My specific claim is about the need for a sort of guide in which the
  different procedures could be classified (and some redundancies could
 be
  deleted…..by the way). Is there something similar around? Any project
  working on this? Any clue for?
 
  If not, I would suggest starting some kind of easy reference based on
  the problem to solve. This could indicate were to look for. Last day I
  find in package vcd that a function exist for testing the
  goodness-of-fit of a sample to binomial and other distributions….but
  this was VERY difficult to locate.
 
  Any way, as usual, any indication will be very useful (spaecially for
 my
  students!!!)
 
 
 
  Albert Sorribas
  Professor of Statistics and Operational Research
  Departament de Ciències Mèdiques Bàsiques
  Universitat de Lleida
  Montserrat Roig 2
  25008-Lleida (Espanya)
  web.udl.es/Biomath/Group
 
 
 
 [[alternative HTML version deleted]]
 
 


[[alternative HTML version deleted]]

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

Re: [R] A question about is.interger function

2006-04-26 Thread Michael H. Prager
Not to belabor the point, but if you really need to distinguish integers 
from other numerical constants, you could try something like this:

  x - as.integer(5)
  typeof(x)
[1] integer
  is.integer(x)
[1] TRUE
 


on 4/26/2006 1:20 AM Leon said the following:
 Hi, All
 I am using is.integer function to examine whether an object is an integer or 
 not, but I get such results,

   
 x-3
 is.integer(x)
 
 [1] FALSE

   
 x-3:4
 x
 
 [1] 3 4
   
 is.integer(x)
 
 [1] TRUE

 Seems that the is.integer cannot handle scalers, 

   
 is.integer(5)
 
 [1] FALSE

   
 is.integer(5:6)
 
 [1] TRUE

 Is this a bug in R or I made some mistakes? I am using R 2.2.1 under Windows 
 XP

 Thanks a lot!

 Leon


   [[alternative HTML version deleted]]

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

-- 
Michael Prager, Ph.D.
Southeast Fisheries Science Center
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516
** Opinions expressed are personal, not official.  No
** official endorsement of any product is made or implied.

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


[R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Florian Nigsch
[Please CC me for all replies, since I am not currently subscribed to  
the list.]

Hi all,

I have the following problem/question: Imagine you have a two- 
dimensional plot, and you want to select a number of points, around  
which you could draw a polygon. The points of the polygon are defined  
by clicking in the graphics window (locator()/identify()), all points  
inside the polygon are returned as an object.

Is something like this already implemented?

Thanks a lot in advance,

Florian

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


Re: [R] www.r-project.org

2006-04-26 Thread Anupam Tyagi
Gabor Grothendieck ggrothendieck at gmail.com writes:

 
 Maybe a separate web site that shows R off or maybe just
 a pointer to the R Graph Gallery.

I think the idea of a pointer to the R Graph Gallery is a better one than
changing the current R website. I think that the main R web site should be
accessible to as many users as possible, including those visually impaired. I
hope EmacsSpeaks Statistics (ESS) people will appreciate this suggestion. I do
like nice graphics and eye-candy. The other alternate could be an R-web site
that is simple and easily accessible as simple mark-up text, which can be speech
rendered. Anupam Tyagi.

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


Re: [R] The beautiful math plot

2006-04-26 Thread Anupam Tyagi
Gesmann, Markus Markus.Gesmann at lloyds.com writes:

 
 See:
 ?image

I would like to use this image in a publication. How do I get permission from
the creater of this image? Anupam Tyagi.

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


Re: [R] Linker problem in installing 64-bit R

2006-04-26 Thread Min Shao
It turned out that I do not have the 64-bit readline library installed.
After disabling it using the -without-readline option for ./configure, I
successfully made a 64-bit build under Solaris 9.

Thanks for your help.


On 4/20/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:

 Note:

  configure:4041: checking whether the C compiler works
  configure:4059: error: cannot run C compiled programs.

 so your compiler installation is broken, seriously enough that configure
 can make no progress.

 Also, gcc 3.4.2 is old and has a known bug that stops some R packages
 using Fortran working correctly, so please avoid it.

 Please seek local help with your OS.


 On Thu, 20 Apr 2006, Min Shao wrote:

  Hi,
 
  I am trying to compile R-2.2.1 on Solaris 2.9 with a 64-bit build.
 Following
  the instructions in R Installation and Adminstration, I changed the

 Note, those are example settings that have been tested, but not
 `instructions'.

  following settings in config.site:
  CC=gcc -m64
  F77=g77 -64
  CXX=g++ -m64
  LDFLAGS=-L/usr/local/lib/sparcv9 -L/usr/local/lib
 
  But I got the following error messages:
  configure:3987: gcc -m64  -I/usr/local/include -L/usr/local/lib/sparcv9
  -L/usr/local/lib conftest.c  5
  /usr/ccs/bin/ld: skipping incompatible /work/net-local-b/sparc-
  sun-solaris2.9/bin/../lib/gcc/sparc-sun-solaris2.9
 /3.4.2/sparcv9/libgcc.a
  when search
  ing for -lgcc
  /usr/ccs/bin/ld: skipping incompatible /work/net-local-b/sparc-
  sun-solaris2.9/bin/../lib/gcc/sparc-sun-solaris2.9
 /3.4.2/sparcv9/libgcc_eh.a
  when sea
  rching for -lgcc_eh
  /usr/ccs/bin/ld: skipping incompatible /lib/sparcv9/libc.so when
 searching
  for -lc
  /usr/ccs/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so when
  searching for -lc
  /usr/ccs/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so when
  searching for -lc
  /usr/ccs/bin/ld: skipping incompatible /work/net-local-b/sparc-
  sun-solaris2.9/bin/../lib/gcc/sparc-sun-solaris2.9
 /3.4.2/sparcv9/libgcc.a
  when search
  ing for -lgcc
  /usr/ccs/bin/ld: skipping incompatible /work/net-local-b/sparc-
  sun-solaris2.9/bin/../lib/gcc/sparc-sun-solaris2.9
 /3.4.2/sparcv9/libgcc_eh.a
  when sea
  rching for -lgcc_eh
  /usr/ccs/bin/ld: skipping incompatible /lib/sparcv9/libc.so when
 searching
  for -lc
  /usr/ccs/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so when
  searching for -lc
  /usr/ccs/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so when
  searching for -lc
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/work/net-local-b/sparc-sun-solaris2.9/bin/../lib/gcc/sparc-
 sun-solaris2.9
  /3.4.2/spar
  cv9/crt1.o' is incompatible with sparc output
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/work/net-local-b/sparc-sun-solaris2.9/bin/../lib/gcc/sparc-
 sun-solaris2.9
  /3.4.2/spar
  cv9/crti.o' is incompatible with sparc output
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/usr/ccs/lib/sparcv9/values-Xa.o' is incompatible with sparc output
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/work/net-local-b/sparc-sun-solaris2.9/bin/../lib/gcc/sparc-
 sun-solaris2.9
  /3.4.2/spar
  cv9/crtbegin.o' is incompatible with sparc output
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/var/tmp//cckWp3Sb.o' is incompatible with sparc output
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/work/net-local-b/sparc-sun-solaris2.9/bin/../lib/gcc/sparc-
 sun-solaris2.9
  /3.4.2/spar
  cv9/crtend.o' is incompatible with sparc output
  /usr/ccs/bin/ld: warning: sparc:v9 architecture of input file
  `/work/net-local-b/sparc-sun-solaris2.9/bin/../lib/gcc/sparc-
 sun-solaris2.9
  /3.4.2/spar
  cv9/crtn.o' is incompatible with sparc output
  configure:3990: $? = 0
  configure:4036: result: a.out
  configure:4041: checking whether the C compiler works
  configure:4047: ./a.out
  configure: line 1: 25817 Bus Error   (core dumped)
 ./$ac_file
  configure:4050: $? = 138
  configure:4059: error: cannot run C compiled programs.
 
  I would appreciate any help with resolving the problem.
 
  Thanks,
 
  Min
 
[[alternative HTML version deleted]]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html
 

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


[[alternative HTML version deleted]]

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


[R] Generalized SVD

2006-04-26 Thread Philippe Hupé

Hi,

I need to computed the GSVD of two matrices. For doing so I used in my C 
code the lapack routine dggsvd. But when I source my file gsvd.R I have 
the following error:


Error in eval.with.vis(expr, envir, enclos) :
   BLAS/LAPACK routine 'DGGSVD' gave error code -1


Is there a problem with the parameters passed through the gsvd.R script?
Is there a problem within the C script?

I will really appreciate your help.

Thanks,


Philippe

--
Philippe Hupé
Institut Curie, CNRS UMR 144 / Service Bioinformatique
Laboratoire de Transfert (4ème étage)
26 rue d'Ulm
75005 Paris - France

Email :  [EMAIL PROTECTED]
Tél :+33 (0)1 44 32 42 75
Fax :+33 (0)1 42 34 65 28

website : http://bioinfo.curie.fr

vA - c(1.0,  2.0,  3.0,
   3.0,  2.0,  1.0,
   4.0,  5.0,  6.0,
   7.0,  8.0,  8.0)

A - matrix(vA,4,3, byrow=TRUE)

vB - c(-2.0, -3.0,  3.0,
4.0,  6.0,  5.0)


B - matrix(vB,2,3, byrow=TRUE)

if(ncol(A)!=ncol(B))
  {
stop(A and B matrix does not have the same column number)
  }

gsvd - .C(GSVD,
   JOBU = as.character('U'),
   JOBV = as.character('V'),
   JOBQ = as.character('Q'),
   M = as.integer(nrow(A)),
   N = as.integer(ncol(A)),
   P = as.integer(nrow(B)),
   K = integer(1),
   L = integer(1),
   A = as.double(A),
   LDA = as.integer(nrow(A)),
   B = as.double(B),
   LDB = as.integer(nrow(B)),
   ALPHA = double(ncol(A)),
   BETA = double(ncol(A)),
   U = double(nrow(A)*nrow(A)),
   LDU = as.integer(nrow(A)),
   V = double(nrow(B)*nrow(B)),
   LDV = as.integer(nrow(B)),
   Q = double(ncol(A)*ncol(A)),
   LDQ = as.integer(ncol(A)),
   WORK = double(max(c(3*ncol(A),nrow(A),nrow(B)))+ncol(A)),
   IWORK = integer(ncol(A)),
   INFO = integer(1),
   PACKAGE=GSVD)



GSVD_1.0.tar.gz
Description: PostScript document
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Code for Screenshots graphics (following on from ease-of-use issues on www.r-project.org)

2006-04-26 Thread John McHenry
Does anyone know where the code for the graphics on: 
   
  http://www.r-project.org/screenshots/screenshots.html 
   
  lives?
   


-

[[alternative HTML version deleted]]

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


Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Marc Schwartz (via MN)
On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote:
 [Please CC me for all replies, since I am not currently subscribed to  
 the list.]
 
 Hi all,
 
 I have the following problem/question: Imagine you have a two- 
 dimensional plot, and you want to select a number of points, around  
 which you could draw a polygon. The points of the polygon are defined  
 by clicking in the graphics window (locator()/identify()), all points  
 inside the polygon are returned as an object.
 
 Is something like this already implemented?
 
 Thanks a lot in advance,
 
 Florian

I don't know if anyone has created a single function do to this (though
it is always possible). 

However, using:

  RSiteSearch(points inside polygon)

brings up several function hits that, if put together with the above
interactive functions, could be used to do what you wish. That is, input
the matrix of x,y coords of the interactively selected polygon and the
x,y coords of the underlying points set to return the points inside or
outside the polygon boundaries.

Just as an FYI, you might also want to look at ?chull, which is in the
base R distribution and returns the set of points on the convex hull of
the underlying point set. This is to some extent, the inverse of what
you wish to do.

HTH,

Marc Schwartz

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


Re: [R] help using tapply

2006-04-26 Thread Gabor Grothendieck
On 4/26/06, Dimitri Szerman [EMAIL PROTECTED] wrote:
 Dear R-mates,

 # Here's what I am trying to do. I have a dataset like this:

 id = c(rep(1,8), rep(2,8))
 dur1 - c( 17,18,19,18,24,19,24,24 )
 est1 - c( rep(1,5), rep(2,3) )
 dur2 - c(1,1,3,4,8,12,13,14)
 est2 - rep(1,8)

 mydata = data.frame(id,
estat=c(est1, est2),
durat=c(dur1, dur2))


 # I want to one have this:

 id = c(rep(1,8), rep(2,8))
 dur1 - c( 17,18,19,20,28,1,2,3 )
 est1 - c( rep(1,5), rep(2,3) )
 dur2 - c(1,2,3,4,12,13,14,15)
 est2 - rep(1,8)

 mydata2 = = data.frame(id,
estat=c(est1, est2),
durat=c(dur1, dur2))


 # What is happening here? I have a longitudinal dataset.
 # Individuals are observed 8 times, and each time each of them are in a
 certain state J (here, J={1,2}).
 # Each observation is one unit of time away from the following one, except
 observations 4 and 5, which are 8 units of time away from each other.
 # So here we have individual 1 migrating from state 1 to state 2 at
 observation #6,
 # while individual 2 stays in state 1 as long as we can observe her.
 # I am interested in the spell (duration) of each state.
 # However, the durations are clearly mismesuared, and now I am trying to
 give some consistency to the data.
 # I am assuming that the first duration is correct. Departing from this, I
 wrote the following function:

d - function(dur,est)
 {
if ( sum( diff(est) )==0 ) # for those who didn't change state
{
for( i in c(2:4))
dur[i] - dur[i-1] + 1

dur[5] - dur[4] + 8

for( i in c(6:8) )
dur[i] - dur[i-1] + 1
}
if ( sum( diff(est) )!=0 ) # for those who changed state
{
 j = which(diff(est)!=0) + 1# j is when the change occured
 dur[j] = 1

 k0  = which( c(1:8)  j )[-c(1)]
 k1  = which( c(1:8)  j )
 if(length(j)  1)
{
for( i in 1:(length(j)-1) )
k2 = c(1:8)[c(1:8) j[i]  c(1:8) j[i+1]]
k = unique( c(k0,k1,k2) )
}
 k = unique( c(k0,k1) )
 k = k[!k%in%j]
 if(5%in%k)
{
 k = k[k != 5]
 for(i in k[k5])
dur[i] = dur[i-1] + 1

 dur[5] = dur[4] + 8

 for(i in k[k5])
dur[i] = dur[i-1] + 1
} else
  {
for(i in k)
dur[i] = dur[i-1] + 1
  }
}
 dur

 }

 # Now, if a do

d(dur1, est1)
 # and
d(dur2,est2)
 # I get what I want, except from the fact that I couldn't do this for a
 large dataset.
 # So I decide to use tapply. But this gives me

new.durat - tapply(mydata$durat, IND=mydata$id, FUN=d,
 est=mydata$estat)
mydata$new.durat - unlist(new.durat)

 mydata
id   estat durat new.durat
 1   1 11717
 2   1 11818
 3   1 11919
 4   1 11820
 5   1 12428
 6   1 21929
 7   1 22430
 8   1 22431
 9   2 1 1 1
 10  2 1 1 2
 11  2 1 3 3
 12  2 1 4 4
 13  2 1 812
 14  2 11213
 15  2 11314
 16  2 11415

 # what is not what I want. I can't figure it out why, but when I use tapply,
 # the logical expression sum( diff(est) )==0 turns out to be true for both
 individuals
 # (whereas we know this is true only for individual #2).
 # I am sorry for the long message. I will be very grateful for any help with
 this problem.

I didn't try to read all this carefully but I think you want to tapply
over the indices so you can use them in both columns:

with(mydata,
  unlist(tapply(seq(id), id, function(i) d(durat[i], estat[i])))
)

or use by:

unlist(by(mydata, mydata$id, function(x) d(x$durat, x$estat)))

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


Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread roger koenker
?in.convex.hull  in the package tripack.


url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820


On Apr 26, 2006, at 1:25 PM, Marc Schwartz (via MN) wrote:

 On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote:
 [Please CC me for all replies, since I am not currently subscribed to
 the list.]

 Hi all,

 I have the following problem/question: Imagine you have a two-
 dimensional plot, and you want to select a number of points, around
 which you could draw a polygon. The points of the polygon are defined
 by clicking in the graphics window (locator()/identify()), all points
 inside the polygon are returned as an object.

 Is something like this already implemented?

 Thanks a lot in advance,

 Florian

 I don't know if anyone has created a single function do to this  
 (though
 it is always possible).

 However, using:

   RSiteSearch(points inside polygon)

 brings up several function hits that, if put together with the above
 interactive functions, could be used to do what you wish. That is,  
 input
 the matrix of x,y coords of the interactively selected polygon and the
 x,y coords of the underlying points set to return the points inside or
 outside the polygon boundaries.

 Just as an FYI, you might also want to look at ?chull, which is in the
 base R distribution and returns the set of points on the convex  
 hull of
 the underlying point set. This is to some extent, the inverse of what
 you wish to do.

 HTH,

 Marc Schwartz

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

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


[R] accessing a SOAP based web service from R

2006-04-26 Thread Rajarshi Guha
Hi,
  I have a number of web services that run on a server and can be
accessed via SOAP as well as by creating a specific URL.

Now, for certain services, the argument that I need to send is about 10
to 20 characters and the URL approach works fine. However if the
argument is a few kilobytes I would rather create a SOAP packet and send
that off.

So my first question is: is there a package that can create SOAP packets
and communicate with a web service via SOAP?

I have found the RSOAP package but that looks like it deals with
accessing R via SOAP. I think my situation is simpler(?) Another
approach I could use is to create a Java class that would do the
communication and use SJava etc to use it. However that seems like
overkill

Now, if I use the URL approach I get back an XML document. I realize I
could use the XML package for R to parse it. On the other hand if a SOAP
package could decode the return document and simply hand back the
result, that would make life easier.

Any pointers would be greatly appreciated.

Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
Q: What do you get when you cross a mosquito with a mountain climber?
A: Nothing. You can't cross a vector with a scaler.

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


[R] copying previously installed libraries to R 2.3.0

2006-04-26 Thread Thomas Harte
hi all,

is there a new mechanism in R 2.3.0 for copying libraries from, say, R 2.2.1 to 
R 2.3.0? i ask because gabor grothendieck comments in his copydir.bat (from 
gabor's batchfiles at: 
http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip ):

``::   I personally upgraded my 2.1.0 to 2.2.0 this way so it seems ok until
  ::   R replaces this with something better which is expected for 2.3.0. '''

see also the posting below.

cheers,

thomas.
 

[R] copy contributed packages from R 2.2.0 to 2.2.1
This message: [ Message body ]  [ More options ] 
Related messages:  [ Next message ] [ Previous message ] [ In reply to ]  [ 
Next in thread ]  
  
 From: Ronnie Babigumira rb.glists 
Date: Fri, 23 Dec 2005 15:58:36 +0100
Hi Helli, this came up last week, Here are some of the replys posted 
 
1. 
 In http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip 
 
are two Windows XP batch files: 
 
movedir.bat 
 copydir.bat 
 
which will move the packages (which is much faster and suitable if you don't 
need the old version of R any more) or copy  
 the packages (which takes longer but preserves the old version). 
 
2. 
 x - installed.packages()[,1] 
 install.packages(x) 
 
3. 
 This is one reason we normally recommend that you install into a separate 
library.  Then update.packages(checkBuilt =  
 TRUE) is all that is needed. However, 
 
foo - installed.packages() 
 as.vector(foo[is.na(foo[, Priority]), 1]) 
 
will give you a character vector which you can feed to install.packages(), so 
it's not complex to do manually. 
 
4. 
 If the previous installation is still alive, fire it up and 
 
pS - packageStatus() 
 pkgs - pS$inst$Package[!pS$inst$Priority %in% c(base, recommended)] 
 save(pkgs, file = foo) 
 
In the new installation, 
 
load(foo) 
 install.packages(pkgs) 
 
Helmut Kudrnovsky wrote: 
 hi R-users, 
  
 a few days ago R 2.2.1 came out. on my win xp i'installed R 2.2.0. along the 
 time i've installed a lot of contributed packages. my internet-connection is 
 not very fast. 
  
 so my question: is it possible after installing R 2.2.1 to do copy/paste the 
 contributed packages from the C:\Programme\R221 to the C:\Programme\R2.2.1- 
 location in the files system? 
  
 or have i to download and install the packages new? 
  
  
 greetings from the snowy austria 
 merry christmas 
 helli 
  
 system 
 R.2.2.0 
 win xp 
  
 __ 
 R-help at stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help 
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html 
 
Received on Fri Dec 23 2005 - 15:58:36 EST


   This message: [ Message body ]
   Next message: Matthias Kohl: [R] convolution of the double exponential 
distribution
   Previous message: Helmut Kudrnovsky: [R] copy contributed packages from R 
2.2.0 to 2.2.1
   In reply to: Helmut Kudrnovsky: [R] copy contributed packages from R 2.2.0 
to 2.2.1
   Next in thread: Uwe Ligges: [R] copy contributed packages from R 2.2.0 to 
2.2.1
 
   Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by 
author ] [ by messages with attachments ]
  
   This archive was generated by hypermail 2.2.0  : Sat Dec 31 2005 - 19:09:32 
EST 

[[alternative HTML version deleted]]

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


Re: [R] copying previously installed libraries to R 2.3.0

2006-04-26 Thread Christos Hatzis
See Windows FAQ 2.8 - works well.

-Christos
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Harte
Sent: Wednesday, April 26, 2006 2:54 PM
To: r-help@stat.math.ethz.ch
Subject: [R] copying previously installed libraries to R 2.3.0

hi all,

is there a new mechanism in R 2.3.0 for copying libraries from, say, R 2.2.1
to R 2.3.0? i ask because gabor grothendieck comments in his copydir.bat
(from gabor's batchfiles at:
http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip ):

``::   I personally upgraded my 2.1.0 to 2.2.0 this way so it seems ok until
  ::   R replaces this with something better which is expected for 2.3.0.
'''

see also the posting below.

cheers,

thomas.
 

[R] copy contributed packages from R 2.2.0 to 2.2.1
This message: [ Message body ]  [ More options ] 
Related messages:  [ Next message ] [ Previous message ] [ In reply to ]
[ Next in thread ]  
  
 From: Ronnie Babigumira rb.glists
Date: Fri, 23 Dec 2005 15:58:36 +0100
Hi Helli, this came up last week, Here are some of the replys posted 
 
1. 
 In http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip 
 
are two Windows XP batch files: 
 
movedir.bat
 copydir.bat 
 
which will move the packages (which is much faster and suitable if you don't
need the old version of R any more) or copy  the packages (which takes
longer but preserves the old version). 
 
2. 
 x - installed.packages()[,1]
 install.packages(x) 
 
3. 
 This is one reason we normally recommend that you install into a separate
library.  Then update.packages(checkBuilt =
 TRUE) is all that is needed. However, 
 
foo - installed.packages()
 as.vector(foo[is.na(foo[, Priority]), 1]) 
 
will give you a character vector which you can feed to install.packages(),
so it's not complex to do manually. 
 
4. 
 If the previous installation is still alive, fire it up and 
 
pS - packageStatus()
 pkgs - pS$inst$Package[!pS$inst$Priority %in% c(base, recommended)]
save(pkgs, file = foo) 
 
In the new installation, 
 
load(foo)
 install.packages(pkgs) 
 
Helmut Kudrnovsky wrote: 
 hi R-users,
  
 a few days ago R 2.2.1 came out. on my win xp i'installed R 2.2.0. along
the time i've installed a lot of contributed packages. my
internet-connection is not very fast. 
  
 so my question: is it possible after installing R 2.2.1 to do copy/paste
the contributed packages from the C:\Programme\R221 to the
C:\Programme\R2.2.1- location in the files system? 
  
 or have i to download and install the packages new? 
  
  
 greetings from the snowy austria
 merry christmas
 helli
  
 system
 R.2.2.0
 win xp
  
 __
 R-help at stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
Received on Fri Dec 23 2005 - 15:58:36 EST


   This message: [ Message body ]
   Next message: Matthias Kohl: [R] convolution of the double exponential
distribution
   Previous message: Helmut Kudrnovsky: [R] copy contributed packages from
R 2.2.0 to 2.2.1
   In reply to: Helmut Kudrnovsky: [R] copy contributed packages from R
2.2.0 to 2.2.1
   Next in thread: Uwe Ligges: [R] copy contributed packages from R 2.2.0
to 2.2.1
 
   Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [
by author ] [ by messages with attachments ]
  
   This archive was generated by hypermail 2.2.0  : Sat Dec 31 2005 -
19:09:32 EST 

[[alternative HTML version deleted]]

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

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


Re: [R] Code for Screenshots graphics (following on from ease-of-use issues on www.r-project.org)

2006-04-26 Thread Marc Schwartz (via MN)
On Wed, 2006-04-26 at 11:05 -0700, John McHenry wrote:
 Does anyone know where the code for the graphics on: 

   http://www.r-project.org/screenshots/screenshots.html 

   lives?


demo(graphics)

demo(image)

demo(persp)


These should cover each of the screen shots and then some.

If you know how to navigate the R package subdirectories of your R
installation, the R code files for the demos are located in the 'demo'
subdir of the 'graphics' package.

Typically this would be:

  $RHOME/library/graphics/demo


HTH,

Marc Schwartz

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


Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Roger Bivand
On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote:

 On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote:
  [Please CC me for all replies, since I am not currently subscribed to  
  the list.]
  
  Hi all,
  
  I have the following problem/question: Imagine you have a two- 
  dimensional plot, and you want to select a number of points, around  
  which you could draw a polygon. The points of the polygon are defined  
  by clicking in the graphics window (locator()/identify()), all points  
  inside the polygon are returned as an object.
  
  Is something like this already implemented?
  
  Thanks a lot in advance,
  
  Florian
 
 I don't know if anyone has created a single function do to this (though
 it is always possible). 
 
 However, using:
 
   RSiteSearch(points inside polygon)
 
 brings up several function hits that, if put together with the above
 interactive functions, could be used to do what you wish. That is, input
 the matrix of x,y coords of the interactively selected polygon and the
 x,y coords of the underlying points set to return the points inside or
 outside the polygon boundaries.

This sequence from the splancs package should do it:

library(splancs)
set.seed(20060426)
xy - cbind(x=runif(100), y=runif(100))
plot(xy)
poly - getpoly() # this gets the polygon on-screen
plot(xy)
polygon(poly)
io - inout(xy, poly) 
# this returns a logical vector for points in the polygon
points(xy[io,], pch=16, col=blue)

Roger

 
 Just as an FYI, you might also want to look at ?chull, which is in the
 base R distribution and returns the set of points on the convex hull of
 the underlying point set. This is to some extent, the inverse of what
 you wish to do.
 
 HTH,
 
 Marc Schwartz
 

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

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


Re: [R] accessing a SOAP based web service from R

2006-04-26 Thread Seth Falcon
Rajarshi Guha [EMAIL PROTECTED] writes:

 Hi,
   I have a number of web services that run on a server and can be
 accessed via SOAP as well as by creating a specific URL.

 Now, for certain services, the argument that I need to send is about 10
 to 20 characters and the URL approach works fine. However if the
 argument is a few kilobytes I would rather create a SOAP packet and send
 that off.

 So my first question is: is there a package that can create SOAP packets
 and communicate with a web service via SOAP?

SSOAP

http://www.omegahat.org/SSOAP/

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


Re: [R] Code for Screenshots graphics (following on from ease-of-use issues on www.r-project.org)

2006-04-26 Thread Thomas Lumley
On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote:

 On Wed, 2006-04-26 at 11:05 -0700, John McHenry wrote:
 Does anyone know where the code for the graphics on:

   http://www.r-project.org/screenshots/screenshots.html

   lives?


 demo(graphics)

 demo(image)

 demo(persp)


 These should cover each of the screen shots and then some.



At least three of them aren't there (though most of the necessary ideas 
are).   The forest plot is example(catheter)  in the rmeta package.

The coplot with nice interactions is
coplot(Ozone~Solar.R|Temp*Wind, number=4,pch=21,col=darkred,bg=darkred, 
data=airquality)

and the code for the mathematical annotation example is in the archives 
at: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/60471.html


-thomas

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


Re: [R] copying previously installed libraries to R 2.3.0

2006-04-26 Thread Thomas Harte
the windoze faq that you refer to doesn't quite address the question that i 
asked, but thanks all the same.

2.8 What's the best way to upgrade?  That's a matter of taste.  For most people 
the best thing to do is to uninstall R (see the previous Q), install the new 
version, copy any installed packages to the library folder in the new 
installation, run update.packages() in the new R (`Update packages...' from the 
Packages menu, if you prefer) and then delete anything left of the old 
installation.  Different versions of R are quite deliberately installed in 
parallel folders so you can keep old versions around if you wish.  
Upgrading from R 1.x.y to R 2.x.y is special as all the packages need to be 
reinstalled.  Rather than copy them across, make a note of their names and 
re-install them from CRAN.  


Christos Hatzis [EMAIL PROTECTED] wrote: See Windows FAQ 2.8 - works well.

-Christos
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Harte
Sent: Wednesday, April 26, 2006 2:54 PM
To: r-help@stat.math.ethz.ch
Subject: [R] copying previously installed libraries to R 2.3.0

hi all,

is there a new mechanism in R 2.3.0 for copying libraries from, say, R 2.2.1
to R 2.3.0? i ask because gabor grothendieck comments in his copydir.bat
(from gabor's batchfiles at:
http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip ):

``::   I personally upgraded my 2.1.0 to 2.2.0 this way so it seems ok until
  ::   R replaces this with something better which is expected for 2.3.0.
'''

see also the posting below.

cheers,

thomas.
 

[R] copy contributed packages from R 2.2.0 to 2.2.1
This message: [ Message body ]  [ More options ] 
Related messages:  [ Next message ] [ Previous message ] [ In reply to ]
[ Next in thread ]  
  
 From: Ronnie Babigumira 
Date: Fri, 23 Dec 2005 15:58:36 +0100
Hi Helli, this came up last week, Here are some of the replys posted 
 
1. 
 In http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip 
 
are two Windows XP batch files: 
 
movedir.bat
 copydir.bat 
 
which will move the packages (which is much faster and suitable if you don't
need the old version of R any more) or copy  the packages (which takes
longer but preserves the old version). 
 
2. 
 x - installed.packages()[,1]
 install.packages(x) 
 
3. 
 This is one reason we normally recommend that you install into a separate
library.  Then update.packages(checkBuilt =
 TRUE) is all that is needed. However, 
 
foo - installed.packages()
 as.vector(foo[is.na(foo[, Priority]), 1]) 
 
will give you a character vector which you can feed to install.packages(),
so it's not complex to do manually. 
 
4. 
 If the previous installation is still alive, fire it up and 
 
pS - packageStatus()
 pkgs - pS$inst$Package[!pS$inst$Priority %in% c(base, recommended)]
save(pkgs, file = foo) 
 
In the new installation, 
 
load(foo)
 install.packages(pkgs) 
 
Helmut Kudrnovsky wrote: 
 hi R-users,
  
 a few days ago R 2.2.1 came out. on my win xp i'installed R 2.2.0. along
the time i've installed a lot of contributed packages. my
internet-connection is not very fast. 
  
 so my question: is it possible after installing R 2.2.1 to do copy/paste
the contributed packages from the C:\Programme\R221 to the
C:\Programme\R2.2.1- location in the files system? 
  
 or have i to download and install the packages new? 
  
  
 greetings from the snowy austria
 merry christmas
 helli
  
 system
 R.2.2.0
 win xp
  
 __
 R-help at stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
Received on Fri Dec 23 2005 - 15:58:36 EST


   This message: [ Message body ]
   Next message: Matthias Kohl: [R] convolution of the double exponential
distribution
   Previous message: Helmut Kudrnovsky: [R] copy contributed packages from
R 2.2.0 to 2.2.1
   In reply to: Helmut Kudrnovsky: [R] copy contributed packages from R
2.2.0 to 2.2.1
   Next in thread: Uwe Ligges: [R] copy contributed packages from R 2.2.0
to 2.2.1
 
   Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [
by author ] [ by messages with attachments ]
  
   This archive was generated by hypermail 2.2.0  : Sat Dec 31 2005 -
19:09:32 EST 

 [[alternative HTML version deleted]]

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




[[alternative HTML version deleted]]

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


[R] help in R

2006-04-26 Thread Anamika Chaudhuri
Hi,
   
  I cant understand where I am going wrong.Below is my code.I would really 
appreciate your help.
   
  Thanks.
   
   
   genfile-read.table(c:/tina/phd/bs871/hw/genfile.txt,skip=1)
 
 #read in SNP data
 snp.dat - as.matrix(genfile)
 snp.name - scan(c:/tina/phd/bs871/hw/genfile.txt,nline=1,what=character)
Read 100 items
 n.snp - length(snp.name)
 n.id - 1 #number of fields for ids, sex and affection status
 
 ###form gntp using the two alleles of each SNP
 allele1 - snp.dat[,seq(1,2*n.snp,2)+n.id ]
 allele2 - snp.dat[,seq(2,2*n.snp,2)+n.id ]
 temp - matrix(paste(allele1,allele2,sep=|),dim(allele1))
 temp - data.frame(temp)
 convt - function(x) x - factor(as.character(x),exclude=0|0)
 
 gntp - as.data.frame(lapply(temp,convt))
 
 ###create new snp data with ids and gntp only
 names(gntp) - snp.name
 ids - as.data.frame(snp.dat[,1:n.id])
 names(ids) - c(fid)
 
 snp.dat - cbind(ids,gntp)
 
 
 
 #read in phenotype data
 #--
 phen.dat - 
 read.table(c:/tina/phd/bs871/fram.csv,header=T,sep=,,na.string='')
 phen.name - scan(c:/tina/phd/bs871/fram.csv,nline=1,what=character)
Read 1 item
 n.phen - length(phen.name)
 
 names(phen.dat) - c(id, phen.name)
 
 test.allsnp - function(phen)
+ 
+ apply(phen.dat[,snp.name],glm.reg,phen=phen)
 ##Above:since snp gntp data are defined as factor, use lapply instead of 
 apply(matrix only)
 
 #Below; apply() results in three dimensional list (phen,snp)
 #use unlist to convert the list into a vector, then use matrix to convert the 
 vector
 #into a matrix of 15 columns, each row for a (phen,snp) combination with 
 byrow=T  
 
 final - 
 matrix(unlist(apply(phen.dat[,phen.name],2,test.allsnp)),byrow=T,ncol=15)
Error in apply(phen.dat[, phen.name], 2, test.allsnp) : 
dim(X) must have a positive length
 
 



-

[[alternative HTML version deleted]]

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


Re: [R] cdf of weibull distribution

2006-04-26 Thread J. Hosking
Peter Dalgaard wrote:
  Sachin J [EMAIL PROTECTED] writes:
 
 
 Hi,
 
   I have a data set which is assumed to follow weibull distr'. How 
can I find of cdf for this data. For example, for normal data I used 
(package - lmomco)
 
   cdfnor(15,parnor(lmom.ub(c(df$V1

If X is a Weibull random variable then -X has a generalized
extreme-value distribution.  So something like

   cdfgev(-15,pargev(lmom.ub(-c(df$V1

should do the trick.

   Also, lmomco package does not have functions for finding cdf for 
some of the distributions like lognormal. Is there any other package, 
which can handle these distributions?

I recommend that you use the generalized normal distribution, a
reparametrized and extended version of the lognormal that accommodates
distributions with negative as well as positive skewness.  See Hosking
 Wallis, Regional Frequency Analysis, Cambridge Univ. Press, 1997,
p.198.  The relevant routines in lmomco are cdfgno, lmomgno, pargno and
quagno.

  What's wrong with pweibull, plnorm, etc.? Or pnorm for that matter

What's wrong, or at least what I often find somewhat incovenient, is
that R's distribution functions require the distribution parameters
to be supplied as separate arguments rather than as a single vector.
This complicates operations that involve passing parameters from one
function to another.  For example, the OP's one-liner above would,
if pnorm were used, have to become something like

   par - parnor(lmom.ub(c(df$V1)))
   pnorm(15, par[1], par[2])

or, if we still want to do it in one line,

   do.call('pnorm', as.list(c(15, parnor(lmom.ub(c(df$V1))

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


Re: [R] www.r-project.org

2006-04-26 Thread Adaikalavan Ramasamy
I am coming late into the discussion, so apologies if the following
points are redundant.


1) IMHO, the most important feature that would make life a lot easier
for everyone is having search engines on the main webpage. I know you
can click on the Search on the left hand side pane but putting it on
the main webpage is much more useful.

We can also have a targets section for the search (c.f.
http://finzi.psych.upenn.edu/nmz.html) where one can search mailing
list, html Manual, FAQ, user-inputted package name etc.


2) About having explicit URL print, may I suggest using
http://maps.google.com approach of using the Link to this page (top
right hand of the page) ?


3) I understand that R is restricted in terms of priority and human
resources. But given that Asia (e.g. India, Singapore, China) has low
labour costs and abundant computing personals, would it not make sense
for some Asian research group to offer to spearhead and maintain the
website ?

From a marketing point of view some nice graphics, search functions and
navigation etc would be useful to attract newcomers. There could be a
simple version alternative (as it is now) for those who prefer or
those who have trouble accessing the site.

Just my £0.02.

Regards, Adai



On Tue, 2006-04-25 at 12:33 -0700, Spencer Graves wrote:
 Hi, Gabor:  inline
 Gabor Grothendieck wrote:
 
  On Windows, right click the web page, choose Properties and
  copy the url there.
 
 That works, and I will use it in the future.  Thanks.
 
 However, if the subject is not educating Spencer Graves but how to 
 make www.r-project.org more user friendly, then it still might help to 
 display as Address the actual web address of the archive page rather 
 than www.r-project.org.  It may not look as pretty, but I'm for 
 function first and cosmetics only if they don't interfere with 
 functionality.
 
 Best Wishes,
 spencer graves
  
  On 4/25/06, Spencer Graves [EMAIL PROTECTED] wrote:

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

[R] Course - May 2006, R/Splus Fundamentals and Programming Techniques***San Francisco, Washington DC

2006-04-26 Thread elvis

   XLSolutions Corporation (www.xlsolutions-corp.com) is proud to
   announce  2-day R/S-plus Fundamentals and Programming
   Techniques in San Francisco: www.xlsolutions-corp.com/Rfund.htm
   San Francisco *** May 25-26

   Washington, DC   *** May  TBD
   Reserve your seat now at the early bird rates! Payment due AFTER
   the class
   Course Description:
   This two-day beginner to intermediate R/S-plus course focuses on a
   broad spectrum of topics, from reading raw data to a comparison of R
   and S. We will learn the essentials of data manipulation, graphical
   visualization and R/S-plus programming. We will explore statistical
   data analysis tools,including graphics with data sets. How to enhance
   your plots, build your own packages (librairies) and connect via
   ODBC,etc.
   We will perform some statistical modeling and fit linear regression
   models. Participants are encouraged to bring data for interactive
   sessions
   With the following outline:
   - An Overview of R and S
   - Data Manipulation and Graphics
   - Using Lattice Graphics
   - A Comparison of R and S-Plus
   - How can R Complement SAS?
   - Writing Functions
   - Avoiding Loops
   - Vectorization
   - Statistical Modeling
   - Project Management
   - Techniques for Effective use of R and S
   - Enhancing Plots
   - Using High-level Plotting Functions
   - Building and Distributing Packages (libraries)
   - Connecting; ODBC, Rweb, Orca via sockets and via Rjava
   Email us for group discounts.
   Email Sue Turner: [EMAIL PROTECTED]
   Phone: 206-686-1578
   Visit us: www.xlsolutions-corp.com/training.htm
   Please let us know if you and your colleagues are interested in this
   classto take advantage of group discount. Register now to secure your
   seat!
   Interested in R/Splus Advanced course? email us.
   Cheers,
   Elvis Miller, PhD
   Manager Training.
   XLSolutions Corporation
   206 686 1578
   www.xlsolutions-corp.com
   [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Fwd: Re: Help needed

2006-04-26 Thread Anamika Chaudhuri


Note: forwarded message attached.

-
---BeginMessage---
Subject: Re: [R] Help needed
To: Petr Pikal [EMAIL PROTECTED]
In-Reply-To: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=0-1025507389-1146080390=:92916
Content-Transfer-Encoding: 8bit
Content-Length: 2488

--0-1025507389-1146080390=:92916
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Thanks a lot.
  How could I change the following code in SAS macro to R (the part marked in 
red)?
  Thanks so much!
   
  attach(fram)
dset1-cbind(AGE,BMI,DEATH)
BMIGRP1-cut(BMI,breaks=c(14,20,25,57),right=TRUE)
levels(BMIGRP1)
BMIGRP-as.numeric(BMIGRP1)
AGEGRP-floor(AGE/10)-2
dset-cbind(AGEGRP,BMIGRP,DEATH)
maxage-max(dset[,1])
minage-min(dset[,1])
maxcls-max(dset[,2], na.rm=T)
mincls-min(dset[,2],na.rm=T)
nage-maxage-minage+1
nclass-maxcls-mincls+1
nsub-nrow(dset)
weight - matrix(,nage,1)
for ( i in minage:maxage )
  {weight[i-minage+1,1] = sum(std = i)}
atrisk = matrix(,nclass,nage)
  wevents = matrix(,nclass,nage)
#reduce data set to frequency table 
 for( i in (minage : maxage))
 for( j in (mincls : maxcls))
#atrisk1-aggregate(dset[,c(AGEGRP,BMIGRP)],list(RANDID=dset1$RANDID,sum)
  {atrisk[j-mincls+1,i-minage+1] =
 sum((dset[,1]=i) (dset[,2]=j))
wevents[j-mincls+1,i-minage+1]=
  sum((dset[,1]=i) (dset[,2]=j)(dset[,3]=1))}
  vtit = char(t(mincls:maxcls),5,0) // {Total};
htit = {'at risk' 'events' 'rate/1000'};
*;
atrisk2 = atrisk // atrisk[+,1:nage];
event2 = wevents // wevents[+,1:nage];
atrisk3 = choose(atrisk2=0,1,atrisk2);
rate = event2/atrisk3;
   
  

Petr Pikal [EMAIL PROTECTED] wrote:
  Hi

you experienced difference between matrix (cbind()) and data 
frame (data.frame(..)) or you have some NA value in your BMIGRP1

try:
maxcls-max(dset[,2], na.rm=T)
if you have some NA values
or use
str(dset) to look what types are your variables.

HTH
Petr


On 25 Apr 2006 at 18:16, Anamika Chaudhuri wrote:

Date sent: Tue, 25 Apr 2006 18:16:42 -0700 (PDT)
From: Anamika Chaudhuri 
To: Richard M. Heiberger , r-help@stat.math.ethz.ch
Subject: Re: [R] Help needed

 As my earlier email said I am not getting the maxcls. I do get numbers
 coded as 1,2,3 for BMIGRP(when I print BMIGRP) but not getting the max
 of (1,2,3) which should be 3, I guess.
 
 Thanks for your help
 Anamika
 
 
 Anamika Chaudhuri wrote:
  dset1-cbind(AGE,BMI,DEATH)
  BMIGRP-cut(BMI,breaks=c(14,20,25,57),right=TRUE)
  levels(BMIGRP)
 [1] (14,20] (20,25] (25,57]
  BMIGRP1-as.numeric(BMIGRP)
  AGEGRP-floor(AGE/10)-2
  dset-cbind(AGEGRP,BMIGRP1,DEATH)
  maxage-max(dset[,1])
  minage-min(dset[,1])
  maxcls-max(dset[,2])
  maxcls
 [1] NA
 
 Why doesnt it give me a no for maxcls then?
 
 Thanks.
 
 
 Richard M. Heiberger wrote:
  x - rnorm(100)
  xx - cut(x,3)
  levels(xx)
 [1] (-2.37,-0.716] (-0.716,0.933] (0.933,2.58] 
  as.numeric(xx)
 
 
 -
 
 
 
 -
 
 [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

Petr Pikal
[EMAIL PROTECTED]




-
Celebrate Earth Day everyday!  Discover 10 things you can do to help slow 
climate change. Yahoo! Earth Day
--0-1025507389-1146080390=:92916
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

divThanks a lot./div  divHow could I change the following code in SAS 
macro to R (the part marked in red)?/div  divThanks so much!/div  
divnbsp;/div  
divattach(fram)BRdset1lt;-cbind(AGE,BMI,DEATH)BRBMIGRP1lt;-cut(BMI,breaks=c(14,20,25,57),right=TRUE)BRlevels(BMIGRP1)BRBMIGRPlt;-as.numeric(BMIGRP1)BRAGEGRPlt;-floor(AGE/10)-2BRdsetlt;-cbind(AGEGRP,BMIGRP,DEATH)BRmaxagelt;-max(dset[,1])BRminagelt;-min(dset[,1])BRmaxclslt;-max(dset[,2],
 
na.rm=T)BRminclslt;-min(dset[,2],na.rm=T)BRnagelt;-maxage-minage+1BRnclasslt;-maxcls-mincls+1BRnsublt;-nrow(dset)BRweight
 lt;- matrix(,nage,1)BRfor ( i in minage:maxage )BRnbsp; 
{weight[i-minage+1,1] = sum(std = i)}/div  divnbsp; atrisk = 
matrix(,nclass,nage)BRnbsp; wevents = matrix(,nclass,nage)BR#reduce data 
set to frequency table BRnbsp;for( i in (minage : maxage))BRnbsp;for( j 
in (mincls :
 
maxcls))BR#atrisk1lt;-aggregate(dset[,c(AGEGRP,BMIGRP)],list(RANDID=dset1$RANDID,sum)/div
  divnbsp;nbsp;nbsp; {atrisk[j-mincls+1,i-minage+1] 
=BRnbsp;nbsp;nbsp;nbsp; sum((dset[,1]=i)amp; 
(dset[,2]=j))BRnbsp;nbsp;nbsp; 
wevents[j-mincls+1,i-minage+1]=BRnbsp;nbsp;nbsp;nbsp;nbsp; 
sum((dset[,1]=i)amp; (dset[,2]=j)amp;(dset[,3]=1))}/div  divFONT 
color=#ffvtit = char(t(mincls:maxcls),5,0) // {Total};BRhtit = {'at 
risk' 'events' 'rate/1000'};BR*;BRatrisk2 = atrisk // 
atrisk[+,1:nage];BRevent2 = wevents // wevents[+,1:nage];BRatrisk3 = 
choose(atrisk2=0,1,atrisk2);BRrate = 

[R] comparing mantel tests for three different species

2006-04-26 Thread Patrick Kuss
Hi,

I have calculated mantel statistics for three plant species to check for
isolation by distance (thus, comparing genetic distance to geographic
distance).

Now, I would like to test whether the species have significantly different
isolation by distance behaviour.

Is there a R-function that allows me to do this?

Cheers and thank for any comments

Patrick

--
Patrick Kuss
PhD-student
Institute of Botany
University of Basel
Schönbeinstr. 6
CH-4056 Basel
+41 61 267 2976

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


Re: [R] copying previously installed libraries to R 2.3.0

2006-04-26 Thread Gabor Grothendieck
Note that the FAQ is really no different from batchfiles since the
FAQ does not address how to move or copy the packages and the batchfiles
scripts just do that (with the safeguard that they will not overwrite any
packages that are already there so you could, for example, manually
install a few packages and the move or copy the remaining ones over.)

I think there was some discussion that 2.3.0 might have moving/copying
capability built into the R installer but since it seems that
that did not make it into 2.3.0 it should be possible to use
the scripts, as before, or, alternatively, just re-install all your
packages from scratch.

By the way, there were some comments about the advantage of
keeping your packages in a library so that you can just update
the library.  The problem with that is that if you want to keep
multiple versions of R on the same system then you will want
to make sure that each R version has packages that run with that
version of R so if you clobber the ones that run with 2.2.0, say, by
overwriting them with 2.3.0 packages then you can no longer use
that library with 2.2.0.  If you keep the packages in .../R/R-2/library
then you can be sure that each R version has the right packages in
its library without messing around.

On 4/26/06, Thomas Harte [EMAIL PROTECTED] wrote:
 the windoze faq that you refer to doesn't quite address the question that i 
 asked, but thanks all the same.

 2.8 What's the best way to upgrade?  That's a matter of taste.  For most 
 people the best thing to do is to uninstall R (see the previous Q), install 
 the new version, copy any installed packages to the library folder in the new 
 installation, run update.packages() in the new R (`Update packages...' from 
 the Packages menu, if you prefer) and then delete anything left of the old 
 installation.  Different versions of R are quite deliberately installed in 
 parallel folders so you can keep old versions around if you wish.
 Upgrading from R 1.x.y to R 2.x.y is special as all the packages need to be 
 reinstalled.  Rather than copy them across, make a note of their names and 
 re-install them from CRAN.


 Christos Hatzis [EMAIL PROTECTED] wrote: See Windows FAQ 2.8 - works well.

 -Christos


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Harte
 Sent: Wednesday, April 26, 2006 2:54 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] copying previously installed libraries to R 2.3.0

 hi all,

 is there a new mechanism in R 2.3.0 for copying libraries from, say, R 2.2.1
 to R 2.3.0? i ask because gabor grothendieck comments in his copydir.bat
 (from gabor's batchfiles at:
 http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip ):

 ``::   I personally upgraded my 2.1.0 to 2.2.0 this way so it seems ok until
  ::   R replaces this with something better which is expected for 2.3.0.
 '''

 see also the posting below.

 cheers,

 thomas.


 [R] copy contributed packages from R 2.2.0 to 2.2.1
This message: [ Message body ]  [ More options ]
Related messages:  [ Next message ] [ Previous message ] [ In reply to ]
 [ Next in thread ]

 From: Ronnie Babigumira
 Date: Fri, 23 Dec 2005 15:58:36 +0100
Hi Helli, this came up last week, Here are some of the replys posted

 1.
  In http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip

 are two Windows XP batch files:

 movedir.bat
  copydir.bat

 which will move the packages (which is much faster and suitable if you don't
 need the old version of R any more) or copy  the packages (which takes
 longer but preserves the old version).

 2.
  x - installed.packages()[,1]
  install.packages(x)

 3.
  This is one reason we normally recommend that you install into a separate
 library.  Then update.packages(checkBuilt =
  TRUE) is all that is needed. However,

 foo - installed.packages()
  as.vector(foo[is.na(foo[, Priority]), 1])

 will give you a character vector which you can feed to install.packages(),
 so it's not complex to do manually.

 4.
  If the previous installation is still alive, fire it up and

 pS - packageStatus()
  pkgs - pS$inst$Package[!pS$inst$Priority %in% c(base, recommended)]
 save(pkgs, file = foo)

 In the new installation,

 load(foo)
  install.packages(pkgs)

 Helmut Kudrnovsky wrote:
  hi R-users,
 
  a few days ago R 2.2.1 came out. on my win xp i'installed R 2.2.0. along
 the time i've installed a lot of contributed packages. my
 internet-connection is not very fast.
 
  so my question: is it possible after installing R 2.2.1 to do copy/paste
 the contributed packages from the C:\Programme\R221 to the
 C:\Programme\R2.2.1- location in the files system?
 
  or have i to download and install the packages new?
 
 
  greetings from the snowy austria
  merry christmas
  helli
 
  system
  R.2.2.0
  win xp
 
  __
  R-help at stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE 

Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Clint Bowman
Roger,

Just for fun I tried your script--nothing wrong with the script, but I
created a seven sided polygon by clicking on seven points and letting
getpoly complete the figure.  At the end I notice that only three of the
seven vertices are coded as being inside the ploygon (the blue points.)

I'd send you a screen dump but I haven't gotten xwd to work with Exceed.
Also I haven't checked any docs to see whether this is a known problem but
suspect that Marc could be surprised by the behavior.

Clint

Clint BowmanINTERNET:   [EMAIL PROTECTED]
Air Dispersion Modeler  INTERNET:   [EMAIL PROTECTED]
Air Quality Program VOICE:  (360) 407-6815
Department of Ecology   FAX:(360) 407-7534

USPS:   PO Box 47600, Olympia, WA 98504-7600
Parcels:300 Desmond Drive, Lacey, WA 98503-1274

On Wed, 26 Apr 2006, Roger Bivand wrote:

 On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote:

  On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote:
   [Please CC me for all replies, since I am not currently subscribed to
   the list.]
  
   Hi all,
  
   I have the following problem/question: Imagine you have a two-
   dimensional plot, and you want to select a number of points, around
   which you could draw a polygon. The points of the polygon are defined
   by clicking in the graphics window (locator()/identify()), all points
   inside the polygon are returned as an object.
  
   Is something like this already implemented?
  
   Thanks a lot in advance,
  
   Florian
 
  I don't know if anyone has created a single function do to this (though
  it is always possible).
 
  However, using:
 
RSiteSearch(points inside polygon)
 
  brings up several function hits that, if put together with the above
  interactive functions, could be used to do what you wish. That is, input
  the matrix of x,y coords of the interactively selected polygon and the
  x,y coords of the underlying points set to return the points inside or
  outside the polygon boundaries.

 This sequence from the splancs package should do it:

 library(splancs)
 set.seed(20060426)
 xy - cbind(x=runif(100), y=runif(100))
 plot(xy)
 poly - getpoly() # this gets the polygon on-screen
 plot(xy)
 polygon(poly)
 io - inout(xy, poly)
 # this returns a logical vector for points in the polygon
 points(xy[io,], pch=16, col=blue)

 Roger

 
  Just as an FYI, you might also want to look at ?chull, which is in the
  base R distribution and returns the set of points on the convex hull of
  the underlying point set. This is to some extent, the inverse of what
  you wish to do.
 
  HTH,
 
  Marc Schwartz
 

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

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


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


Re: [R] Were to find appropriate functions for a given task in R

2006-04-26 Thread Erik Iverson
  Then, people tend to
  define its own functions (I'm doing this too), and a lack of
  standardization makes it difficult to keep everything into control.

If you think of R as more of a language rather than a pre-packaged 
statistical program, I feel that helps.  In the C++ world, there are 
people all over writing classes and functions, and many of these have 
close or duplicate functionality.  As a programmer, you can decide which 
one to use for your needs, or program your own, or extend someone 
else's, the choice is yours.  The same in the R world, you have choices, 
and there does not have to be necessarily only method to do each task.

I don't feel there needs to be 'control', everyone can implement what 
they want.

If you think of R only as a prepacked statistical program however, I can 
see getting frustrated that there are usually many ways to do the same 
thing.  R is much more than this though.  That's how I see it anyway.

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


Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Roger Bivand
On Wed, 26 Apr 2006, Clint Bowman wrote:

 Roger,
 
 Just for fun I tried your script--nothing wrong with the script, but I
 created a seven sided polygon by clicking on seven points and letting
 getpoly complete the figure.  At the end I notice that only three of the
 seven vertices are coded as being inside the ploygon (the blue points.)

Yes, whether a boundary vertex (or point exactly on a boundary line) is 
inside or outside is arbitrary, and the default algorithm isn't picky. 
Setting to bound= argument to TRUE or FALSE uses a different algorithm 
which does what you expect:

 inout(poly, poly, bound=NULL)
[1] FALSE FALSE  TRUE  TRUE  TRUE FALSE FALSE
 inout(poly, poly, bound=TRUE)
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE
 inout(poly, poly, bound=FALSE)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE

Computational geometry gets even more fun beyond 2D!

Roger

 
 I'd send you a screen dump but I haven't gotten xwd to work with Exceed.
 Also I haven't checked any docs to see whether this is a known problem but
 suspect that Marc could be surprised by the behavior.
 
 Clint
 
 Clint Bowman  INTERNET:   [EMAIL PROTECTED]
 Air Dispersion ModelerINTERNET:   [EMAIL PROTECTED]
 Air Quality Program   VOICE:  (360) 407-6815
 Department of Ecology FAX:(360) 407-7534
 
   USPS:   PO Box 47600, Olympia, WA 98504-7600
   Parcels:300 Desmond Drive, Lacey, WA 98503-1274
 
 On Wed, 26 Apr 2006, Roger Bivand wrote:
 
  On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote:
 
   On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote:
[Please CC me for all replies, since I am not currently subscribed to
the list.]
   
Hi all,
   
I have the following problem/question: Imagine you have a two-
dimensional plot, and you want to select a number of points, around
which you could draw a polygon. The points of the polygon are defined
by clicking in the graphics window (locator()/identify()), all points
inside the polygon are returned as an object.
   
Is something like this already implemented?
   
Thanks a lot in advance,
   
Florian
  
   I don't know if anyone has created a single function do to this (though
   it is always possible).
  
   However, using:
  
 RSiteSearch(points inside polygon)
  
   brings up several function hits that, if put together with the above
   interactive functions, could be used to do what you wish. That is, input
   the matrix of x,y coords of the interactively selected polygon and the
   x,y coords of the underlying points set to return the points inside or
   outside the polygon boundaries.
 
  This sequence from the splancs package should do it:
 
  library(splancs)
  set.seed(20060426)
  xy - cbind(x=runif(100), y=runif(100))
  plot(xy)
  poly - getpoly() # this gets the polygon on-screen
  plot(xy)
  polygon(poly)
  io - inout(xy, poly)
  # this returns a logical vector for points in the polygon
  points(xy[io,], pch=16, col=blue)
 
  Roger
 
  
   Just as an FYI, you might also want to look at ?chull, which is in the
   base R distribution and returns the set of points on the convex hull of
   the underlying point set. This is to some extent, the inverse of what
   you wish to do.
  
   HTH,
  
   Marc Schwartz
  
 
  --
  Roger Bivand
  Economic Geography Section, Department of Economics, Norwegian School of
  Economics and Business Administration, Helleveien 30, N-5045 Bergen,
  Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
  e-mail: [EMAIL PROTECTED]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 
 

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

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


[R] left-truncation in survreg

2006-04-26 Thread singyee ling
Dear R-users,

I know that a few people have asked whether survreg handles left-truncation
data and the reply that i have seen so far is that it does.

However, when I try to use survreg on left-truncated data, I got the
following  error message.

 survcs3-survreg(Surv(start,end,status)~AG, data=DPONEcs3,
dist=exponential)

Error in survreg(Surv(start, end, status) ~ AG, data = DPONEcs3, dist =
exponential) :
Invalid survival type

Then i tried

 cc-survreg(Surv(end,status)~AG, data=DPONEcs3, dist=exponential)

and it works perfectly fine.

May I know why survreg does not accept my left-truncated data? I used
similar set of data on coxph and it works fine

Many many thanks for your time and any comments given


kind regards,
sing yee

[[alternative HTML version deleted]]

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


[R] Memory usage and limit

2006-04-26 Thread Min Shao
Hello everyone,

I recently made a 64-bit build of R-2.2.1 under Solaris 9 using gcc v.3.4.2.
The server has 12GB memory, 6 Sparc CPUs and plenty of swap space. I was the
only user at the time of the following experiment.

I wanted to benchmark R's capability to read large data files and used a
data set consisting of 2MM records with 65 variables in each row. All but 2
of the variables are of the character type and the other two are numeric.
The whole data set is about 600 MB when stored as plain ASCII file.

The following code was used in the benchmarking runs:

 c = list(var1=0, var2=0, var3=, var4=, .var65=)
 A - scan(test.dat, skip = 1, sep = ,, what = c, nmax=X,
quiet=FALSE)
 summary(A)
where  = 100 or 200

I made two runs with nmax=100 and nmax=200 respectively. The first
run completed successfully, in about hour of CPU time. However, the actual
memory usage exceeded 2.2GB, about 7 times of the acutal file size on disk.
The second run aborted when the memory usage reached 4GB. The error messgae
is  vector memory exhausted (limit reached?).

Three questions:
1) Why were so much memory and CPU consumed to read 300MB of data? Since
almost all of the variables are character, I expected almost of 1-1 mapping
between file size on disk and that in memory
2) Since this is a 64-bit build, I expected it could handle more than the
600MB of data I used. What does the error message mean? I don't beleive the
vector length exceeded the theoretic limit of about 1 billion.
3) The original file was compressed and I had to uncompress it before the
experiement. Is there a way to read compressed files directly in R

Thanks so much for your help.

Min

[[alternative HTML version deleted]]

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


Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Marc Schwartz (via MN)
Clint,

Not sure why I would be surprised (unless you meant Florian), as I have
not actually used these functions. I simply referenced them as part of
the search to assist Florian.  :-)

However, your reply did make me curious, so I installed the 'splancs'
package along with 'sp' as a dependency. Just for reference, this is on
R 2.3.0 under FC4 compiled from source.

I did run Roger's code, the result of which is attached here as a PDF,
which should come through the list.

While my 7 sided polygon is likely different than yours, the result
seems to be the same. That is, only 3 of the vertices are considered
within the boundary and this is unaffected by the use of the 'bound'
argument to input(). 

The 'bound' argument in inout() does need to be set to TRUE in order for
the boundary points to be considered 'within' the polygon. Otherwise,
with the default NULL, the assignment is arbitrary. Thus, Roger's code,
which has the default NULL value in the call to inout(), could
reasonably result in your/our finding.

One quick guess here might be that the values returned by getpoly() are
not the exact center points of the original dataset, but are the x,y
coords of where the clicks occur. There is a
hand-to-eyeball-coordination margin of error relative to the actual
coords.

Thus, the coordinate values returned by this approach are very slightly
outside the polygon and not picked up by inout() as being on the
boundary.

I tried the followingm using identify() instead:

  library(splancs)
  set.seed(20060426)
  xy - cbind(x=runif(100), y=runif(100))
  plot(xy)

  # Select the SAME 7 vertices here
  pts - identify(xy, n = 7)
  
  # These are the row indices into 'xy'
  # for the coords of the vertices
   pts
  [1] 18 44 51 61 73 89 91
  
   io - inout(xy, xy[pts, ], bound = TRUE, quiet = FALSE)
  Points on boundary:
  [1] 18 44 51 61 73 89 91

Note that the same indices of the points are now returned by inout() as
were selected when using identify(). Note also the setting of 'bound =
TRUE'.

You can now use:

  points(xy[io,], pch=16, col=blue)

to draw BOTH the points inside the polygon and the boundary points as
well.

Thus, this would support my thoughts above, since identify() uses a
'tolerance' argument to identify the actual data points closest the
mouse click, much like all.equal() does with respect to floating point
comparisons.

In a case like this, identify() would seem to be a better choice
relative to selecting the polygon boundary if one wants the exact
boundary points to be considered in or out of the polygon.

HTH,

Marc Schwartz

On Wed, 2006-04-26 at 13:01 -0700, Clint Bowman wrote:
 Roger,
 
 Just for fun I tried your script--nothing wrong with the script, but I
 created a seven sided polygon by clicking on seven points and letting
 getpoly complete the figure.  At the end I notice that only three of the
 seven vertices are coded as being inside the ploygon (the blue points.)
 
 I'd send you a screen dump but I haven't gotten xwd to work with Exceed.
 Also I haven't checked any docs to see whether this is a known problem but
 suspect that Marc could be surprised by the behavior.
 
 Clint

 On Wed, 26 Apr 2006, Roger Bivand wrote:
 
  On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote:
 
   On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote:
[Please CC me for all replies, since I am not currently subscribed to
the list.]
   
Hi all,
   
I have the following problem/question: Imagine you have a two-
dimensional plot, and you want to select a number of points, around
which you could draw a polygon. The points of the polygon are defined
by clicking in the graphics window (locator()/identify()), all points
inside the polygon are returned as an object.
   
Is something like this already implemented?
   
Thanks a lot in advance,
   
Florian
  
   I don't know if anyone has created a single function do to this (though
   it is always possible).
  
   However, using:
  
 RSiteSearch(points inside polygon)
  
   brings up several function hits that, if put together with the above
   interactive functions, could be used to do what you wish. That is, input
   the matrix of x,y coords of the interactively selected polygon and the
   x,y coords of the underlying points set to return the points inside or
   outside the polygon boundaries.
 
  This sequence from the splancs package should do it:
 
  library(splancs)
  set.seed(20060426)
  xy - cbind(x=runif(100), y=runif(100))
  plot(xy)
  poly - getpoly() # this gets the polygon on-screen
  plot(xy)
  polygon(poly)
  io - inout(xy, poly)
  # this returns a logical vector for points in the polygon
  points(xy[io,], pch=16, col=blue)
 
  Roger
 
  
   Just as an FYI, you might also want to look at ?chull, which is in the
   base R distribution and returns the set of points on the convex hull of
   the underlying point set. This is to some extent, the inverse of what
   you wish to do.
  
   HTH,
  
   Marc

[R] Sign of loadings and scores from PCA in cross validation

2006-04-26 Thread Anne S Jacobson
Hi,

The help file on princomp says that 'The signs of the columns of the 
loadings and scores are arbitrary, and so may differ between differnt 
programs for PCA, and even between different builds of R'. Does anyone 
know 

1. Whether this applys to all functions like svd, eigen ... etc? 

2. During a leave-one-out cross step, I notice the loadings also change 
sige when a different observation is held out. This causes the sign change 
of principal component score of the held-out observation. Since I use the 
same version of R, same procedure, and same program, to make the 
leave-one-out PC scores consistent, does that mean I have the take the 
absolute value of these scores before analyzing them?

Thanks in advance for any help!

Anne
[[alternative HTML version deleted]]

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


[R] problem with get command

2006-04-26 Thread Thomas Davidoff
I don't understand what my error is in the following:
I need to use the get command on a series of variables, but can't for
some reason that I don't understand.  Why am I told no such variable as
ov$vn1 after getting a summary report on that very variable?
 summary(ov$vn1)
 Min.  1st Qu.   Median Mean  3rd Qu. Max. NA's
  1.0 25.0 81.0468.1450.0 159100.0   6050.0
 dvars - paste(ov$dvn, 1:4, sep=)
 vars - c(ov$vn1,ov$vn2,ov$vn3,ov$vn4)
 summary(get(vars[1]))
Error in get(x, envir, mode, inherits) : variable ov$vn1 was not found
Execution halted



Thomas Davidoff
Assistant Professor
Haas School of Business
UC Berkeley
Berkeley, CA 94618
Phone:(510) 643-1425
Fax:(510) 643-7357
email:[EMAIL PROTECTED]
web:http://faculty.haas.berkeley.edu/davidoff/

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


Re: [R] help in R

2006-04-26 Thread Anupam Tyagi
Anamika Chaudhuri canamika16 at yahoo.com writes:

 
 Hi,
 
   I cant understand where I am going wrong.Below is my code.I would really 
 appreciate your help.

Dear Anamika, to improve your chances to get a response from this list, and to
help in people responde quickly and accurately to you, please run through your
code line-by-line and identify the line/lines where the problem is: even better
if you can broadly identify what the problem is. It will be difficult for
someone to replicate your programming problem, without having your dataset, and
knowing it's contents. Anupam.

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


Re: [R] problem with get command

2006-04-26 Thread Gabor Grothendieck
ov$vn1 is not a variable.  It is the result of applying the $ function to
the ov and vn1 arguments.

For example, using BOD which is a data frame that comes with R,
rather than get(BOD$Time) use get(BOD)[[Time]]

On 4/26/06, Thomas Davidoff [EMAIL PROTECTED] wrote:
 I don't understand what my error is in the following:
 I need to use the get command on a series of variables, but can't for
 some reason that I don't understand.  Why am I told no such variable as
 ov$vn1 after getting a summary report on that very variable?
  summary(ov$vn1)
 Min.  1st Qu.   Median Mean  3rd Qu. Max. NA's
  1.0 25.0 81.0468.1450.0 159100.0   6050.0
  dvars - paste(ov$dvn, 1:4, sep=)
  vars - c(ov$vn1,ov$vn2,ov$vn3,ov$vn4)
  summary(get(vars[1]))
 Error in get(x, envir, mode, inherits) : variable ov$vn1 was not found
 Execution halted



 Thomas Davidoff
 Assistant Professor
 Haas School of Business
 UC Berkeley
 Berkeley, CA 94618
 Phone:(510) 643-1425
 Fax:(510) 643-7357
 email:[EMAIL PROTECTED]
 web:http://faculty.haas.berkeley.edu/davidoff/

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


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


Re: [R] stl function

2006-04-26 Thread Gabor Grothendieck
stl does this internally:

x - na.action(as.ts(x))

so

stl(x, s.window, na.action = f)

is the same as

stl(f(as.ts(x)), s.window)

e.g.

nottem[25] - NA  # nottem is a built in data set in R
stl(nottem, per) # error
stl(nottem, per, na.action = na.contiguous)
library(zoo)
stl(nottem, per, na.action = na.locf)
stl(nottem, per, na.action = na.approx)

Whether any of these makes sense is another matter.

On 4/26/06, Andrea Toreti [EMAIL PROTECTED] wrote:
 Hi,
 I have a monthly time series with missing values and I would use stl function 
 to identify seasonality.
 I tried all settings of na.action but the result is the same:

  stl(tm245,s.window=11, na.action=na.pass)
 Error in stl(tm245, s.window = 11, na.action = na.pass) :
NA/NaN/Inf in foreign function call (arg 1)

 Can you help me?

 Thanks

 Andrea Toreti
[[alternative HTML version deleted]]

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


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


[R] Incomplete Trio in TDT analysis

2006-04-26 Thread Farrel Buchinsky
I am involved in a study where, as in most of life, men demonstrate
themselves to be recalcitrant. So while we have many probands and most of
their mothers we only have about 50% of the trios being complete.

I have been running tdt and trio.types. It appears as if it is ignoring the
duos. Sometimes a duo can be informative. For instance
Father ..missing
Mother 1/2
Proband 1/1
This duo shows that for allele 2, this was clearly a case where 2 was
untransmitted. 
Yet I do not think this family counts toward the output that is generated.
Am I correct? How do I use R to do TDT analysis where duo's are used if they
are informative?

If you want further details...

I made a subset that I called MessWith and it is made up of the first 24
probands and their parents. 2 probands had neither a mother nor a father. Of
the remaining, probands, 16 only had one parent.
 summary(Genotype.914186)

Number of samples typed: 52 (72.2%)

Allele Frequency: (2 alleles)
   Count Proportion
1 730.7
2 310.3
NA40 NA


Genotype Frequency:
Count Proportion
1/1260.5
1/2210.4
2/2 50.1
NA 20 NA

Heterozygosity (Hu)  = 0.4225168
Poly. Inf. Content   = 0.3309022

tdt(Genotype.914186, MessWith, famid, pid, fatid, motid, sex, affected )
Transmission/disequilibrium test
Data:   Genotype.914186

Untransmitted allele frequencies, informative transmissions
and exact P-values

   Allele Frequency   Transmitted Untransmitted   P-value 
20. 3 2 1.000 

trio.types(Genotype.914186, MessWith, famid, pid, fatid, motid, sex,
affected )

Farrel Buchinsky, MD
Pediatric Otolaryngologist
Allegheny General Hospital
Pittsburgh, PA 


**
This email and any files transmitted with it are confidentia...{{dropped}}

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


[R] help

2006-04-26 Thread Anamika Chaudhuri
Hi,
   
  I was trying to calculate an age adjusted rate for which we have the formula 
as 
  sum(weight*rate)/sum(weight). I am using the framingham dataset called fram 
here.I cant figure out how I could change the logical statement I have for the 
standard dataset (in red) to calculate weight and calculating the wevents and 
atrisk(in red)
  Below is my code:
  
attach(fram)
dset1-cbind(AGE,BMI,DEATH)
BMIGRP1-cut(BMI,breaks=c(14,20,25,57),right=TRUE)
levels(BMIGRP1)
BMIGRP-as.numeric(BMIGRP1)
AGEGRP-floor(AGE/10)-2
dset-cbind(AGEGRP,BMIGRP,DEATH)
std-cbind(AGEGRP)
maxage-max(dset[,1])
minage-min(dset[,1])
maxcls-max(dset[,2], na.rm=T)
mincls-min(dset[,2],na.rm=T)
nage-maxage-minage+1
nclass-maxcls-mincls+1
nsub-nrow(dset)
weight - matrix(0,nage,1)
for ( i in minage:maxage )
  weight[i-minage+1,1] = sum(std=i)
atrisk = matrix(0,nclass,nage)
  wevents = matrix(0,nclass,nage)
  for( i in minage : maxage)
 for( j in mincls : maxcls)
  atrisk[j-mincls+1,i-minage+1] =
 sum((dset[,1]=i) (dset[,2]=j))
wevents[j-mincls+1,i-minage+1]=
  sum((dset[,1]=i) (dset[,2]=j)(dset[,3]=1))
  
#vtit = char(t(mincls:maxcls),5,0) // {Total};
#htit = {'at risk' 'events' 'rate/1000'};
atrisk2 = atrisk // atrisk[+,1:nage];
event2 = wevents // wevents[+,1:nage];
atrisk3 = choose(atrisk2=0,1,atrisk2);
rate = event2/atrisk3;
   
  this was done using sas macro.
   
  Thanks so much!


-

[[alternative HTML version deleted]]

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


Re: [R] problem with get command [Broadcast]

2006-04-26 Thread Liaw, Andy
Sorry, couldn't resist...

From: Gabor Grothendieck
 
 ov$vn1 is not a variable.  It is the result of applying the $ 
 function to the ov and vn1 arguments.

... which would suggest: get($)(get(ov), vn1).  8-)

Andy

 
 For example, using BOD which is a data frame that comes with 
 R, rather than get(BOD$Time) use get(BOD)[[Time]]
 
 On 4/26/06, Thomas Davidoff [EMAIL PROTECTED] wrote:
  I don't understand what my error is in the following:
  I need to use the get command on a series of variables, but 
 can't for 
  some reason that I don't understand.  Why am I told no such 
 variable 
  as ov$vn1 after getting a summary report on that very variable?
   summary(ov$vn1)
  Min.  1st Qu.   Median Mean  3rd Qu. Max. NA's
   1.0 25.0 81.0468.1450.0 159100.0   6050.0
   dvars - paste(ov$dvn, 1:4, sep=)
   vars - c(ov$vn1,ov$vn2,ov$vn3,ov$vn4)
   summary(get(vars[1]))
  Error in get(x, envir, mode, inherits) : variable ov$vn1 was not 
  found Execution halted
 
 
 
  Thomas Davidoff
  Assistant Professor
  Haas School of Business
  UC Berkeley
  Berkeley, CA 94618
  Phone:(510) 643-1425
  Fax:(510) 643-7357
  email:[EMAIL PROTECTED]
  web:http://faculty.haas.berkeley.edu/davidoff/
 
  __
  R-help@stat.math.ethz.ch mailing list 
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 
 
 __
 R-help@stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


Re: [R] Incomplete Trio in TDT analysis

2006-04-26 Thread Steve Buyske
Using only informative incomplete trios and dropping others turns out 
to bias the TDT (Curtis  Sham 95). There are a variety of 
modifications to handle case-parent trios, starting (I think) with 
Weinberg's 1999 paper that uses the EM algorithm and a 
likelihood-ratio test. I don't know of any of these methods that are 
implemented in R. Perhaps they are in the package that you are using 
but forgot to name.

Steve Buyske



At 8:26 PM -0400 4/26/06, Farrel Buchinsky wrote:
I am involved in a study where, as in most of life, men demonstrate
themselves to be recalcitrant. So while we have many probands and most of
their mothers we only have about 50% of the trios being complete.

I have been running tdt and trio.types. It appears as if it is ignoring the
duos. Sometimes a duo can be informative. For instance
Father ..missing
Mother 1/2
Proband 1/1
This duo shows that for allele 2, this was clearly a case where 2 was
untransmitted.
Yet I do not think this family counts toward the output that is generated.
Am I correct? How do I use R to do TDT analysis where duo's are used if they
are informative?

If you want further details...

I made a subset that I called MessWith and it is made up of the first 24
probands and their parents. 2 probands had neither a mother nor a father. Of
the remaining, probands, 16 only had one parent.
  summary(Genotype.914186)

Number of samples typed: 52 (72.2%)

Allele Frequency: (2 alleles)
Count Proportion
1 730.7
2 310.3
NA40 NA


Genotype Frequency:
 Count Proportion
1/1260.5
1/2210.4
2/2 50.1
NA 20 NA

Heterozygosity (Hu)  = 0.4225168
Poly. Inf. Content   = 0.3309022

tdt(Genotype.914186, MessWith, famid, pid, fatid, motid, sex, affected )
 Transmission/disequilibrium test
Data:   Genotype.914186

Untransmitted allele frequencies, informative transmissions
and exact P-values

Allele Frequency   Transmitted Untransmitted   P-value
 20. 3 2 1.000

trio.types(Genotype.914186, MessWith, famid, pid, fatid, motid, sex,
affected )

Farrel Buchinsky, MD
Pediatric Otolaryngologist
Allegheny General Hospital
Pittsburgh, PA


**
This email and any files transmitted with it are confidentia...{{dropped}}

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

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


[R] What are the differences between ACF and PACF in time series analysis?

2006-04-26 Thread Michael
Hi all,

I am desperately looking for answer to my previous question: what are the
differences between ACF and PACF in time series and their applications? I
got confused a lot by these two functions in R... Already having ACF, why do
people decide to create PACF?

Thanks a lot

[[alternative HTML version deleted]]

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


  1   2   >