[R] error message!

2007-08-26 Thread Usman Shehu
Dear R-users,
Can some one help me out. I tried installing some packages in R_2.5.1  but I 
get an error message as shown below. This is unusual since I have been 
installing and updatings packages in the same version of R.

 chooseCRANmirror()
 update.packages(ask='graphics')
Error in .readRDS(pfile) : unknown input format
or
 utils:::menuInstallPkgs()
Error in .readRDS(pfile) : unknown input format


Thanks

usman


  ___ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  
http://uk.promotions.yahoo.com/forgood/environment.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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] error message!

2007-08-26 Thread Duncan Murdoch
On 26/08/2007 6:13 AM, Usman Shehu wrote:
 Dear R-users,
 Can some one help me out. I tried installing some packages in R_2.5.1  but I 
 get an error message as shown below. This is unusual since I have been 
 installing and updatings packages in the same version of R.
 
 chooseCRANmirror()
 update.packages(ask='graphics')
 Error in .readRDS(pfile) : unknown input format
 or
 utils:::menuInstallPkgs()
 Error in .readRDS(pfile) : unknown input format

I'd guess it's a problem with the mirror.  Which one did you choose?  Do 
you get the same error if you choose a different one?

Duncan Murdoch

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


Re: [R] How to provide argument when opening RGui from an external application

2007-08-26 Thread Sébastien
Thanks for your reply.
When you say look into Rscript.exe, do you have a specific document in 
mind ? I tried to google it but could not find much... I forgot to 
mention in my first email that I am working under the Windows XP 
environment.

Prof Brian Ripley a écrit :
 Look into Rscript.exe (on Windows), which is a flexible way to run 
 scripts.  Neither using a GUI nor using source() are recommended.

 On Fri, 24 Aug 2007, Sébastien wrote:

 Dear R-users,

 I have written a small application (in visual basic) that automatically
 generate some R scripts. I would like to execute these scripts when my
 application is being closed.
 My problem is that I don't know how to pass the
 'source(c:/.../myscript.r)' instruction when I programmatically start
 RGui. Tinn-R is capable of doing such things, so I guess there must be a
 way to pass arguments to RGui.

 Any advice or link to relevant references would be greatly appreciated.

 Sebastien


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


Re: [R] fill circles

2007-08-26 Thread Jim Lemon
Cristian cristian wrote:
 Hi all,
 I'm an R newbie,
 I did this script to create a scatterplot using the tree matrix from
 datasets package:
 
 library('datasets')
 with(trees,
 {
 plot(Height, Volume, pch=3, xlab=Height, ylab=Volume)
 symbols(Height, Volume, circles=Girth/12, fg=grey, inches=FALSE,
 add=FALSE)
 }
 )
 
 I'd like to use the column Named Height to fill the circles with colors
 (ex.: the small numbers in green then yellow and the high numbers in red).
 I'd like to have a legend for the size and the colors too.
 I did it manually using a script like that:
 color[(x=0.001)(x0.002)]-#41FF41
 color[(x=0.002)(x0.003)]-#2BFF2B
 color[(x=0.003)(x0.004)]-#09FF09
 color[(x=0.004)(x0.005)]-#00FE00
 color[(x=0.005)(x0.006)]-#00F700
 color[(x=0.006)(x0.007)]-#00E400
 color[(x=0.007)(x0.008)]-#00D600
 color[(x=0.008)(x0.009)]-#00C300 and so on but I don't like to do it
 manually... do know a solution...
 Thank you very much
 chris
 
Hi Chris,
You can transform the numeric values in Height into colors using the 
color.scale function in the plotrix package. The color.legend function 
will allow you to get your legend.

Jim

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


Re: [R] How to provide argument when opening RGui from an external application

2007-08-26 Thread Duncan Murdoch
On 26/08/2007 7:14 AM, Sébastien wrote:
 Thanks for your reply.
 When you say look into Rscript.exe, do you have a specific document in 
 mind ? I tried to google it but could not find much... I forgot to 
 mention in my first email that I am working under the Windows XP 
 environment.

You could try ?Rscript within R, or Rscript --help from the command line 
(assuming you have R's bin directory on your path.

Duncan Murdoch

 
 Prof Brian Ripley a écrit :
 Look into Rscript.exe (on Windows), which is a flexible way to run 
 scripts.  Neither using a GUI nor using source() are recommended.

 On Fri, 24 Aug 2007, Sébastien wrote:

 Dear R-users,

 I have written a small application (in visual basic) that automatically
 generate some R scripts. I would like to execute these scripts when my
 application is being closed.
 My problem is that I don't know how to pass the
 'source(c:/.../myscript.r)' instruction when I programmatically start
 RGui. Tinn-R is capable of doing such things, so I guess there must be a
 way to pass arguments to RGui.

 Any advice or link to relevant references would be greatly appreciated.

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

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


Re: [R] How to provide argument when opening RGui from an external application

2007-08-26 Thread Gabor Grothendieck
There are also some batch files that can be used with Rscript on XP and info
in the README here:

   http://batchfiles.googlecode.com


On 8/26/07, Sébastien [EMAIL PROTECTED] wrote:
 Thanks for your reply.
 When you say look into Rscript.exe, do you have a specific document in
 mind ? I tried to google it but could not find much... I forgot to
 mention in my first email that I am working under the Windows XP
 environment.

 Prof Brian Ripley a écrit :
  Look into Rscript.exe (on Windows), which is a flexible way to run
  scripts.  Neither using a GUI nor using source() are recommended.
 
  On Fri, 24 Aug 2007, Sébastien wrote:
 
  Dear R-users,
 
  I have written a small application (in visual basic) that automatically
  generate some R scripts. I would like to execute these scripts when my
  application is being closed.
  My problem is that I don't know how to pass the
  'source(c:/.../myscript.r)' instruction when I programmatically start
  RGui. Tinn-R is capable of doing such things, so I guess there must be a
  way to pass arguments to RGui.
 
  Any advice or link to relevant references would be greatly appreciated.
 
  Sebastien
 

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


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


[R] R-2.5.1 RedHat EL5 compilation failed

2007-08-26 Thread Wang Chengbin
I can't get R-2.5.1 compiled under RedHat EL5 with gcc 4.1.1. Configure
failed at the following:

checking readline/history.h usability... no
checking readline/history.h presence... no
checking for readline/history.h... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... no
checking for main in -ltermcap... no
checking for main in -ltermlib... no
checking for rl_callback_read_char in -lreadline... no
checking for history_truncate_file... no
configure: error: --with-readline=yes (default) and headers/libs are not
available

Thanks.

[[alternative HTML version deleted]]

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


Re: [R] How to provide argument when opening RGui from an external application

2007-08-26 Thread Prof Brian Ripley

On Sun, 26 Aug 2007, Duncan Murdoch wrote:


On 26/08/2007 7:14 AM, Sébastien wrote:

Thanks for your reply.
When you say look into Rscript.exe, do you have a specific document in 
mind ? I tried to google it but could not find much... I forgot to mention 
in my first email that I am working under the Windows XP environment.


You could try ?Rscript within R, or Rscript --help from the command line 
(assuming you have R's bin directory on your path.


Or read 'An Introduction to R'.



Duncan Murdoch



Prof Brian Ripley a écrit :
Look into Rscript.exe (on Windows), which is a flexible way to run 
scripts.  Neither using a GUI nor using source() are recommended.


On Fri, 24 Aug 2007, Sébastien wrote:


Dear R-users,

I have written a small application (in visual basic) that automatically
generate some R scripts. I would like to execute these scripts when my
application is being closed.
My problem is that I don't know how to pass the
'source(c:/.../myscript.r)' instruction when I programmatically start
RGui. Tinn-R is capable of doing such things, so I guess there must be a
way to pass arguments to RGui.

Any advice or link to relevant references would be greatly appreciated.

Sebastien


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

and provide commented, minimal, self-contained, reproducible code.





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


Re: [R] R-2.5.1 RedHat EL5 compilation failed

2007-08-26 Thread Prof Brian Ripley
Well, the INSTALL file said

   The main source of information on installation is the `R Installation
   and Administration Manual', an HTML copy of which is available as file
   `doc/html/R-admin.html'.  Please read that before installing R.  But
   if you are impatient, read on but please refer to the manual to
   resolve any problems.  (If you obtained R using Subversion, the manual
   is at doc/manual/R-admin.texi.)

and this _is_ discussed there.  Hint: is readline-devel installed?

On Sun, 26 Aug 2007, Wang Chengbin wrote:

 I can't get R-2.5.1 compiled under RedHat EL5 with gcc 4.1.1. Configure
 failed at the following:

 checking readline/history.h usability... no
 checking readline/history.h presence... no
 checking for readline/history.h... no
 checking readline/readline.h usability... no
 checking readline/readline.h presence... no
 checking for readline/readline.h... no
 checking for rl_callback_read_char in -lreadline... no
 checking for main in -lncurses... no
 checking for main in -ltermcap... no
 checking for main in -ltermlib... no
 checking for rl_callback_read_char in -lreadline... no
 checking for history_truncate_file... no
 configure: error: --with-readline=yes (default) and headers/libs are not
 available

 Thanks.

   [[alternative HTML version deleted]]

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


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

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


[R] How to make an array of data.frames?

2007-08-26 Thread Werner Wernersen
Hi,

I am still struggling with the data structures in R. I
know how it works in C++ but how can I get such a
structure in R?

Here is what I want: 
x[a]$dataframe1
x[a]$dataframe2
x[a]$dataframe3
x[b]$dataframe1
x[b]$dataframe2
x[b]$dataframe3
x[c]$dataframe1
x[c]$dataframe2
x[c]$dataframe3

And it would be nice if I could fill in objects a,
b, c one at a time successively.

What is the easiest way to get such a data structure?
It would be great if someone could give me some help
with this. 

Many thanks and kind regards,
  Werner

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


Re: [R] How to make an array of data.frames?

2007-08-26 Thread Gabor Grothendieck
Is this what you want:

DF1 - DF2 - DF3 - df1 - df2 - df3 - head(iris)
list(a = list(DF1, DF2, DF3), b = list(df1, df2, df3))

or

x - list()
x$a - list(DF1, DF2, DF3)
x$b - list(df1, df2, df3)


On 8/26/07, Werner Wernersen [EMAIL PROTECTED] wrote:
 Hi,

 I am still struggling with the data structures in R. I
 know how it works in C++ but how can I get such a
 structure in R?

 Here is what I want:
 x[a]$dataframe1
 x[a]$dataframe2
 x[a]$dataframe3
 x[b]$dataframe1
 x[b]$dataframe2
 x[b]$dataframe3
 x[c]$dataframe1
 x[c]$dataframe2
 x[c]$dataframe3

 And it would be nice if I could fill in objects a,
 b, c one at a time successively.

 What is the easiest way to get such a data structure?
 It would be great if someone could give me some help
 with this.

 Many thanks and kind regards,
  Werner

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


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


Re: [R] fill circles

2007-08-26 Thread hadley wickham
Hi Christian,

You could use the ggplot2 package (http://had.co.nz/ggplot2) which
takes care of many of these details for you:

qplot(Height, Volume, data=trees, size = Girth)
qplot(Height, Volume, data=trees, size = Girth, colour=Height)

You can find more details on the website about how to customise the
scales for your needs, but the defaults should be pretty good.

Hadley

On 8/25/07, Cristian cristian [EMAIL PROTECTED] wrote:
 Hi all,
 I'm an R newbie,
 I did this script to create a scatterplot using the tree matrix from
 datasets package:

 library('datasets')
 with(trees,
 {
 plot(Height, Volume, pch=3, xlab=Height, ylab=Volume)
 symbols(Height, Volume, circles=Girth/12, fg=grey, inches=FALSE,
 add=FALSE)
 }
 )

 I'd like to use the column Named Height to fill the circles with colors
 (ex.: the small numbers in green then yellow and the high numbers in red).
 I'd like to have a legend for the size and the colors too.
 I did it manually using a script like that:
 color[(x=0.001)(x0.002)]-#41FF41
 color[(x=0.002)(x0.003)]-#2BFF2B
 color[(x=0.003)(x0.004)]-#09FF09
 color[(x=0.004)(x0.005)]-#00FE00
 color[(x=0.005)(x0.006)]-#00F700
 color[(x=0.006)(x0.007)]-#00E400
 color[(x=0.007)(x0.008)]-#00D600
 color[(x=0.008)(x0.009)]-#00C300 and so on but I don't like to do it
 manually... do know a solution...
 Thank you very much
 chris

 [[alternative HTML version deleted]]

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



-- 
http://had.co.nz/

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


Re: [R] How to make an array of data.frames?

2007-08-26 Thread Gabor Grothendieck
That gives you a list of data frames. An array is a vector with a dim
attribute to to make it into an array add the appropriate dim attirbute.

If x is the list we created before then:

dim(x) - 2

gives us an array of length 2 each of which has a list of 3 elements
or

dim(x) - 1:2

gives a 1x2 array

or

y - list(DF1, DF2, DF3, df1, df2, df3)
dim(y) - 3:2

gives a 3x2 array so you can write y[[1,2]] for example.
etc.

On 8/26/07, Gabor Grothendieck [EMAIL PROTECTED] wrote:
 Is this what you want:

 DF1 - DF2 - DF3 - df1 - df2 - df3 - head(iris)
 list(a = list(DF1, DF2, DF3), b = list(df1, df2, df3))

 or

 x - list()
 x$a - list(DF1, DF2, DF3)
 x$b - list(df1, df2, df3)


 On 8/26/07, Werner Wernersen [EMAIL PROTECTED] wrote:
  Hi,
 
  I am still struggling with the data structures in R. I
  know how it works in C++ but how can I get such a
  structure in R?
 
  Here is what I want:
  x[a]$dataframe1
  x[a]$dataframe2
  x[a]$dataframe3
  x[b]$dataframe1
  x[b]$dataframe2
  x[b]$dataframe3
  x[c]$dataframe1
  x[c]$dataframe2
  x[c]$dataframe3
 
  And it would be nice if I could fill in objects a,
  b, c one at a time successively.
 
  What is the easiest way to get such a data structure?
  It would be great if someone could give me some help
  with this.
 
  Many thanks and kind regards,
   Werner
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 


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


Re: [R] error message!

2007-08-26 Thread Duncan Murdoch
Usman Shehu wrote:
 It is not. I tried using a number of mirrors, eg Germany, Uk(Bristol), 
 Netherlands, etc.

   
In that case, you'll have to debug it.  Run traceback after the error.  
.readRDS(pfile) is called in several different places; you'll need to 
find out where it's happening, and why it's failing. The traceback() 
will tell you where; you can use debug() on that function to single step 
through until you get to this line, and see what pfile is set to.

BTW, please keep the discussion in R-help; someone else may have better 
contributions than me.

Duncan

 - Original Message 
 From: Duncan Murdoch [EMAIL PROTECTED]
 To: Usman Shehu [EMAIL PROTECTED]
 Cc: r-help@stat.math.ethz.ch
 Sent: Sunday, 26 August, 2007 12:02:13 PM
 Subject: Re: [R] error message!


 On 26/08/2007 6:13 AM, Usman Shehu wrote:
   
 Dear R-users,
 Can some one help me out. I tried installing some packages in R_2.5.1  but I 
 get an error message as shown below. This is unusual since I have been 
 installing and updatings packages in the same version of R.

 
 chooseCRANmirror()
 update.packages(ask='graphics')
   
 Error in .readRDS(pfile) : unknown input format
 or
 
 utils:::menuInstallPkgs()
   
 Error in .readRDS(pfile) : unknown input format
 

 I'd guess it's a problem with the mirror.  Which one did you choose?  Do 
 you get the same error if you choose a different one?

 Duncan Murdoch


   ___
 Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
 now.
 http://uk.answers.yahoo.com/ 


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


Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-26 Thread Duncan Murdoch
Deepayan Sarkar wrote:
 On 8/23/07, Duncan Murdoch [EMAIL PROTECTED] wrote:
   
 On 8/23/2007 11:28 AM, Prof Brian Ripley wrote:
 
 On Thu, 23 Aug 2007, John Kane wrote:

   
 The FAQ Section 7 is a very useful place for new users
 to find out any number of R idiosycracies.  However
 there is no numbering on the FAQ Table of Content or
 on the Sections Tables of Contents.
 
 Hmm, doc/FAQ does have a numbered table of contents and numbered sections
 and doc/manual/R-FAQ.html does have numbered sections and my browser's
 search finds 7.10 straight away.
   
 I think the suggestion is to change the contents lists in HTML from ul
 lists to ol lists.  Then one would see

 1. Introduction
 2. R Basics
 3. R and S
 4. R Web Interfaces
 5. R Add-On Packages
 6. R and Emacs
 7. R Miscellanea
 8. R Programming
 9. R Bugs
10. Acknowledgments

 instead of

  * Introduction
  * R Basics
  * R and S
  * R Web Interfaces
  * R Add-On Packages
  * R and Emacs
  * R Miscellanea
  * R Programming
  * R Bugs
  * Acknowledgments

 in a browser, and I agree that would be preferable (assuming the
 numbering is consistent with what we get in the other formats).
 However, I don't see how to tell makeinfo --html to do this.  Adding
 --number-sections isn't enough.
 

 A simple CSS hack is to have

 ul{
 list-style-type: decimal;
 }

 in the style. The result can be seen in

 http://dsarkar.fhcrc.org/R/RFAQ-1.png

 A more sophisticated hack is to have something like

 ---
 body{
 counter-reset: chapter;
 counter-reset: section;
 }
 h2.chapter {
 counter-increment: chapter;
 counter-reset: section;
 }

 ul {
 list-style-type: none;
 }

 li:before {
 counter-increment: section;
 content: counter(chapter) . counter(section)   ;
 }
 -

 which results in

 http://dsarkar.fhcrc.org/R/RFAQ-2.png

 The only problem here is that there is no way to distinguish between
 the chapter listing and the section listings (both are ul
 class=menu). If that could be made to have a different class, the
 chapter listing could be improved.

I like the first, simple suggestion best; I'll put it into R-devel.  
(With the slight change to use ul.menu instead
of just ul, because FAQ 2.7 includes a plain ul list.)

Duncan Murdoch

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


[R] How is R CMD INSTALL --help executed?

2007-08-26 Thread morphwj
Installation Configuration: Windows XP version 5.1 with Service Pack 2, Rtools 
(bin, MnGW, perl), and HTML HelpWorkshop,  and R-2.5.1.
Files Located: Scrips build, check and install are in C:\Program 
Files\R\R-2.5.1\bin.
Path Verified:  Windows path begins with  c:\Rtools\bin; c:\Rtools\perl\bin; 
c:\Rtools\MinGW\bin; (without quotes).
Documents Being Read: Writing R Extensions, and The Windows toolset in 
R-admin.

The Problem: The example in R Help package.skeleton was created and the 
produced files were edited.  In what window, at what prompt, or in what other 
way is R CMD INSTALL --help  entered or executed?  What additional setup is 
required for the system to recognize this command?
Found example R CMD build --force --binary --auto-zip %1 pkgname in 
search.R-project.org .  What must be done so system can find package pkgname?

Bill Morphet
ATK Launch Systems, RSRM Postfire Evaluation Eng---BeginMessage---
---BeginMessage---
---End Message---
---End Message---
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Program of matrix of seasonal dummy variable(Econometrics)

2007-08-26 Thread hassen62
Dear R users,
I would like to construct a matrix of seasonal dummy variables, such matrix can 
be written as follows(i.e format(T,4))
10   0   0
01   0   0
00   1   0
00   0   1
10   0   0
01   0   0
00   1   0
00   0   1
10   0   0
01   0   0
00   1   0
00   0   1
.. ..
.. . .
  etc
I have written the following small program:
T=100
br-matrix(0,T,4)
for (i in 1:T)
{
+ for (j in 1:4)
{
+ if i=j
{+ br[i,j]=1
+ }
+ if else (abs(i-j)%%4==0)
{+ br[i,j]=1
+}
+ else 
{+ br[i,j]=0
+} 
+}
+} 
I have obtained the following message from R consol:
 T=100
 br-matrix(0,T,4)
 for (i in 1:T)
+  {
+ + for (j in 1:4)
+ {
++ if i=j
Erreur : syntax error, unexpected SYMBOL, expecting '(' dans :


 
 {+ br[i,j]=1
+ + }
Erreur : syntax error, unexpected '}' dans {+ br[i,j]=1
 
+ if else (abs(i-j)%%4==0)
Erreur : syntax error, unexpected ELSE, expecting '(' dans+ if else
 {+ br[i,j]=1
+ +}
Erreur : syntax error, unexpected '}' dans {+ br[i,j]=1
+ else 
Erreur : syntax error, unexpected ELSE dans+ else
 {+ br[i,j]=0
+ +} 
Erreur : syntax error, unexpected '}' dans {+ br[i,j]=0
 +}
Erreur : syntax error, unexpected '}' dans +}
 +} 
Erreur : syntax error, unexpected '}' dans +}
 
I would require if you can rectify my program in order to obtain this matrix of 
seasonal dummies. Many thanks in advance.
[[alternative HTML version deleted]]

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


[R] IRT model nonparametric from Ramsay in R

2007-08-26 Thread Xavier Giovanni Ordóñez Camacho
Hi:
I need to apply the IRT model from Ramsay (1991), He apply the Smoothing Kernel 
to multiple choice test. Is possible in R?.

Thank you,

Xavier G. Ordonez
Doctoral Student

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


[R] partial AUC and SE in R

2007-08-26 Thread Xavier Giovanni Ordóñez Camacho
Hi,

I need to apply the Partial AUC in ROC curves. How I do this?. And I need the 
SE of partial AUC too.

I have been reading ?caTool, ?Epi, ?verification, ?ROC, ?ROCR, ?genefilter and 
more. I only see the partial AUC, but I do not the SE.

Thank you, if you can help me.


Xavier G. Ordoñez
Doctoral Student

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


Re: [R] How is R CMD INSTALL --help executed?

2007-08-26 Thread Duncan Murdoch
On 26/08/2007 3:55 PM, [EMAIL PROTECTED] wrote:
 Installation Configuration: Windows XP version 5.1 with Service Pack 2, 
 Rtools (bin, MnGW, perl), and HTML HelpWorkshop,  and R-2.5.1.
 Files Located: Scrips build, check and install are in C:\Program 
 Files\R\R-2.5.1\bin.
 Path Verified:  Windows path begins with  c:\Rtools\bin; c:\Rtools\perl\bin; 
 c:\Rtools\MinGW\bin; (without quotes).
 Documents Being Read: Writing R Extensions, and The Windows toolset in 
 R-admin.
 
 The Problem: The example in R Help package.skeleton was created and the 
 produced files were edited.  In what window, at what prompt, or in what other 
 way is R CMD INSTALL --help  entered or executed? 

At a command prompt, i.e. in a DOS window, or Cygwin, or some other 
shell, outside of R.

 What additional setup is required for the system to recognize this command?

What you list above should be sufficient.

Duncan Murdoch

 Found example R CMD build --force --binary --auto-zip %1 pkgname in 
 search.R-project.org .  What must be done so system can find package pkgname?
 
 Bill Morphet
 ATK Launch Systems, RSRM Postfire Evaluation Eng
 
 
 
 
 Subject:
 Returned mail: User unknown
 From:
 [EMAIL PROTECTED] (Webmail Postmaster)
 Date:
 Sun, 26 Aug 2007 17:43:16 +
 To:
 [EMAIL PROTECTED]
 
 To:
 [EMAIL PROTECTED]
 
 
 
 
 
 Subject:
 How is R CMD INSTALL --help executed?
 From:
 [EMAIL PROTECTED]
 Date:
 Sun, 26 Aug 2007 17:43:15 +
 To:
 r-help_at_stat.math.ethz.ch
 
 To:
 r-help_at_stat.math.ethz.ch
 BCC:
 [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
 and provide commented, minimal, self-contained, reproducible code.

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


Re: [R] Program of matrix of seasonal dummy variable(Econometrics)

2007-08-26 Thread Gabor Grothendieck
Try this:

 kronecker(rep(1, 3), diag(4))
  [,1] [,2] [,3] [,4]
 [1,]1000
 [2,]0100
 [3,]0010
 [4,]0001
 [5,]1000
 [6,]0100
 [7,]0010
 [8,]0001
 [9,]1000
[10,]0100
[11,]0010
[12,]0001



On 8/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Dear R users,
 I would like to construct a matrix of seasonal dummy variables, such matrix 
 can be written as follows(i.e format(T,4))
 10   0   0
 01   0   0
 00   1   0
 00   0   1
 10   0   0
 01   0   0
 00   1   0
 00   0   1
 10   0   0
 01   0   0
 00   1   0
 00   0   1
 .. ..
 .. . .
  etc
 I have written the following small program:
 T=100
 br-matrix(0,T,4)
 for (i in 1:T)
 {
 + for (j in 1:4)
 {
 + if i=j
 {+ br[i,j]=1
 + }
 + if else (abs(i-j)%%4==0)
 {+ br[i,j]=1
 +}
 + else
 {+ br[i,j]=0
 +}
 +}
 +}
 I have obtained the following message from R consol:
  T=100
  br-matrix(0,T,4)
  for (i in 1:T)
 +  {
 + + for (j in 1:4)
 + {
 ++ if i=j
 Erreur : syntax error, unexpected SYMBOL, expecting '(' dans :
 
 
 
  {+ br[i,j]=1
 + + }
 Erreur : syntax error, unexpected '}' dans {+ br[i,j]=1
 
 + if else (abs(i-j)%%4==0)
 Erreur : syntax error, unexpected ELSE, expecting '(' dans+ if else
  {+ br[i,j]=1
 + +}
 Erreur : syntax error, unexpected '}' dans {+ br[i,j]=1
 + else
 Erreur : syntax error, unexpected ELSE dans+ else
  {+ br[i,j]=0
 + +}
 Erreur : syntax error, unexpected '}' dans {+ br[i,j]=0
  +}
 Erreur : syntax error, unexpected '}' dans +}
  +}
 Erreur : syntax error, unexpected '}' dans +}
 
 I would require if you can rectify my program in order to obtain this matrix 
 of seasonal dummies. Many thanks in advance.
[[alternative HTML version deleted]]

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


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


[R] subset using noncontiguous variables by name (not index)

2007-08-26 Thread Muenchen, Robert A (Bob)
Hi All,

I'm using the subset function to select a list of variables, some of
which are contiguous in the data frame, and others of which are not. It
works fine when I use the form:

subset(mydata,select=c(x1,x3:x5,x7) )

In reality, my list is far more complex. So I would like to store it in
a variable to substitute in for c(x1,x3:x5,x7) but cannot get it to
work. That use of the c function seems to violate R rules, so I'm not
sure how it works at all. A small simulation of the problem is below. 

If the variable names  orders were really this simple, I could use
indices like 

summary( mydata[ ,c(1,3:5,7) ] ) 

but alas, they are not. 

How does the c function work this way in the first place, and how can I
make this substitution?

Thanks,
Bob

mydata - data.frame(
  x1=c(1,2,3,4,5),
  x2=c(1,2,3,4,5),
  x3=c(1,2,3,4,5),
  x4=c(1,2,3,4,5),
  x5=c(1,2,3,4,5),
  x6=c(1,2,3,4,5),
  x7=c(1,2,3,4,5)
)
mydata

# This does what I want.
summary( 
  subset(mydata,select=c(x1,x3:x5,x7) ) 
)

# Can I substitute myVars?
attach(mydata)
myVars1 - c(x1,x3:x5,x7)

# Not looking good!
myVars1

# This doesn't do the right thing.
summary( 
  subset(mydata,select=myVars1 ) 
)

# Total desperation on this attempt:
myVars2 - x1,x3:x5,x7
myVars2

# This doesn't work either.
summary( 
  subset(mydata,select=myVars2 )
)



=
Bob Muenchen (pronounced Min'-chen), Manager 
Statistical Consulting Center
U of TN Office of Information Technology
200 Stokely Management Center, Knoxville, TN 37996-0520
Voice: (865) 974-5230 
FAX: (865) 974-4810
Email: [EMAIL PROTECTED]
Web: http://oit.utk.edu/scc, 
News: http://listserv.utk.edu/archives/statnews.html

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


Re: [R] subset using noncontiguous variables by name (not index)

2007-08-26 Thread Gabor Grothendieck
Using builtin data frame anscombe try this. First we set up a data frame
anscombe.seq which has one row containing 1, 2, 3, ... .  Then select
out from that data frame and unlist it to get the desired index vector.

 anscombe.seq - replace(anscombe[1,], TRUE, seq_along(anscombe))
 idx - unlist(subset(anscombe.seq, select = c(x1, x3:x4, y2)))
 anscombe[idx]
   x1 x3 x4   y2
1  10 10  8 9.14
2   8  8  8 8.14
3  13 13  8 8.74
4   9  9  8 8.77
5  11 11  8 9.26
6  14 14  8 8.10
7   6  6  8 6.13
8   4  4 19 3.10
9  12 12  8 9.13
10  7  7  8 7.26
11  5  5  8 4.74


On 8/26/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
 Hi All,

 I'm using the subset function to select a list of variables, some of
 which are contiguous in the data frame, and others of which are not. It
 works fine when I use the form:

 subset(mydata,select=c(x1,x3:x5,x7) )

 In reality, my list is far more complex. So I would like to store it in
 a variable to substitute in for c(x1,x3:x5,x7) but cannot get it to
 work. That use of the c function seems to violate R rules, so I'm not
 sure how it works at all. A small simulation of the problem is below.

 If the variable names  orders were really this simple, I could use
 indices like

 summary( mydata[ ,c(1,3:5,7) ] )

 but alas, they are not.

 How does the c function work this way in the first place, and how can I
 make this substitution?

 Thanks,
 Bob

 mydata - data.frame(
  x1=c(1,2,3,4,5),
  x2=c(1,2,3,4,5),
  x3=c(1,2,3,4,5),
  x4=c(1,2,3,4,5),
  x5=c(1,2,3,4,5),
  x6=c(1,2,3,4,5),
  x7=c(1,2,3,4,5)
 )
 mydata

 # This does what I want.
 summary(
  subset(mydata,select=c(x1,x3:x5,x7) )
 )

 # Can I substitute myVars?
 attach(mydata)
 myVars1 - c(x1,x3:x5,x7)

 # Not looking good!
 myVars1

 # This doesn't do the right thing.
 summary(
  subset(mydata,select=myVars1 )
 )

 # Total desperation on this attempt:
 myVars2 - x1,x3:x5,x7
 myVars2

 # This doesn't work either.
 summary(
  subset(mydata,select=myVars2 )
 )



 =
 Bob Muenchen (pronounced Min'-chen), Manager
 Statistical Consulting Center
 U of TN Office of Information Technology
 200 Stokely Management Center, Knoxville, TN 37996-0520
 Voice: (865) 974-5230
 FAX: (865) 974-4810
 Email: [EMAIL PROTECTED]
 Web: http://oit.utk.edu/scc,
 News: http://listserv.utk.edu/archives/statnews.html

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


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


Re: [R] subset using noncontiguous variables by name (not index)

2007-08-26 Thread François Pinard
[Muenchen, Robert A (Bob)]

I'm using the subset function to select a list of variables, some of
which are contiguous in the data frame, and others of which are not. It
works fine when I use the form:

subset(mydata,select=c(x1,x3:x5,x7))

In reality, my list is far more complex. So I would like to store it in
a variable to substitute in for c(x1,x3:x5,x7) but cannot get it to
work. That use of the c function seems to violate R rules, so I'm not
sure how it works at all. A small simulation of the problem is below.  

mydata - data.frame(
  x1=c(1,2,3,4,5),
  x2=c(1,2,3,4,5),
  x3=c(1,2,3,4,5),
  x4=c(1,2,3,4,5),
  x5=c(1,2,3,4,5),
  x6=c(1,2,3,4,5),
  x7=c(1,2,3,4,5)
)
mydata

# This does what I want.
summary(subset(mydata, select=c(x1, x3:x5, x7)))

Maybe:

  variables - expression(c(x1, x3:x5, x7))

and later:

  summary(subset(mydata, select=eval(variables)))

However, I do not know how one computes the expression piecemeal, that 
is, better than by building a string and parsing the result.

-- 
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] subset using noncontiguous variables by name (not index)

2007-08-26 Thread Bert Gunter
The problem is that x3:x5 does not mean what you think it means. The only
reason it does the right thing in subset() is because a clever trick is used
there (read the code -- it's not hard to understand) to ensure that it does.
Gabor has essentially mimicked that trick in his solution.

However, it is not necessary do this. You can construct the call directly as
you tried to do. Using the anscombe example, here's how:

chooz - c(x1,x3:x4,y2)  ## enclose the desired expression in quotes
do.call (subset, list( x = anscombe, select = parse(text = chooz)))

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

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Gabor 
 Grothendieck
 Sent: Sunday, August 26, 2007 2:10 PM
 To: Muenchen, Robert A (Bob)
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] subset using noncontiguous variables by name 
 (not index)
 
 Using builtin data frame anscombe try this. First we set up a 
 data frame
 anscombe.seq which has one row containing 1, 2, 3, ... .  Then select
 out from that data frame and unlist it to get the desired 
 index vector.
 
  anscombe.seq - replace(anscombe[1,], TRUE, seq_along(anscombe))
  idx - unlist(subset(anscombe.seq, select = c(x1, x3:x4, y2)))
  anscombe[idx]
x1 x3 x4   y2
 1  10 10  8 9.14
 2   8  8  8 8.14
 3  13 13  8 8.74
 4   9  9  8 8.77
 5  11 11  8 9.26
 6  14 14  8 8.10
 7   6  6  8 6.13
 8   4  4 19 3.10
 9  12 12  8 9.13
 10  7  7  8 7.26
 11  5  5  8 4.74
 
 
 On 8/26/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
  Hi All,
 
  I'm using the subset function to select a list of variables, some of
  which are contiguous in the data frame, and others of which 
 are not. It
  works fine when I use the form:
 
  subset(mydata,select=c(x1,x3:x5,x7) )
 
  In reality, my list is far more complex. So I would like to 
 store it in
  a variable to substitute in for c(x1,x3:x5,x7) but cannot get it to
  work. That use of the c function seems to violate R rules, 
 so I'm not
  sure how it works at all. A small simulation of the problem 
 is below.
 
  If the variable names  orders were really this simple, I could use
  indices like
 
  summary( mydata[ ,c(1,3:5,7) ] )
 
  but alas, they are not.
 
  How does the c function work this way in the first place, 
 and how can I
  make this substitution?
 
  Thanks,
  Bob
 
  mydata - data.frame(
   x1=c(1,2,3,4,5),
   x2=c(1,2,3,4,5),
   x3=c(1,2,3,4,5),
   x4=c(1,2,3,4,5),
   x5=c(1,2,3,4,5),
   x6=c(1,2,3,4,5),
   x7=c(1,2,3,4,5)
  )
  mydata
 
  # This does what I want.
  summary(
   subset(mydata,select=c(x1,x3:x5,x7) )
  )
 
  # Can I substitute myVars?
  attach(mydata)
  myVars1 - c(x1,x3:x5,x7)
 
  # Not looking good!
  myVars1
 
  # This doesn't do the right thing.
  summary(
   subset(mydata,select=myVars1 )
  )
 
  # Total desperation on this attempt:
  myVars2 - x1,x3:x5,x7
  myVars2
 
  # This doesn't work either.
  summary(
   subset(mydata,select=myVars2 )
  )
 
 
 
  =
  Bob Muenchen (pronounced Min'-chen), Manager
  Statistical Consulting Center
  U of TN Office of Information Technology
  200 Stokely Management Center, Knoxville, TN 37996-0520
  Voice: (865) 974-5230
  FAX: (865) 974-4810
  Email: [EMAIL PROTECTED]
  Web: http://oit.utk.edu/scc,
  News: http://listserv.utk.edu/archives/statnews.html
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


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


Re: [R] subset using noncontiguous variables by name (not index)

2007-08-26 Thread Muenchen, Robert A (Bob)
Thanks Bert  Gabor for two very interesting solutions!

It would be very handy in R if string1:stringN generated
string1,string2...stringN it would make selections like this much
more obvious. I know it's easy to with the colon operator and paste
function but that's quite a step up in complexity compared to SAS' x1
x3-x4 y2 or SPSS' x1,x3 to x4, y2. And it's complexity that beginners
face early in learning R.

While on the subject of the colon operator, why doesn't anscombe[[1:4]]
select the x variables in list form as anscombe[,1:4] or anscombe[1:4]
do in data frame form?

Thanks,

Bob

=
Bob Muenchen (pronounced Min'-chen), Manager 
Statistical Consulting Center
U of TN Office of Information Technology
200 Stokely Management Center, Knoxville, TN 37996-0520
Voice: (865) 974-5230 
FAX: (865) 974-4810
Email: [EMAIL PROTECTED]
Web: http://oit.utk.edu/scc, 
News: http://listserv.utk.edu/archives/statnews.html
=


 -Original Message-
 From: Bert Gunter [mailto:[EMAIL PROTECTED]
 Sent: Sunday, August 26, 2007 6:50 PM
 To: 'Gabor Grothendieck'; Muenchen, Robert A (Bob)
 Cc: r-help@stat.math.ethz.ch
 Subject: RE: [R] subset using noncontiguous variables by name (not
 index)
 
 The problem is that x3:x5 does not mean what you think it means. The
 only
 reason it does the right thing in subset() is because a clever trick
is
 used
 there (read the code -- it's not hard to understand) to ensure that it
 does.
 Gabor has essentially mimicked that trick in his solution.
 
 However, it is not necessary do this. You can construct the call
 directly as
 you tried to do. Using the anscombe example, here's how:
 
 chooz - c(x1,x3:x4,y2)  ## enclose the desired expression in quotes
 do.call (subset, list( x = anscombe, select = parse(text = chooz)))
 
 -- 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
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Gabor
  Grothendieck
  Sent: Sunday, August 26, 2007 2:10 PM
  To: Muenchen, Robert A (Bob)
  Cc: r-help@stat.math.ethz.ch
  Subject: Re: [R] subset using noncontiguous variables by name
  (not index)
 
  Using builtin data frame anscombe try this. First we set up a
  data frame
  anscombe.seq which has one row containing 1, 2, 3, ... .  Then
select
  out from that data frame and unlist it to get the desired
  index vector.
 
   anscombe.seq - replace(anscombe[1,], TRUE, seq_along(anscombe))
   idx - unlist(subset(anscombe.seq, select = c(x1, x3:x4, y2)))
   anscombe[idx]
 x1 x3 x4   y2
  1  10 10  8 9.14
  2   8  8  8 8.14
  3  13 13  8 8.74
  4   9  9  8 8.77
  5  11 11  8 9.26
  6  14 14  8 8.10
  7   6  6  8 6.13
  8   4  4 19 3.10
  9  12 12  8 9.13
  10  7  7  8 7.26
  11  5  5  8 4.74
 
 
  On 8/26/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
   Hi All,
  
   I'm using the subset function to select a list of variables, some
 of
   which are contiguous in the data frame, and others of which
  are not. It
   works fine when I use the form:
  
   subset(mydata,select=c(x1,x3:x5,x7) )
  
   In reality, my list is far more complex. So I would like to
  store it in
   a variable to substitute in for c(x1,x3:x5,x7) but cannot get it
to
   work. That use of the c function seems to violate R rules,
  so I'm not
   sure how it works at all. A small simulation of the problem
  is below.
  
   If the variable names  orders were really this simple, I could
use
   indices like
  
   summary( mydata[ ,c(1,3:5,7) ] )
  
   but alas, they are not.
  
   How does the c function work this way in the first place,
  and how can I
   make this substitution?
  
   Thanks,
   Bob
  
   mydata - data.frame(
x1=c(1,2,3,4,5),
x2=c(1,2,3,4,5),
x3=c(1,2,3,4,5),
x4=c(1,2,3,4,5),
x5=c(1,2,3,4,5),
x6=c(1,2,3,4,5),
x7=c(1,2,3,4,5)
   )
   mydata
  
   # This does what I want.
   summary(
subset(mydata,select=c(x1,x3:x5,x7) )
   )
  
   # Can I substitute myVars?
   attach(mydata)
   myVars1 - c(x1,x3:x5,x7)
  
   # Not looking good!
   myVars1
  
   # This doesn't do the right thing.
   summary(
subset(mydata,select=myVars1 )
   )
  
   # Total desperation on this attempt:
   myVars2 - x1,x3:x5,x7
   myVars2
  
   # This doesn't work either.
   summary(
subset(mydata,select=myVars2 )
   )
  
  
  
   =
   Bob Muenchen (pronounced Min'-chen), Manager
   Statistical Consulting Center
   U of TN Office of Information Technology
   200 Stokely Management Center, Knoxville, TN 37996-0520
   Voice: (865) 974-5230
   FAX: (865) 974-4810
   Email: [EMAIL PROTECTED]
   Web: http://oit.utk.edu/scc,
   News: http://listserv.utk.edu/archives/statnews.html
  
   __
   

Re: [R] subset using noncontiguous variables by name (not index)

2007-08-26 Thread Gabor Grothendieck
Try this:

 %:% - function(x, y) {
+prex - gsub([0-9], , x); postx - gsub([^0-9], , x)
+prey - gsub([0-9], , y); posty - gsub([^0-9], , y)
+stopifnot(prex == prey)
+paste(prex, seq(from = as.numeric(postx), to =
as.numeric(posty)), sep = )
+ }
 x2 %:% x4
[1] x2 x3 x4


On 8/26/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
 Thanks Bert  Gabor for two very interesting solutions!

 It would be very handy in R if string1:stringN generated
 string1,string2...stringN it would make selections like this much
 more obvious. I know it's easy to with the colon operator and paste
 function but that's quite a step up in complexity compared to SAS' x1
 x3-x4 y2 or SPSS' x1,x3 to x4, y2. And it's complexity that beginners
 face early in learning R.

 While on the subject of the colon operator, why doesn't anscombe[[1:4]]
 select the x variables in list form as anscombe[,1:4] or anscombe[1:4]
 do in data frame form?

 Thanks,

 Bob

 =
 Bob Muenchen (pronounced Min'-chen), Manager
 Statistical Consulting Center
 U of TN Office of Information Technology
 200 Stokely Management Center, Knoxville, TN 37996-0520
 Voice: (865) 974-5230
 FAX: (865) 974-4810
 Email: [EMAIL PROTECTED]
 Web: http://oit.utk.edu/scc,
 News: http://listserv.utk.edu/archives/statnews.html
 =


  -Original Message-
  From: Bert Gunter [mailto:[EMAIL PROTECTED]
  Sent: Sunday, August 26, 2007 6:50 PM
  To: 'Gabor Grothendieck'; Muenchen, Robert A (Bob)
  Cc: r-help@stat.math.ethz.ch
  Subject: RE: [R] subset using noncontiguous variables by name (not
  index)
 
  The problem is that x3:x5 does not mean what you think it means. The
  only
  reason it does the right thing in subset() is because a clever trick
 is
  used
  there (read the code -- it's not hard to understand) to ensure that it
  does.
  Gabor has essentially mimicked that trick in his solution.
 
  However, it is not necessary do this. You can construct the call
  directly as
  you tried to do. Using the anscombe example, here's how:
 
  chooz - c(x1,x3:x4,y2)  ## enclose the desired expression in quotes
  do.call (subset, list( x = anscombe, select = parse(text = chooz)))
 
  -- 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
 
 
 
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf Of Gabor
   Grothendieck
   Sent: Sunday, August 26, 2007 2:10 PM
   To: Muenchen, Robert A (Bob)
   Cc: r-help@stat.math.ethz.ch
   Subject: Re: [R] subset using noncontiguous variables by name
   (not index)
  
   Using builtin data frame anscombe try this. First we set up a
   data frame
   anscombe.seq which has one row containing 1, 2, 3, ... .  Then
 select
   out from that data frame and unlist it to get the desired
   index vector.
  
anscombe.seq - replace(anscombe[1,], TRUE, seq_along(anscombe))
idx - unlist(subset(anscombe.seq, select = c(x1, x3:x4, y2)))
anscombe[idx]
  x1 x3 x4   y2
   1  10 10  8 9.14
   2   8  8  8 8.14
   3  13 13  8 8.74
   4   9  9  8 8.77
   5  11 11  8 9.26
   6  14 14  8 8.10
   7   6  6  8 6.13
   8   4  4 19 3.10
   9  12 12  8 9.13
   10  7  7  8 7.26
   11  5  5  8 4.74
  
  
   On 8/26/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote:
Hi All,
   
I'm using the subset function to select a list of variables, some
  of
which are contiguous in the data frame, and others of which
   are not. It
works fine when I use the form:
   
subset(mydata,select=c(x1,x3:x5,x7) )
   
In reality, my list is far more complex. So I would like to
   store it in
a variable to substitute in for c(x1,x3:x5,x7) but cannot get it
 to
work. That use of the c function seems to violate R rules,
   so I'm not
sure how it works at all. A small simulation of the problem
   is below.
   
If the variable names  orders were really this simple, I could
 use
indices like
   
summary( mydata[ ,c(1,3:5,7) ] )
   
but alas, they are not.
   
How does the c function work this way in the first place,
   and how can I
make this substitution?
   
Thanks,
Bob
   
mydata - data.frame(
 x1=c(1,2,3,4,5),
 x2=c(1,2,3,4,5),
 x3=c(1,2,3,4,5),
 x4=c(1,2,3,4,5),
 x5=c(1,2,3,4,5),
 x6=c(1,2,3,4,5),
 x7=c(1,2,3,4,5)
)
mydata
   
# This does what I want.
summary(
 subset(mydata,select=c(x1,x3:x5,x7) )
)
   
# Can I substitute myVars?
attach(mydata)
myVars1 - c(x1,x3:x5,x7)
   
# Not looking good!
myVars1
   
# This doesn't do the right thing.
summary(
 subset(mydata,select=myVars1 )
)
   
# Total desperation on this attempt:
myVars2 - x1,x3:x5,x7
myVars2
   
# This doesn't work either.
summary(
 

[R] Help on coxph

2007-08-26 Thread Wei Hu
I am new to R. I just installed R2.5.1 in my computer and tried to use
coxph, but it gives me this message:

No documentation for 'coxph' in specified packages and libraries:
you could try 'help.search(coxph)'

can anyone tell me how to install this package? 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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help on coxph

2007-08-26 Thread Daniel Malter
In the R-surface menu, go to packages - install packages. Select a
server and install the package survival. Then, on the prompt, type:
library(survival)

Then it works. Look up the numerous manual on using R if you need further
help. If that's not the issue, give us more detailed information on the
problem.

Daniel 


PhD Program Strategy
Dept. of Management and Organization
Robert H. Smith School of Business   
University of Maryland
Van Munching Hall   
College Park, MD  20742
www.rhsmith.umd.edu
www.umd.edu

mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Wei Hu
Gesendet: Sunday, August 26, 2007 9:49 PM
An: r-help@stat.math.ethz.ch
Betreff: [R] Help on coxph

I am new to R. I just installed R2.5.1 in my computer and tried to use
coxph, but it gives me this message:

No documentation for 'coxph' in specified packages and libraries:
you could try 'help.search(coxph)'

can anyone tell me how to install this package? 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
and provide commented, minimal, self-contained, reproducible code.

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


[R] R 2.5.1 - Rscript through tee

2007-08-26 Thread François Pinard
Hi, people.

I met a little problem for which someone might have a solution.  Let's 
say I have an executable file (named pp.R) with this contents:

   #!/usr/bin/Rscript
   options(echo=TRUE)
   a - 1
   Sys.sleep(3)
   a - 2

If I execute ./pp.R at the shell prompt, the output shows the timely 
progress of the script as expected.  If I use ./pp.R | tee OUT 
instead, the output seems buffered and I see it all at once at the end.

The problem does not come from the tee program, as if I use this 
command:

   (echo a; sleep 5; echo b) | tee OUT

the output is timely, not batched.

So, is there a way to tell R (or Rscript) that standard output should be 
unbuffered, even if it is not directly connected to a terminal?

In case useful, here is local R information:

Version:
 platform = x86_64-unknown-linux-gnu
 arch = x86_64
 os = linux-gnu
 system = x86_64, linux-gnu
 status = 
 major = 2
 minor = 5.1
 year = 2007
 month = 06
 day = 27
 svn rev = 42083
 language = R
 version.string = R version 2.5.1 (2007-06-27)

Locale:
LC_CTYPE=fr_CA.UTF-8;LC_NUMERIC=C;LC_TIME=fr_CA.UTF-8;LC_COLLATE=fr_CA.UTF-8;LC_MONETARY=fr_CA.UTF-8;LC_MESSAGES=fr_CA.UTF-8;LC_PAPER=fr_CA.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=fr_CA.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:utils, package:datasets, fp.etc, 
package:graphics, package:grDevices, package:methods, Autoloads, package:base

-- 
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
and provide commented, minimal, self-contained, reproducible code.