[R] R-help ordinal regression

Iasonas Lamprianou lamprianou at yahoo.com
Wed Mar 24 13:47:13 CET 2010


Dear colleagues,

i am carrying out an ordinal regression model. I try it on SPSS but I "flirt" with R as well. I have a few questions.

1. What is the most reliable/tested/trusted package for ordinal regression in the R world? 

2. Also, I have a statistical question. What is the danger of having to many 'empty cells' in ordinal regression? How many empty cells are too many? Do you have a reference for me to read?

Thank you for the support

Dr. Iasonas Lamprianou


Assistant Professor (Educational Research and Evaluation)
Department of Education Sciences
European University-Cyprus
P.O. Box 22006
1516 Nicosia
Cyprus 
Tel.: +357-22-713178
Fax: +357-22-590539


Honorary Research Fellow
Department of Education
The University of Manchester
Oxford Road, Manchester M13 9PL, UK
Tel. 0044  161 275 3485
iasonas.lamprianou at manchester.ac.uk


--- On Wed, 24/3/10, r-help-request at r-project.org <r-help-request at r-project.org> wrote:

> From: r-help-request at r-project.org <r-help-request at r-project.org>
> Subject: R-help Digest, Vol 85, Issue 24
> To: r-help at r-project.org
> Date: Wednesday, 24 March, 2010, 11:00
> Send R-help mailing list submissions
> to
>     r-help at r-project.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>     https://stat.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body 'help'
> to
>     r-help-request at r-project.org
> 
> You can reach the person managing the list at
>     r-help-owner at r-project.org
> 
> When replying, please edit your Subject line so it is more
> specific
> than "Re: Contents of R-help digest..."
> 
> 
> Today's Topics:
> 
>    1. help (fredrick devadoss)
>    2. Re: help (Ista Zahn)
>    3. Re: Mosaic plots (Jay Emerson)
>    4. rdcomclient issue - member not found
> when using borders
>       (Jason Baucom)
>    5. Re: If else statements (Matthew
> Dowle)
>    6. Re: Problem installing package (David
> Winsemius)
>    7. caret package, how can I deal with
> RFE+SVM wrong message?
>       (bbslover)
>    8. information module Wilks' lambda
> criterion (Catherine ENG)
>    9. Transform data set (Thomas Jensen)
>   10. R-installation regarding. (fredrick devadoss)
>   11. Re: estimation of parameters with grofit
> (alexander russell)
>   12. Re: Embed R code in C++ (mans)
>   13. Re: Calling R functions into C# or C++
> (ManInMoon)
>   14. Re: help with survival package (Shankavaram, Uma
> (NIH/NCI) [E])
>   15. Re: Transform data set (stephen sefick)
>   16. Re: Transform data set (Wincent)
>   17. Re: help with survival package (David
> Winsemius)
>   18. Re: R-installation regarding. (Paul Hiemstra)
>   19. Re: Embed R code in C++ (Romain Francois)
>   20. Re: If else statements (tj)
>   21. Re: If else statements (R Help)
>   22. Converting date format (Hosack, Michael)
>   23. no predict function in lme4 ? (Markus Loecher)
>   24. Re: Converting date format (Nutter, Benjamin)
>   25. Solutions for memory problems (packages ff,
> bigmemory)?
>       (hhafner at statistik-hessen.de)
>   26. multi-stage sampling and hierarchical models:
> which packages?
>       (Steve Powell)
>   27. glmpath and coxpath variables (Antoni
> Picornell)
>   28. using a list to index elements of a list
> (Pj253)
>   29. Re: using a list to index elements of a list
> (Benilton Carvalho)
>   30. Re: using a list to index elements of a list
> (Pj253)
>   31. Re: using a list to index elements of a list
> (Benilton Carvalho)
>   32. Re: using a list to index elements of a list
> (William Dunlap)
>   33. Re: If else statements (tj)
>   34. barplot (stacked) (koj)
>   35. Re: Converting date format (jim holtman)
>   36. Re: caret package, how can I deal with RFE+SVM
> wrong message?
>       (Max Kuhn)
>   37. Sample size for proportion, not binomial (Prew,
> Paul)
>   38. Re: using a list to index elements of a list
> (Pj253)
>   39. Re: using a list to index elements of a list
> (Benilton Carvalho)
>   40. Re: filled.contour formatting questions (John K.
> Williams)
>   41. Re: Changing global variables from functions
> (jtouyz)
>   42. Optim() Help, Unusual Error (ApproxGaussian)
>   43. R Participation in the Google Summer of Code
> 2010
>       (Dirk Eddelbuettel)
>   44. qplot(ggplo2): axis label sizes/colors (milton
> ruser)
>   45. Re: qplot(ggplo2): axis label sizes/colors (Xie
> Chao)
>   46. Displaying equations from .Rd files (AC Del Re)
>   47. Operator overloading for custom classes
> (Chidambaram Annamalai)
>   48. Re: information module Wilks' lambda criterion
> (Charles C. Berry)
>   49. Creating pdfs using qplot in qqplot2 (Bos,
> Roger)
>   50. Re: Creating pdfs using qplot in qqplot2
> (stephen sefick)
>   51. Conditional replacement of NA depending on value
> in the
>       previous column (Mark Na)
>   52. Re: Conditional replacement of NA depending on
> value in the
>       previous column (Phil Spector)
>   53. Re: Creating pdfs using qplot in qqplot2
> (Sharpie)
>   54. Re: If else statements (Sharpie)
>   55. rpad ? (sjaffe)
>   56. Re: Operator overloading for custom classes
> (Sharpie)
>   57. Re: Optim() Help, Unusual Error (Nikhil Kaza)
>   58. Re: Optim() Help, Unusual Error
> (ApproxGaussian)
>   59. Re: rpad ? (sjaffe)
>   60. Re: no predict function in lme4 ? (Douglas
> Bates)
>   61. Re: help needed with boxplot (kathy_BJ)
>   62. Re: rpad ? (Sharpie)
>   63. Re: rpad ? (sjaffe)
>   64. Re: rpad ? (Sharpie)
>   65. Re: Operator overloading for custom classes
>       (Chidambaram Annamalai)
>   66. Re: rpad ? (Erich Neuwirth)
>   67. Saving tab/csv delimited data with NaN's (shankar at bios.unc.edu)
>   68. Re: Saving tab/csv delimited data with NaN's
> (Rolf Turner)
>   69. Adding matrix rows that have the same name?
> (Sarah Berke)
>   70. Re: rpad ? (Philippe Grosjean)
>   71. Re: Adding matrix rows that have the same name?
>       (Henrique Dallazuanna)
>   72. Re: Setting breaks to data more appropriately
> (ROLL Josh F)
>   73. Re: rpad ? (j verzani)
>   74. Re: Sample size for proportion, not binomial
> (Marc Schwartz)
>   75. Re: Optim() Help, Unusual Error (Nikhil Kaza)
>   76. Re: Setting breaks to data more appropriately
> (David Winsemius)
>   77. Bold greek letters using plotmath (Jim Price)
>   78. Diffusion entropy analysis (Andrew Rominger)
>   79. Re: Saving tab/csv delimited data with NaN's
> (Sharpie)
>   80. Plot ``freezes''. (Rolf Turner)
>   81. Re: Log linear model - Showing non-deviation
> form in glm()
>       (Christoffer Karlsson)
>   82. Re: Saving tab/csv delimited data with NaN's
> (Rolf Turner)
>   83. Changing axis origin for plot (Ralf B)
>   84. Re: Saving tab/csv delimited data with NaN's
> (Sharpie)
>   85. Re: Adding matrix rows that have the same name?
> (Dennis Murphy)
>   86. Monte Carlo simulation in R (Hongwei Dong)
>   87. Re: no predict function in lme4 ? (Ben Bolker)
>   88. Re: rpad ? (Tom Short)
>   89. Re: Monte Carlo simulation in R (David
> Winsemius)
>   90. Getting choropleth map intervals correct
> (LCOG1)
>   91. with data in the form of an R data objecte:
> Monte Carlo
>       simulation in R (Hongwei Dong)
>   92. Re: Saving tab/csv delimited data with NaN's
> (Viswanathan Shankar)
>   93. how to solve error in precict( ) while using
> with rpart?
>       (vibha patel)
>   94. Re: Bold greek letters using plotmath (Prof
> Brian Ripley)
>   95. R and/or REngine kills Java (Ralf B)
>   96. Re: Plot ``freezes''. (Prof Brian Ripley)
>   97. how to make a histogram with non-numeric x's?
> (cbarcelo)
>   98. Re: Affymetrix Cancer Dataset (Jim Silverton)
>   99. Re: Affymetrix Cancer Dataset (Henrik
> Bengtsson)
>   100. Re: Changing axis origin for plot (Jim Lemon)
>   101. Re: how to make a histogram with non-numeric
> x's? (Jim Lemon)
>   102. Re: Monte Carlo simulation in R ( (Ted
> Harding))
>   103. R Full Screen (Simon Kiss)
>   104. Re: help needed with boxplot (Jim Lemon)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 23 Mar 2010 04:43:53 -0700 (PDT)
> From: fredrick devadoss <fredrick_isro at yahoo.com>
> To: r-help at r-project.org
> Subject: [R] help
> Message-ID: <608970.84382.qm at web36508.mail.mud.yahoo.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Hello All,
> 
> I am new to R and tried to install R in Linux system (OS:
> Open SUSE).
> After untar the source code, changed the directory, and
> typed the
> command ./configure, it was checking a list...finally it
> gave an error
> message. Here with i have enclosed the error message.
> 
> Check-list goes like this:
> 
> checking if g++ supports -c -o file.o... yes
> checking if g++ supports -c -o file.o... (cached) yes
> checking whether the g++ linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs...
> immediate
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> checking for gfortran option to produce PIC... -fPIC
> checking if gfortran PIC flag -fPIC works... yes
> checking if gfortran static flag -static works... yes
> checking if gfortran supports -c -o file.o... yes
> checking if gfortran supports -c -o file.o... (cached) yes
> checking whether the gfortran linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs...
> immediate
> checking for cos in -lm... yes
> checking for sin in -lm... yes
> checking for dlopen in -ldl... yes
> 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... yes
> 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
> 
> Can anyone help me in this regard?
> 
> Expecting your reply and thanks in advance.
> 
> Warm regards
> Fredrick.
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 23 Mar 2010 08:04:35 -0400
> From: Ista Zahn <istazahn at gmail.com>
> To: fredrick devadoss <fredrick_isro at yahoo.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] help
> Message-ID:
>     <f55e7cf51003230504t5f6f97cfn9354276af6a3bab5 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi Fredrick,
> Is there a reason you need to compile the source code? If
> not, I
> recommend following the instillation instructions on CRAN.
> OpenSuse
> instructions are at http://cran.r-project.org/bin/linux/suse/
> 
> Best,
> Ista
> 
> On Tue, Mar 23, 2010 at 7:43 AM, fredrick devadoss
> <fredrick_isro at yahoo.com>
> wrote:
> > Hello All,
> >
> > I am new to R and tried to install R in Linux system
> (OS: Open SUSE).
> > After untar the source code, changed the directory,
> and typed the
> > command ./configure, it was checking a list...finally
> it gave an error
> > message. Here with i have enclosed the error message.
> >
> > Check-list goes like this:
> >
> > checking if g++ supports -c -o file.o... yes
> > checking if g++ supports -c -o file.o... (cached) yes
> > checking whether the g++ linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> > checking dynamic linker characteristics... GNU/Linux
> ld.so
> > checking how to hardcode library paths into
> programs... immediate
> > checking if libtool supports shared libraries... yes
> > checking whether to build shared libraries... yes
> > checking whether to build static libraries... no
> > checking for gfortran option to produce PIC... -fPIC
> > checking if gfortran PIC flag -fPIC works... yes
> > checking if gfortran static flag -static works... yes
> > checking if gfortran supports -c -o file.o... yes
> > checking if gfortran supports -c -o file.o... (cached)
> yes
> > checking whether the gfortran linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> > checking dynamic linker characteristics... GNU/Linux
> ld.so
> > checking how to hardcode library paths into
> programs... immediate
> > checking for cos in -lm... yes
> > checking for sin in -lm... yes
> > checking for dlopen in -ldl... yes
> > 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... yes
> > 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
> >
> > Can anyone help me in this regard?
> >
> > Expecting your reply and thanks in advance.
> >
> > Warm regards
> > Fredrick.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> -- 
> Ista Zahn
> Graduate student
> University of Rochester
> Department of Clinical and Social Psychology
> http://yourpsyche.org
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Tue, 23 Mar 2010 08:10:21 -0400
> From: Jay Emerson <jayemerson at gmail.com>
> To: r-help at r-project.org,
> sunitap22 at gmail.com
> Subject: Re: [R] Mosaic plots
> Message-ID:
>     <d4588dec1003230510i5f6b3b3cnd4f30af34b9bd9f1 at mail.gmail.com>
> Content-Type: text/plain
> 
> As pointed out by others, vcd supports mosaic plots on top
> of the grid
> engine (which is extremely helpful for those of us who love
> playing around
> with grid).  The standard mosaicplot() function is
> directly available (it
> isn't clear if you knew this).  The proper display of
> names is a real
> challenge faced by all of us with these plots, so  you
> should try each
> version.  I'm not sure what you intend to do with a
> legend, but if you want
> the ability to customize and hack code, I suggest you look
> at grid and a
> modification to vcd's version to suit your purposes.
> 
> Jay
> 
> >
> >
> >
> >
> >> Subject: [R] Mosaic Plots
> >> Message-ID: <1269256874432-1677468.post at n4.nabble.com>
> >> Content-Type: text/plain; charset=us-ascii
> >>
> >>
> >> Hello Everyone
> >>
> >> I want to plot Moasic Plots, I have tried them
> using iplots package (using
> >> imosaic). The problem is the names dont get
> alligned properly, is there a
> >> way to a align the names and provide legend in
> Mosaic plots using R?
> >>
> >> Also I would like to know any other packages using
> which I can plot Mosaic
> >> Plots
> >>
> >>
> >> Thank you in advance
> >> Sunita
> >> --
> >>
> >>
> > --
> > John W. Emerson (Jay)
> > Associate Professor of Statistics
> > Department of Statistics
> > Yale University
> > http://www.stat.yale.edu/~jay <http://www.stat.yale.edu/%7Ejay>
> >
> 
> 
> 
> -- 
> John W. Emerson (Jay)
> Associate Professor of Statistics
> Department of Statistics
> Yale University
> http://www.stat.yale.edu/~jay
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Tue, 23 Mar 2010 09:17:21 -0400
> From: "Jason Baucom" <jason.baucom at ateb.com>
> To: <r-help at r-project.org>
> Subject: [R] rdcomclient issue - member not found when
> using borders
> Message-ID:
>     <7C0800F63CCF4149AC0FC5EE2A04122606D4CAF0 at sr002-2k3exc.ateb.com>
> Content-Type: text/plain
> 
> I wrote a procedure to create a spreadsheet using
> rdcomclient. It uses a
> function to do the writing and runs "correctly" in
> isolation. It gives
> errors, but it continues to completion. The error I receive
> is "Error:
> Member not found". If I place it inside a for loop the loop
> fails after
> the first iteration, once it reaches the error.
> 
>  
> 
> Has anyone had experience with this error? Here is the code
> that is
> causing the problem.
> 
>  
> 
>  
> 
> library(RDCOMClient)
> 
> source("http://www.omegahat.org/RDCOMClient/examples/excelUtils3.R")
> 
> xls <- COMCreate("Excel.Application")
> 
> xls[["Visible"]] <- TRUE
> 
> wb = xls[["Workbooks"]]$Add(1)
> 
>  
> 
> sh = wb[["Worksheets"]]$Add()
> 
> sh[["Name"]] <- as.character(tabName)
> 
>  
> 
>  
> 
>  
> 
> AnalyzeExport <- function(sh,Data,Cell,Title1,Title2) {
> 
>  
> letters<-c("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","
> P","Q","R","S","T","U","V","W","X","Y","Z")
> 
>     print(Cell)
> 
>     exportDataFrame(Data, at = sh$Range(Cell))
> 
>  
> 
>     B3R<-sh$Range(Cell)
> 
>     B3R[["Formula"]] <- Title1
> 
>     #B3R[["HorizontalAlignment"]]<-"xlRight"
> 
>  
> 
>  
> B3R<-sh$Range(paste(letters[grep(substring(Cell,1,1),letters)+1],substri
> ng(Cell,2),sep=""))
> 
>     B3R[["Formula"]] <- Title2
> 
>     #B3R[["HorizontalAlignment"]]<-"xlLeft"
> 
>  
> 
>     B3R<-sh$Range(paste(substring(Cell,1,1),
> as.integer(substring(Cell,2))+1+nrow(Data),sep=""))
> 
>     B3R[["Formula"]] <- "Total"
> 
>  
> 
>    
> B3R<-sh$Range(paste(letters[grep(substring(Cell,1,1),letters)+1],
> as.integer(substring(Cell,2))+1+nrow(Data),sep=""))
> 
>    
> Cell1<-paste(letters[grep(substring(Cell,1,1),letters)],
> as.integer(substring(Cell,2))+1,sep="")
> 
>    
> Cell2<-paste(letters[grep(substring(Cell,1,1),letters)+1],
> as.integer(substring(Cell,2))+nrow(Data),sep="")
> 
>     MyCell=paste(Cell1,":",Cell2,sep="")
> 
>     B3R[["Formula"]] <-
> paste("=sum(",MyCell,")",sep="")
> 
>  
> 
>     print(MyCell)
> 
>  
> 
>     B3RB <- sh$Range(MyCell)
> 
>    
> B3RB[["Borders"]][["LineStyle"]]<-as.integer(1)
> 
>     #B3RB[["ColumnWidth"]]<-20
> 
> }
> 
>   
> 
>  
> 
> AnalyzeExport(sh,ExcelCopy,"B2","NDC","Unique Pats")
> 
>  
> 
> The line that is causing the problem is :
> 
> B3RB[["Borders"]][["LineStyle"]]<-as.integer(1)
> 
>  
> 
> On another note, I'd also love to learn how to change
> columnWidth and
> HorizontalAligment properly (the code commented out).
> 
>  
> 
> Jason Baucom
> 
> Ateb, Inc. 
> 
> 2600 Sumner Blvd. Suite 158
> 
> Raleigh, NC 27616
> 
> www.ateb.com <http://www.ateb.com/> 
> 
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Tue, 23 Mar 2010 13:23:28 -0000
> From: "Matthew Dowle" <mdowle at mdowle.plus.com>
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] If else statements
> Message-ID: <hoafci$3or$1 at dough.gmane.org>
> 
> Here are some references. Please read these first and post
> again if you are 
> still stuck after reading them. If you do post again, we
> will need x and y.
> 
> 1. Introduction to R : 9.2.1 Conditional execution: if
> statements.
> 2. R Language Definition : 3.2 Control structures.
> 3. R for beginners by E Paradis : 6.1 Loops and
> vectorization
> 4. Eric Raymond's essay "How to Ask Questions The Smart
> Way" 
> http://www.catb.org/~esr/faqs/smart-questions.html.
> 
> HTH
> Matthew
> 
> 
> "tj" <girlme80 at yahoo.com>
> wrote in message 
> news:1269325933723-1678705.post at n4.nabble.com...
> >
> > Hi everyone!
> > May I request again for your help?
> > I need to make some codes using if else statements...
> > Can I do an "if-else statement" inside an "if-else
> statement"? Is this the
> > correct form of writing it?
> > Thank you.=)
> >
> > Example:
> >
> > for (v in 1:6) {
> > for (i in 2:200) {
> > if (v==1)
> > (if max(x*v-y*v)>1 break())
> >
> > if (v==2)
> > (if max(x*v-y*v)>1.8 break())
> >
> > if (v==3)
> > (if max(x*v-y*v)>2 break())
> > }
> > }
> > -- 
> > View this message in context: 
> > http://n4.nabble.com/If-else-statements-tp1678705p1678705.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Tue, 23 Mar 2010 09:25:54 -0400
> From: David Winsemius <dwinsemius at comcast.net>
> To: "Craig Woodward" <c.woodward1 at uq.edu.au>
> Cc: r-help at r-project.org
> Subject: Re: [R] Problem installing package
> Message-ID: <A6B135B0-30E6-4EC7-AD12-37D0BAD66633 at comcast.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed;
> delsp=yes
> 
> The "inner components" of object are not accessible by
> name. You need  
> to use the proper functions to retrieve or modify them. You
> are asked  
> by the PostingGuide to show your code and be more specific
> about  
> problems. Until you do so, that is about all anyone will be
> able to  
> say about your mistakes.
> 
> -- 
> David.
> On Mar 23, 2010, at 4:17 AM, Craig Woodward wrote:
> 
> > Dear r-help users,
> >
> >
> >
> > I have just downloaded the package vegan and I have
> problems accessing
> > the data to go through the examples in the tutorial. I
> can see the  
> > data
> > when I type "data()" but I am told that the data
> doesn't exist when I
> > type the name of one of the variables e.g.:
> >
> >> varespec
> >
> > Error: object 'varespec' not found
> >
> >
> >
> > I suspect this could be a way I have my files
> organised or that I have
> > not set a working directory? I am new to R so I
> suspect I have  
> > probably
> > made a simple mistake.
> >
> -- 
> David Winsemius, MD
> West Hartford, CT
> 
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Tue, 23 Mar 2010 00:42:00 -0800 (PST)
> From: bbslover <dluthm at yeah.net>
> To: r-help at r-project.org
> Subject: [R] caret package, how can I deal with RFE+SVM
> wrong message?
> Message-ID: <1269333720793-1678800.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Hello, 
>    
> I am learning caret package, and I want to use the RFE to
> reduce the
> feature. I want to use RFE coupled Random Forest (RFE+FR)
> to complete this
> task. As we know, there are a number of pre-defined sets of
> functions, like
> random Forest(rfFuncs), however,I want to tune the
> parameters (mtr) when
> RFE, and then I write code below, but there is something
> wrong message, How
> can I deal with it?  
> > rfGrid<-expand.grid(.mtry=c(1:2))
> >
> rfectrl<-rfeControl(functions=caretFuncs,method="cv",verbose=F,returnResamp="final",number=10)
> > subsets<-c(3,4)
> > set.seed(2)
> >
> rf.RFE<-rfe(trx,try,sizes=subsets,rfeControl=rfectrl,method="rf",tuneGrid=rfGrid)
> Loading required package: class
> 
> Attaching package: 'class'
> 
> 
>         The following object(s) are
> masked from package:reshape :
> 
>          condense 
> 
> Fitting: mtry=1 
> Fitting: mtry=2 
> Error in varImp.randomForest(object$finalModel, ...) : 
>   subscript out of bounds
> In addition: Warning message:
> package 'e1071' was built under R version 2.10.1 
> 
> 
> At the same time, If I want to  use RFE+SVM, 
> RFE+nnet, and so on ,how can I
> do? I have try RFE+SVM, also wrong message:>
> set.seed(1)
> > svmProfile<-rfe(trx,try,sizes=c(1:3),
> +         
>    rfeControl=rfeControl(functions=caretFuncs,method="cv",
> +         
>    verbose=F,returnResamp="final",number=10),
> +         
>    method="svmRadial",tuneLength=5)
> Fitting: sigma=0.009246713, C=0.1 
> Fitting: sigma=0.009246713, C=1 
> Fitting: sigma=0.009246713, C=10 
> Fitting: sigma=0.009246713, C=100 
> Fitting: sigma=0.009246713, C=1000 
> Error in rfeControl$functions$rank(fitObject, .x, y) : 
>   need importance columns for each class
> 
> thank you!
> -- 
> View this message in context: http://n4.nabble.com/caret-package-how-can-I-deal-with-RFE-SVM-wrong-message-tp1678800p1678800.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 8
> Date: Tue, 23 Mar 2010 10:37:23 +0100
> From: Catherine ENG <caths.eng at gmail.com>
> To: r-help at r-project.org
> Subject: [R] information module Wilks' lambda criterion
> Message-ID:
>     <311165821003230237l4f983d3aj5cb7532f6fef246c at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi everybody,
> 
> I was wondering if you can help me about a module. In fact,
> I'm looking for
> a package or module about Wilks' lambda criterion in R
> environment. I didn't
> find it in R website (
> http://cran.cict.fr/web/packages/index.html#available-packages-W
> or
> http://search.cpan.org/faq.html).
> If this module exists, could you show me the command line.
> 
> Thank you very much for your help,
> Miss Catherine ENG
> 
> 
> -----
> Laboratoire de Génétique et Microbiologie UMR INRA 1128 -
> IFR 110
> Université Henri Poincaré - Faculté des Sciences BP 239
> 54506 Vandoeuvre-lès-Nancy
> Tél. : 06.58.25.37.66
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 9
> Date: Tue, 23 Mar 2010 10:47:17 +0100
> From: Thomas Jensen <thomas.jensen at eup.gess.ethz.ch>

> To: r-help at r-project.org
> Subject: [R] Transform data set
> Message-ID: <1269337637.3281.9.camel at thomas-laptop>
> Content-Type: text/plain; charset="UTF-8"
> 
> Dear R Experts,
> 
> I am having some trouble creating a variable in R. I have
> data on
> self-placement of voters, their placement of parties, and
> which party
> they feel closest to. The data is structured like this:
> 
>  Party_Close   
> lrplaceself   
> lrplaceParty1    lrplaceParty2
> ...    
>    party1   
>     2       
> 4        5 
>    party2   
>     5       
> 6        4
>    party1   
>     6       
> 2        1
> 
> etc...
> 
> I want to format the data set so it looks like this:
> 
> Party_Close   
> lrplacepartyclose       
> lrplaceself
>   party1       
> 4            2
>   party2       
> 4            5
>   party1       
> 2            6
> 
> Any help is greatly appreciated!
> 
> With kind regards,
> Thomas
> 
> 
> 
> ------------------------------
> 
> Message: 10
> Date: Tue, 23 Mar 2010 03:07:43 -0700 (PDT)
> From: fredrick devadoss <fredrick_isro at yahoo.com>
> To: R-help at R-project.org
> Subject: [R] R-installation regarding.
> Message-ID: <81117.66243.qm at web36502.mail.mud.yahoo.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Hello All,
> 
> I am new to R and tried to install R in Linux system (OS:
> Open SUSE). After untar the source code, changed the
> directory, and typed the command ./configure, it was
> checking a list...finally it gave an error message. Here
> with i have enclosed the error message.
> 
> Check-list goes like this:
> 
> checking if g++ supports -c -o file.o... yes
> checking if g++ supports -c -o file.o... (cached) yes
> checking whether the g++ linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs...
> immediate
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> checking for gfortran option to produce PIC... -fPIC
> checking if gfortran PIC flag -fPIC works... yes
> checking if gfortran static flag -static works... yes
> checking if gfortran supports -c -o file.o... yes
> checking if gfortran supports -c -o file.o... (cached) yes
> checking whether the gfortran linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs...
> immediate
> checking for cos in -lm... yes
> checking for sin in -lm... yes
> checking for dlopen in -ldl... yes
> 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... yes
> 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
> 
> Can anyone help me in this regard?
> 
> Expecting your reply and thanks in advance.
> 
> Warm regards
> Fredrick.
> 
> 
> 
> ------------------------------
> 
> Message: 11
> Date: Tue, 23 Mar 2010 19:22:02 +0700
> From: alexander russell <ssv736 at gmail.com>
> To: r-help at r-project.org
> Subject: Re: [R] estimation of parameters with grofit
> Message-ID:
>     <b6510ff51003230522p769e81f2yb9c69bc72d3eca67 at mail.gmail.com>
> Content-Type: text/plain
> 
> Hello again about grofit:
> I've been looking at the grofit explanatory pdf, but it
> seems to me that
> it's missing a little bit of commentary as to the
> multiplicity of
> 'experiments'. For example, what is the minimum number of
> data points(not
> time points) to obtain a model? Would it be similar to the
> approximately 12
> that we read will give us a basic regression?
> regards,
> shfets
> 
> On Mon, Mar 22, 2010 at 2:43 PM, alexander russell <ssv736 at gmail.com>
> wrote:
> 
> > Hello,
> > I'm trying to understand grofit's estimation of
> models, and fairly new to
> > growth models generally. The data used by grofit
> consists of the vector of
> > "experiments", that is the growth values for a vector
> of individuals
> > measured at different times. Can I understand
> correctly that the program
> > estimates parameters for the growth model based on a
> regression(linear or
> > non linear) analysis of the data at time 1 to time 2,
> then time 2 to time 3,
> > building a curve piecewise?
> > regards,
> > shfets
> >
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 12
> Date: Tue, 23 Mar 2010 04:34:35 -0800 (PST)
> From: mans <m.chouaha at hotmail.com>
> To: r-help at r-project.org
> Subject: Re: [R] Embed R code in C++
> Message-ID: <1269347675339-1678986.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> No, I didnt install Rcpp but i have R 2.10.1 already
> installed.
> What's the difference with Rinside and Rcpp?
> 
> Do i need both to embed R code in C++ file or just one of
> them ?
> 
> Could you tell me where can i get Rcpp pkg?
> How can i Install it because i dont know how to compile a
> source file on the
> terminal.
> 
> Thanks very much for your help.
> 
> -- 
> View this message in context: http://n4.nabble.com/Embed-R-code-in-C-tp1677784p1678986.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 13
> Date: Tue, 23 Mar 2010 04:51:05 -0800 (PST)
> From: ManInMoon <xmoon2000 at googlemail.com>
> To: r-help at r-project.org
> Subject: Re: [R] Calling R functions into C# or C++
> Message-ID: <1269348665105-1679002.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Fayssal,
> 
> This zip file appears to be corrupted - do you have another
> version?
> -- 
> View this message in context: http://n4.nabble.com/Calling-R-functions-into-C-or-C-tp904267p1679002.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 14
> Date: Tue, 23 Mar 2010 09:29:55 -0400
> From: "Shankavaram, Uma (NIH/NCI) [E]" <uma at mail.nih.gov>
> To: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] help with survival package
> Message-ID:
>     <996D816825CFEA469870126E9050D3F0BD39461A at NIHMLBX11.nih.gov>
> Content-Type: text/plain; charset="us-ascii"
> 
> I am trying use survfit function in survival package, but
> getting an error that
> Error in survfit:  could not find function
> "survfit.km"
> 
> This package was working fine previously. I am using 
> R version 2.9.2 on Windows.
> 
> Can anyone tell me if this is a bug in the function code or
> something is missing in the newer version of R.
> 
> I appreciate any help regarding this.
> 
> Thanks
> 
> Uma
> 
> 
> 
> ------------------------------
> 
> Message: 15
> Date: Tue, 23 Mar 2010 08:30:48 -0500
> From: stephen sefick <ssefick at gmail.com>
> To: Thomas Jensen <thomas.jensen at eup.gess.ethz.ch>
> Cc: r-help at r-project.org
> Subject: Re: [R] Transform data set
> Message-ID:
>     <c502a9e11003230630k42abdc9alb885eb98655c01e5 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> I am not entirely sure what you are trying to do.  Are
> you wanting to
> re-arrange the columns or apply some sort of
> transformation?
> 
> On Tue, Mar 23, 2010 at 4:47 AM, Thomas Jensen
> <thomas.jensen at eup.gess.ethz.ch>
> wrote:
> > Dear R Experts,
> >
> > I am having some trouble creating a variable in R. I
> have data on
> > self-placement of voters, their placement of parties,
> and which party
> > they feel closest to. The data is structured like
> this:
> >
> > ?Party_Close ? ?lrplaceself ? ? lrplaceParty1 ?
> lrplaceParty2 ...
> > ? party1 ? ? ? ? ? ? ? 2 ? ? ? ? ? ? ? 4 ? ? ? ? ? ? ?
> 5
> > ? party2 ? ? ? ? ? ? ? 5 ? ? ? ? ? ? ? 6 ? ? ? ? ? ? ?
> 4
> > ? party1 ? ? ? ? ? ? ? 6 ? ? ? ? ? ? ? 2 ? ? ? ? ? ? ?
> 1
> >
> > etc...
> >
> > I want to format the data set so it looks like this:
> >
> > Party_Close ? ? lrplacepartyclose ? ? ? ? ?
> lrplaceself
> > ?party1 ? ? ? ? ? ? ? ?4 ? ? ? ? ? ? ? ? ? ? ? 2
> > ?party2 ? ? ? ? ? ? ? ?4 ? ? ? ? ? ? ? ? ? ? ? 5
> > ?party1 ? ? ? ? ? ? ? ?2 ? ? ? ? ? ? ? ? ? ? ? 6
> >
> > Any help is greatly appreciated!
> >
> > With kind regards,
> > Thomas
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> -- 
> Stephen Sefick
> 
> Let's not spend our time and resources thinking about
> things that are
> so little or so large that all they really do for us is
> puff us up and
> make us feel like gods.  We are mammals, and have not
> exhausted the
> annoying little problems of being mammals.
> 
>            
>            
>         -K. Mullis
> 
> 
> 
> ------------------------------
> 
> Message: 16
> Date: Tue, 23 Mar 2010 21:32:42 +0800
> From: Wincent <ronggui.huang at gmail.com>
> To: Thomas Jensen <thomas.jensen at eup.gess.ethz.ch>
> Cc: r-help at r-project.org
> Subject: Re: [R] Transform data set
> Message-ID:
>     <38b9f0351003230632w75fa0207n9e42eecb85831b38 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Looks like this way,
> 
> dat$lrplacepartyclose <- NA
> 
> dat$lrplacepartyclose[dat$Party_Close=="party1"] <-
> dat$lrplaceParty1[dat$Party_Close=="party1"]
> 
> dat$lrplacepartyclose[dat$Party_Close=="party2"] <-
> dat$lrplaceParty2[dat$Party_Close=="party2"]
> 
> and goes on and on.
> 
> 
> On 23 March 2010 17:47, Thomas Jensen <thomas.jensen at eup.gess.ethz.ch>
> wrote:
> > Dear R Experts,
> >
> > I am having some trouble creating a variable in R. I
> have data on
> > self-placement of voters, their placement of parties,
> and which party
> > they feel closest to. The data is structured like
> this:
> >
> > ?Party_Close ? ?lrplaceself ? ? lrplaceParty1 ?
> lrplaceParty2 ...
> > ? party1 ? ? ? ? ? ? ? 2 ? ? ? ? ? ? ? 4 ? ? ? ? ? ? ?
> 5
> > ? party2 ? ? ? ? ? ? ? 5 ? ? ? ? ? ? ? 6 ? ? ? ? ? ? ?
> 4
> > ? party1 ? ? ? ? ? ? ? 6 ? ? ? ? ? ? ? 2 ? ? ? ? ? ? ?
> 1
> >
> > etc...
> >
> > I want to format the data set so it looks like this:
> >
> > Party_Close ? ? lrplacepartyclose ? ? ? ? ?
> lrplaceself
> > ?party1 ? ? ? ? ? ? ? ?4 ? ? ? ? ? ? ? ? ? ? ? 2
> > ?party2 ? ? ? ? ? ? ? ?4 ? ? ? ? ? ? ? ? ? ? ? 5
> > ?party1 ? ? ? ? ? ? ? ?2 ? ? ? ? ? ? ? ? ? ? ? 6
> >
> > Any help is greatly appreciated!
> >
> > With kind regards,
> > Thomas
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> -- 
> Wincent Ronggui HUANG
> Doctoral Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> http://asrr.r-forge.r-project.org/rghuang.html
> 
> 
> 
> ------------------------------
> 
> Message: 17
> Date: Tue, 23 Mar 2010 09:40:55 -0400
> From: David Winsemius <dwinsemius at comcast.net>
> To: "Shankavaram, Uma (NIH/NCI) [E]" <uma at mail.nih.gov>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] help with survival package
> Message-ID: <A4CE8738-99BF-47C5-8088-6E1F64460E97 at comcast.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed;
> delsp=yes
> 
> 
> On Mar 23, 2010, at 6:13 AM, Shankavaram, Uma (NIH/NCI) [E]
> wrote:
> 
> >
> > I am trying use survfit function in survival package,
> but getting an  
> > error that
> > Error in survfit:  could not find function
> "survfit.km"
> >
> > This package was working fine previously. I am
> using  R version  
> > 2.9.2 on Windows.
> 
> If you are using the current version of package survival
> with the  
> prior version of R it should not be a surprise if there
> are  
> incompatibilities.
> 
> >
> > Can anyone tell me if this is a bug in the function
> code or  
> > something is missing in the newer version of R.
> 
> No code, .... no comment.
> 
> >
> > I appreciate any help regarding this.
> >
> > Thanks
> 
> See that message at the bottom of every posting? Please
> read for  
> meaning.
> -- 
> 
> David Winsemius, MD
> West Hartford, CT
> 
> 
> 
> ------------------------------
> 
> Message: 18
> Date: Tue, 23 Mar 2010 14:41:15 +0100
> From: Paul Hiemstra <p.hiemstra at geo.uu.nl>
> To: fredrick devadoss <fredrick_isro at yahoo.com>
> Cc: R-help at r-project.org
> Subject: Re: [R] R-installation regarding.
> Message-ID: <4BA8C4FB.6070403 at geo.uu.nl>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> Hi Frederick,
> 
> The development files for readline are not available.
> Install them to 
> get this working. For debian/ubuntu the package to install
> is called 
> libreadline-dev or something. SUSE's package manager might
> have a 
> similar package. Alternatively you can skip installing R
> from source and 
> use binary packages that are available in .dev, .rpm etc
> from CRAN [1]. 
> This ensures you have the latest version of R and that
> upgrading is done 
> through the package manager of SUSE, minimizing your work.
> 
> cheers,
> Paul
> 
> [1] http://cran.r-project.org/bin/linux/suse/
> 
> fredrick devadoss wrote:
> > Hello All,
> >
> > I am new to R and tried to install R in Linux system
> (OS: Open SUSE). After untar the source code, changed the
> directory, and typed the command ./configure, it was
> checking a list...finally it gave an error message. Here
> with i have enclosed the error message.
> >
> > Check-list goes like this:
> >
> > checking if g++ supports -c -o file.o... yes
> > checking if g++ supports -c -o file.o... (cached) yes
> > checking whether the g++ linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> > checking dynamic linker characteristics... GNU/Linux
> ld.so
> > checking how to hardcode library paths into
> programs... immediate
> > checking if libtool supports shared libraries... yes
> > checking whether to build shared libraries... yes
> > checking whether to build static libraries... no
> > checking for gfortran option to produce PIC... -fPIC
> > checking if gfortran PIC flag -fPIC works... yes
> > checking if gfortran static flag -static works... yes
> > checking if gfortran supports -c -o file.o... yes
> > checking if gfortran supports -c -o file.o... (cached)
> yes
> > checking whether the gfortran linker
> (/usr/i586-suse-linux/bin/ld) supports shared libraries...
> yes
> > checking dynamic linker characteristics... GNU/Linux
> ld.so
> > checking how to hardcode library paths into
> programs... immediate
> > checking for cos in -lm... yes
> > checking for sin in -lm... yes
> > checking for dlopen in -ldl... yes
> > 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... yes
> > 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
> >
> > Can anyone help me in this regard?
> >
> > Expecting your reply and thanks in advance.
> >
> > Warm regards
> > Fredrick.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >   
> 
> 
> -- 
> Drs. Paul Hiemstra
> Department of Physical Geography
> Faculty of Geosciences
> University of Utrecht
> Heidelberglaan 2
> P.O. Box 80.115
> 3508 TC Utrecht
> Phone:  +3130 274 3113 Mon-Tue
> Phone:  +3130 253 5773 Wed-Fri
> http://intamap.geo.uu.nl/~paul
> 
> 
> 
> ------------------------------
> 
> Message: 19
> Date: Tue, 23 Mar 2010 14:49:20 +0100
> From: Romain Francois <romain at r-enthusiasts.com>
> To: mans <m.chouaha at hotmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Embed R code in C++
> Message-ID: <4BA8C6E0.2030809 at r-enthusiasts.com>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> Le 23/03/10 13:34, mans a ?crit :
> > No, I didnt install Rcpp but i have R 2.10.1 already
> installed.
> 
> If you want to use RInside, you need Rcpp. This is what
> dependencies are 
> for. you can install Rcpp from R :
> 
> install.packages( "Rcpp" )
> 
> > What's the difference with Rinside and Rcpp?
> 
> Rcpp defines a set of classes to ease writing C++ code in R
> packages. 
> you can think it as c++ inside R.
> 
> RInside facilitates embedding R in a c++ application, you
> can think it 
> as R inside c++.
> 
> > Do i need both to embed R code in C++ file or just one
> of them ?
> 
> You don't __need__ any of them, but thy will make the
> process easier.
> 
> > Could you tell me where can i get Rcpp pkg?
> 
> cran, but google knows and would have given you the answer
> more quickly.
> 
> > How can i Install it because i dont know how to
> compile a source file on the
> > terminal.
> > Thanks very much for your help.
> 
> 
> -- 
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
> http://romainfrancois.blog.free.fr
> |- http://tr.im/OIXN : raster images and RImageJ
> |- http://tr.im/OcQe : Rcpp 0.7.7
> `- http://tr.im/O1wO : highlight 0.1-5
> 
> 
> 
> ------------------------------
> 
> Message: 20
> Date: Tue, 23 Mar 2010 05:40:19 -0800 (PST)
> From: tj <girlme80 at yahoo.com>
> To: r-help at r-project.org
> Subject: Re: [R] If else statements
> Message-ID: <1269351619842-1679073.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Thanks Matthew... I will read your suggested
> articles/files.
> I hope, i will be able to figure out what should be done
> with this. 
> =)
> 
> ~tj
> 
> -- 
> View this message in context: http://n4.nabble.com/If-else-statements-tp1678705p1679073.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 21
> Date: Tue, 23 Mar 2010 11:08:37 -0300
> From: R Help <rhelp.stats at gmail.com>
> To: tj <girlme80 at yahoo.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] If else statements
> Message-ID:
>     <c84ed6951003230708k1414055ar3fb7f0484daa1d26 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> The short answer is yes, you can, but your syntax is
> wrong.  You need
> to make sure you wrap your conditions inside brackets, and
> use {, not
> (, to delineate your if statements.
> 
> > for (v in 1:6) {
> > for (i in 2:200) {
> > if (v==1){
>    if (max(x*v-y*v)>1)
>      break()
>   }
>   }
>   }
>  et cetera
> 
> On Tue, Mar 23, 2010 at 3:32 AM, tj <girlme80 at yahoo.com>
> wrote:
> >
> > Hi everyone!
> > May I request again for your help?
> > I need to make some codes using if else statements...
> > Can I do an "if-else statement" inside an "if-else
> statement"? Is this the
> > correct form of writing it?
> > Thank you.=)
> >
> > Example:
> >
> > for (v in 1:6) {
> > for (i in 2:200) {
> > if (v==1)
> > (if max(x*v-y*v)>1 break())
> >
> > if (v==2)
> > (if max(x*v-y*v)>1.8 break())
> >
> > if (v==3)
> > (if max(x*v-y*v)>2 break())
> > }
> > }
> > --
> > View this message in context: http://n4.nabble.com/If-else-statements-tp1678705p1678705.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 22
> Date: Tue, 23 Mar 2010 10:10:50 -0400
> From: "Hosack, Michael" <mhosack at state.pa.us>
> To: "R-help at r-project.org"
> <R-help at r-project.org>
> Subject: [R] Converting date format
> Message-ID:
>     <E41D7FA2CA85D6448617E05E0F9A05569B8F328A6C at ENHBGMBX07.PA.LCL>
> Content-Type: text/plain; charset="us-ascii"
> 
> R community:
> 
> Hello, I would to like to convert a character date variable
> from %m/%d/%Y to %m/%d/%y. Any advice would be greatly
> appreciated. I have tried functions for changing the
> formatting and removing the unnecessary digits without
> success.
> 
> Mike
> 
> 
> 
> ------------------------------
> 
> Message: 23
> Date: Tue, 23 Mar 2010 10:18:51 -0400
> From: Markus Loecher <markus.loecher at gmail.com>
> To: r-help at r-project.org
> Subject: [R] no predict function in lme4 ?
> Message-ID:
>     <bf460e021003230718p6438189ua7b6250083d3854b at mail.gmail.com>
> Content-Type: text/plain
> 
> Dear mixed effects modelers,
> I seem unable to find a predict method for mer objects in
> the package lme4.
> Am I not seeing the forest for the trees ?
> 
> Any pointer would be very helpful.
> Thanks,
> Markus
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 24
> Date: Tue, 23 Mar 2010 10:16:17 -0400
> From: "Nutter, Benjamin" <NutterB at ccf.org>
> To: "Hosack, Michael" <mhosack at state.pa.us>,
> R-help at r-project.org
> Subject: Re: [R] Converting date format
> Message-ID:
>     <07773E68C32A644CA47651463E79E5C203228267 at CCHSCLEXMB68.cc.ad.cchs.net>
> Content-Type: text/plain; charset=us-ascii
> 
> If x is your vector of character date variables:
> 
> orig.date <- as.Date(x, format=c("%m/%d/%Y"))
> new.date <- format(x, format=c("%m/%d/%y"))
> 
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org]
> On Behalf Of Hosack, Michael
> Sent: Tuesday, March 23, 2010 10:11 AM
> To: R-help at r-project.org
> Subject: [R] Converting date format
> 
> R community:
> 
> Hello, I would to like to convert a character date variable
> from
> %m/%d/%Y to %m/%d/%y. Any advice would be greatly
> appreciated. I have
> tried functions for changing the formatting and removing
> the unnecessary
> digits without success.
> 
> Mike
> 
> ______________________________________________
> R-help at r-project.org
> 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.
> 
> 
> ===================================
> 
> P Please consider the environment before printing this
> e-mail
> 
> Cleveland Clinic is ranked one of the top hospitals
> in America by U.S.News & World Report (2009).  
> Visit us online at http://www.clevelandclinic.org for
> a complete listing of our services, staff and
> locations.
> 
> 
> Confidentiality Note:  This message is intended for
> use\...{{dropped:13}}
> 
> 
> 
> ------------------------------
> 
> Message: 25
> Date: Tue, 23 Mar 2010 15:38:23 +0100
> From: hhafner at statistik-hessen.de
> To: r-help at r-project.org
> Subject: [R] Solutions for memory problems (packages ff,
> bigmemory)?
> Message-ID:
>     <OFC1970CD7.45B5C716-ONC12576EF.004ED305-C12576EF.00507B69 at statistik-hessen.de>
>     
> Content-Type: text/plain; charset="US-ASCII"
> 
> Hello,
> 
> I want to impute missing values using the package mi. My
> file has around 
> 28 MB (50.000 observations, 120 variables). My computer is
> a Windows XP 
> 32-bit machine, 4 GB Duo Core processor.
> When I run mi, already after some minutes during iteration
> 1, I get the 
> message that a vector allocation fails. Even with a 10%
> sample of the 
> dataset, it doesn't work.
> 
> I've read about the packages ff and bigmemory. Can they
> help me that the 
> mi package doesn't use the RAM for temporary files but the
> hard drive 
> instead? Since I'm not a R expert, I don't understand
> completely how these 
> packages work. Or are there other packages for a better
> memory management? 
> Or is really a 64-bit OS the only solution for this
> problem? I hope that 
> there are some suggestions for my problem since many R
> procedures seem to 
> be very promising but they don't work on my machine because
> of the memory 
> limitation.
> 
> Thanks,
> Hans-Peter
> 
> 
> 
> ------------------------------
> 
> Message: 26
> Date: Tue, 23 Mar 2010 15:39:33 +0100
> From: Steve Powell <steve at promente.net>
> To: R-help <R-help at stat.math.ethz.ch>
> Subject: [R] multi-stage sampling and hierarchical models:
> which
>     packages?
> Message-ID:
>     <3c5a49361003230739x190c5e7axda9c94ea26996a5e at mail.gmail.com>
> Content-Type: text/plain
> 
> Dear wizaRds,
> I have a dataset to analyse which is causing me problems.
> It is a sample of
> parents in schools. First we had a population table of the
> schools in the
> country in question divided into five regions, and in each
> region we have an
> urban/rural split. The population Ns in these ten cells are
> known. Then
> three schools were drawn from each cell according to the
> Lahirie method, i.e
> with probability of being selected depending on school
> size. Students were
> then drawn randomly from the schools, again with
> probability proportional to
> school size. Details of this are below in case this is
> important. I have
> calculated the weights.
> 
> So I have a weighting problem and a mixed levels problem at
> the same time.
> Even if I just use the survey package I am not sure how to
> specify the
> model, because I have clusters within strata rather than
> strata within
> clusters.
> 
> I guess it would look something like
> dstrat<-svydesign(id=~schoolC,strata=~region+urbanrural,
> weights=~newweight,
> data=mydataset,nest=T),
> but this gives the same results as
> dstrat<-svydesign(id=~schoolC,strata=~region,
> weights=~newweight,
> data=mydataset,nest=T)
> 
> And I can't see any way to look at the mixed levels effects
> using that
> package. Perhaps I am better advised to use nlme; I guess I
> can just use the
> weights as a covariate?
> 
> My ultimate aims are to conduct various regressions in
> which I expect the
> school- and region-level effects to be strong. Ideally I
> would like to use
> sem as well, but then I am really stuck.
> If someone could put me on the right track I could be more
> specific with
> reproducible examples etc
> 
> 
> Best Wishes
> Steve Powell
> ******************details of Lahirie method as we used it:
> the schools were
> put into a list in order of ascending size (student
> population) and this
> list was divided into three bands containing 25%, 35% and
> 40% of all the
> students in the cell, respectively; and three schools were
> chosen randomly
> from each size band. Then samples of students were drawn
> randomly from lists
> of students at each school, so that more students were
> chosen from the
> larger schools: 20, 30 and 40 from each of the smaller,
> medium and large
> schools. So we have (20+30+40)*3 students per cell, for 10
> cells = 2700
> students in this country.
> 
> www.promente.org | skype stevepowell99 | Thailand +66 8
> 4438 2667
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 27
> Date: Tue, 23 Mar 2010 15:48:31 +0100
> From: Antoni Picornell <urnenfelder at gmail.com>
> To: R-help <R-help at r-project.org>
> Subject: [R] glmpath and coxpath variables
> Message-ID:
>     <564eb82f1003230748v287d6ee2n56a08bd70f6706d5 at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi,
> 
> I am analyzing a set of variables in order to create a
> survival model for a
> set of patients. I have checked the reference manual for
> glm path and
> coxpath in order to achieve it. However I have a doubt
> about the class of
> the covariates I can use with the last mentioned package.
> 
> In the example, the package loads a list called
> "lung.data". This object has
> a matrix with the covariate information "x" and two vectors
> about the
> censoring and the time to the event. The information in the
> x matrix seems
> to be numeric, but some of the covariates could be
> categorical (1st and 2nd
> columns) because they only have 2 or 4 different values. If
> we check their
> "class" they are numeric.
> 
> Thus, the question is: can I use categorical and continuous
> covariates in
> this matrix (x)?
> 
> Thanks a lot,
> Antoni.
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 28
> Date: Tue, 23 Mar 2010 06:53:45 -0800 (PST)
> From: Pj253 <pj253 at cam.ac.uk>
> To: r-help at r-project.org
> Subject: [R] using a list to index elements of a list
> Message-ID: <1269356025503-1679184.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> I have a list of vectors, x, with x[[1]]=1:5, say.
> 
> And I need to go through each element of each vector in a
> for loop.
> Something like:
> 
> for (v in x[[1]])
> print(v)
> 
> However, I need to store this index "v" for later, and I
> have lots of other
> indices which we range over later in the code so thought
> I'd make a list of
> these indices, v<-list(). But then when I try:
> 
> for( v[[1]] in x[[1]] )
> print(v[[1]])
> 
> I get errors:
> 
> > x<-list()
> > x[[1]]=1:5
> > v<-list()
> > for(v[[1]] in x[[1]])
> Error: unexpected '[[' in "for(v[["
> > print v[[1]]
> Error: unexpected symbol in "print v"
> 
> Can you not use a list in this way, i.e. to store variables
> to range over in
> a for loop? Can anyone offer a solution?
> 
> Thanks for any help!
> 
> -- 
> View this message in context: http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-tp1679184p1679184.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 29
> Date: Tue, 23 Mar 2010 15:10:45 +0000
> From: Benilton Carvalho <beniltoncarvalho at gmail.com>
> To: Pj253 <pj253 at cam.ac.uk>
> Cc: r-help at r-project.org
> Subject: Re: [R] using a list to index elements of a list
> Message-ID:
>     <e71a39ea1003230810k445d0d06j87a240986b40af95 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> if this was to work, wouldn't the object 'v' be identical
> to 'x'?...
> so, why not use 'x' itself?
> b
> 
> On Tue, Mar 23, 2010 at 2:53 PM, Pj253 <pj253 at cam.ac.uk>
> wrote:
> >
> > I have a list of vectors, x, with x[[1]]=1:5, say.
> >
> > And I need to go through each element of each vector
> in a for loop.
> > Something like:
> >
> > for (v in x[[1]])
> > print(v)
> >
> > However, I need to store this index "v" for later, and
> I have lots of other
> > indices which we range over later in the code so
> thought I'd make a list of
> > these indices, v<-list(). But then when I try:
> >
> > for( v[[1]] in x[[1]] )
> > print(v[[1]])
> >
> > I get errors:
> >
> >> x<-list()
> >> x[[1]]=1:5
> >> v<-list()
> >> for(v[[1]] in x[[1]])
> > Error: unexpected '[[' in "for(v[["
> >> print v[[1]]
> > Error: unexpected symbol in "print v"
> >
> > Can you not use a list in this way, i.e. to store
> variables to range over in
> > a for loop? Can anyone offer a solution?
> >
> > Thanks for any help!
> >
> > --
> > View this message in context: http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-tp1679184p1679184.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 30
> Date: Tue, 23 Mar 2010 07:36:42 -0800 (PST)
> From: Pj253 <pj253 at cam.ac.uk>
> To: r-help at r-project.org
> Subject: Re: [R] using a list to index elements of a list
> Message-ID: <1269358602244-1679253.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Thanks for your reply Ben!
> 
> I don't think I want v to be identical to x... I guess I
> haven't put the
> question in the right context. What I'm actually trying to
> do is... (*
> indicates extra information, not necessarily relevant for
> my question, but
> to help put it in context)
> 
> A, some  matrix (*a traceless, symmetric matrix of
> 0's, 1's (representing a
> graph)*)
> 
> x<-list()
> x[[1]]<-1:nrow(A)
> for (i in x[[1]]){
>     if (A[1,i]==1) {
>        
> x[[2]]<-x[[1]][!(x[[1]]==1)]
>         for (j in x[[2]]){
>             if
> (A[i,j]==1){
>            
> path<-c(1,i,j)
>            
> print(path)
>             }
>              
>   }
>     }
> }
> 
> So, here I have used i and j to range over the elements of
> x[[1]], x[[2]]
> respectively.
> (*This prints all the paths of length 2 starting at vertex
> 1. But I'm trying
> to generalise this for a path of length nrow(A), i.e. a
> Hamiltonian path)*)
> I want to iterate this process a certain number of times,
> so instead of i,j
> I thought to use a list of scalars, v.
> I don't want v to be identical to x... I want v to be a
> list of scalars
> which range (inside a for loop) over an elements of the
> list x. (so instead
> of for (i in x[[k]]) I have for (v[[k]] in x[[k]])).
> 
> I can see how they look similar, but I do think they're
> different objects.
> Hope this is clear. If you still think using 'x' itself
> would work, can you
> explain how so?
> -- 
> View this message in context: http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-tp1679184p1679253.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 31
> Date: Tue, 23 Mar 2010 15:44:56 +0000
> From: Benilton Carvalho <beniltoncarvalho at gmail.com>
> To: Pj253 <pj253 at cam.ac.uk>
> Cc: r-help at r-project.org
> Subject: Re: [R] using a list to index elements of a list
> Message-ID:
>     <e71a39ea1003230844m5226f7c3qd7dd93b0db84c886 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> can you also post an example of A and an example of the
> expected result?
> 
> On Tue, Mar 23, 2010 at 3:36 PM, Pj253 <pj253 at cam.ac.uk>
> wrote:
> >
> > Thanks for your reply Ben!
> >
> > I don't think I want v to be identical to x... I guess
> I haven't put the
> > question in the right context. What I'm actually
> trying to do is... (*
> > indicates extra information, not necessarily relevant
> for my question, but
> > to help put it in context)
> >
> > A, some ?matrix (*a traceless, symmetric matrix of
> 0's, 1's (representing a
> > graph)*)
> >
> > x<-list()
> > x[[1]]<-1:nrow(A)
> > for (i in x[[1]]){
> > ? ? ? ?if (A[1,i]==1) {
> > ? ? ? ? ? ?x[[2]]<-x[[1]][!(x[[1]]==1)]
> > ? ? ? ? ? ?for (j in x[[2]]){
> > ? ? ? ? ? ? ? ? ? ?if (A[i,j]==1){
> > ? ? ? ? ? ? ? ? ? ? ? ?path<-c(1,i,j)
> > ? ? ? ? ? ? ? ? ? ? ? ?print(path)
> > ? ? ? ? ? ? ? ? ? ? ? ?}
> > ? ? ? ? ? ? ? ? ? ?}
> > ? ? ? ?}
> > }
> >
> > So, here I have used i and j to range over the
> elements of x[[1]], x[[2]]
> > respectively.
> > (*This prints all the paths of length 2 starting at
> vertex 1. But I'm trying
> > to generalise this for a path of length nrow(A), i.e.
> a Hamiltonian path)*)
> > I want to iterate this process a certain number of
> times, so instead of i,j
> > I thought to use a list of scalars, v.
> > I don't want v to be identical to x... I want v to be
> a list of scalars
> > which range (inside a for loop) over an elements of
> the list x. (so instead
> > of for (i in x[[k]]) I have for (v[[k]] in x[[k]])).
> >
> > I can see how they look similar, but I do think
> they're different objects.
> > Hope this is clear. If you still think using 'x'
> itself would work, can you
> > explain how so?
> > --
> > View this message in context: http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-tp1679184p1679253.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 32
> Date: Tue, 23 Mar 2010 08:45:30 -0700
> From: "William Dunlap" <wdunlap at tibco.com>
> To: "Pj253" <pj253 at cam.ac.uk>,
> <r-help at r-project.org>
> Subject: Re: [R] using a list to index elements of a list
> Message-ID:
>     <77EB52C6DD32BA4D87471DCD70C8D70002AC37F6 at NA-PA-VBE03.na.tibco.com>
> Content-Type: text/plain;   
> charset="us-ascii"
> 
> > -----Original Message-----
> > From: r-help-bounces at r-project.org
> 
> > [mailto:r-help-bounces at r-project.org]
> On Behalf Of Pj253
> > Sent: Tuesday, March 23, 2010 7:54 AM
> > To: r-help at r-project.org
> > Subject: [R] using a list to index elements of a list
> > 
> > 
> > I have a list of vectors, x, with x[[1]]=1:5, say.
> > 
> > And I need to go through each element of each vector
> in a for loop.
> > Something like:
> > 
> > for (v in x[[1]])
> > print(v)
> > 
> > However, I need to store this index "v" for later, and
> I have 
> > lots of other
> > indices which we range over later in the code so
> thought I'd 
> > make a list of
> > these indices, v<-list(). But then when I try:
> > 
> > for( v[[1]] in x[[1]] )
> > print(v[[1]])
> > 
> > I get errors:
> > 
> > > x<-list()
> > > x[[1]]=1:5
> > > v<-list()
> > > for(v[[1]] in x[[1]])
> > Error: unexpected '[[' in "for(v[["
> 
> The syntax of the for statement is
>    for(<name> in <values>)
> <expr>
> where <name> must be a name object, not
> a call like v[[i]] or anything else.
> 
> Will your code work as you wish if you
> replace the "for(v[[1]] in x[[1]]) { ... }"
> with the following?
>    for(i in x[[1]]) {
>       v[[2]] <- i
>       ...
>    }
> 
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com  
> 
> > > print v[[1]]
> > Error: unexpected symbol in "print v"
> > 
> > Can you not use a list in this way, i.e. to store
> variables 
> > to range over in
> > a for loop? Can anyone offer a solution?
> > 
> > Thanks for any help!
> > 
> > -- 
> > View this message in context: 
> > http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-
> > tp1679184p1679184.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> > 
> > ______________________________________________
> > R-help at r-project.org
> 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.
> > 
> 
> 
> 
> ------------------------------
> 
> Message: 33
> Date: Tue, 23 Mar 2010 06:56:29 -0800 (PST)
> From: tj <girlme80 at yahoo.com>
> To: r-help at r-project.org
> Subject: Re: [R] If else statements
> Message-ID: <103392.9727.qm at web33404.mail.mud.yahoo.com>
> Content-Type: text/plain
> 
> 
> Thanks Sam for the short but very helpful answer. That's
> what I only want to know.
> Thanks.=)
> 
> ~tj
> 
> 
>       
> -- 
> View this message in context: http://n4.nabble.com/If-else-statements-tp1678705p1679187.html
> Sent from the R help mailing list archive at Nabble.com.
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 34
> Date: Tue, 23 Mar 2010 07:18:24 -0800 (PST)
> From: koj <jens.koch at gmx.li>
> To: r-help at r-project.org
> Subject: [R] barplot (stacked)
> Message-ID: <1269357504701-1679227.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Dear all,
> 
> I want to draw a barplot with the following data:
> 
> 
>          [,1] 
>    [,2]   [,3]   
>    [,4]     [,5] 
>    [,6]     [,7] 
>      
> [,8]     [,9]
> [1,] 110.0675 118.4167 117.16 109.735416 101.6312 104.0312
> 101.8263
> 99.38541670 114.2613
> [2,]   0.0000   0.0000   0.00   1.658333   0.0000   0.6250   0.0000
> 
> 0.05208333   0.0000
> 
>          [,10]   
> [,11]    [,12]    [,13]   
> [,14]   [,15]    [,16]   
> [,17]    
> [,18]
> [1,] 46.597917 108.5312 99.85833 104.3137 99.07917 95.5975
> 92.07292 108.6338
> 104.82917
> [2,]  2.458333   0.0000 
> 2.62500   0.0000  0.18750 
> 0.0000  0.00000   0.0000  
> 0.40625
> 
>         [,19] [,20]
> [1,] 48.90625  47.5
> [2,]  0.00000   0.0
> 
> The problem is: I want to group the data. I want to have
> ten groups. The
> first two bars should be [1,1] and [2,1] together in one
> bar and in the
> second bar of the first obervation should be [1,2] and
> [2,2] (stacked with
> beside =TRUE). Therefore the first observation is
> [1,1],[1,2],[2,1] and
> [2,2].    
> 
> For a better understanding: I want to split the darkblue
> bar into a green
> and a blue bar (please see picture) per observation.
> 
> Has anyone a suggestion how I can do this? Thank you very
> much in advane.
> 
> 
> http://n4.nabble.com/file/n1679227/Pic.jpg 
> -- 
> View this message in context: http://n4.nabble.com/barplot-stacked-tp1679227p1679227.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 35
> Date: Tue, 23 Mar 2010 11:52:57 -0400
> From: jim holtman <jholtman at gmail.com>
> To: "Hosack, Michael" <mhosack at state.pa.us>
> Cc: "R-help at r-project.org"
> <R-help at r-project.org>
> Subject: Re: [R] Converting date format
> Message-ID:
>     <644e1f321003230852wff29f4cs482eae7b2b64484c at mail.gmail.com>
> Content-Type: text/plain
> 
> try this:
> 
> > x <- c('1/1/1970','12/13/2010', '2/3/2001')
> > gsub("(\\d+/\\d+/)\\d\\d(\\d\\d
> <file://d+///d+/)//d//d(//d//d>)",
> "\\1\\2<file://0.0.0.1//2>",
> x)
> [1] "1/1/70"   "12/13/10" "2/3/01"
> 
> 
> On Tue, Mar 23, 2010 at 10:10 AM, Hosack, Michael <mhosack at state.pa.us>wrote:
> 
> > R community:
> >
> > Hello, I would to like to convert a character date
> variable from %m/%d/%Y
> > to %m/%d/%y. Any advice would be greatly appreciated.
> I have tried functions
> > for changing the formatting and removing the
> unnecessary digits without
> > success.
> >
> > Mike
> >
> > ______________________________________________
> > R-help at r-project.org
> mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> > and provide commented, minimal, self-contained,
> reproducible code.
> >
> 
> 
> 
> -- 
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
> 
> What is the problem that you are trying to solve?
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 36
> Date: Tue, 23 Mar 2010 11:53:21 -0400
> From: Max Kuhn <mxkuhn at gmail.com>
> To: bbslover <dluthm at yeah.net>
> Cc: r-help at r-project.org
> Subject: Re: [R] caret package, how can I deal with RFE+SVM
> wrong
>     message?
> Message-ID:
>     <6731304c1003230853q148ef09eh9d48fb39cc9f2043 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Kevin!
> 
> I've sent 5 replies to your questions already off-list.
> 
> The first question is easy (see below). The others will
> need more
> information on your data (via str(trx) abd str(try)) and
> you versions
> (sessionInfo()) as previously asked off-list.
> 
> Sorry to out you, but this is bad form.
> 
> Max
> 
> > I am learning caret package, and I want to use the RFE
> to reduce the
> > feature. I want to use RFE coupled Random Forest
> (RFE+FR) to complete this
> > task. As we know, there are a number of pre-defined
> sets of functions, like
> > random Forest(rfFuncs), however,I want to tune the
> parameters (mtr) when
> > RFE, and then I write code below, but there is
> something wrong message, How
> > can I deal with it?
> >> rfGrid<-expand.grid(.mtry=c(1:2))
> >>
> rfectrl<-rfeControl(functions=caretFuncs,method="cv",verbose=F,returnResamp="final",number=10)
> >> subsets<-c(3,4)
> >> set.seed(2)
> >>
> rf.RFE<-rfe(trx,try,sizes=subsets,rfeControl=rfectrl,method="rf",tuneGrid=rfGrid)
> > Loading required package: class
> >
> > Attaching package: 'class'
> >
> >
> > ? ? ? ?The following object(s) are masked from
> package:reshape :
> >
> > ? ? ? ? condense
> >
> > Fitting: mtry=1
> > Fitting: mtry=2
> > Error in varImp.randomForest(object$finalModel, ...)
> :
> > ?subscript out of bounds
> > In addition: Warning message:
> > package 'e1071' was built under R version 2.10.1
> 
> You didn't pass importance = TRUE to randomForest
> 
> 
> > At the same time, If I want to ?use RFE+SVM,
> ?RFE+nnet, and so on ,how can I
> > do? I have try RFE+SVM, also wrong message:>
> set.seed(1)
> >> svmProfile<-rfe(trx,try,sizes=c(1:3),
> > + ? ? ? ? ? ?
> rfeControl=rfeControl(functions=caretFuncs,method="cv",
> > + ? ? ? ? ? ?
> verbose=F,returnResamp="final",number=10),
> > + ? ? ? ? ? ? method="svmRadial",tuneLength=5)
> > Fitting: sigma=0.009246713, C=0.1
> > Fitting: sigma=0.009246713, C=1
> > Fitting: sigma=0.009246713, C=10
> > Fitting: sigma=0.009246713, C=100
> > Fitting: sigma=0.009246713, C=1000
> > Error in rfeControl$functions$rank(fitObject, .x, y)
> :
> > ?need importance columns for each class
> 
> 
> -- 
> 
> Max
> 
> 
> 
> ------------------------------
> 
> Message: 37
> Date: Tue, 23 Mar 2010 11:05:05 -0500
> From: "Prew, Paul" <Paul.Prew at ecolab.com>
> To: <r-help at r-project.org>
> Subject: [R] Sample size for proportion, not binomial
> Message-ID:
>     <6B810AFB14C606439FD57E5985E0379104D8D839 at useagan1500p.GLOBAL.ECOLAB.CORP>
>     
> Content-Type: text/plain
> 
> Hello,  I am looking for a sample size function for
> samples sizes, to test proportions that are not binomial
> proportions.  The proportions represent a ratio of
> (final measure) / (baseline measure) on the same
> experimental unit.  Searches using RSeek and such bring
> multiple hits for binomial proportions, but that doesn't
> seem to fit my situation.  Perhaps there's some
> standard terminology from a different field that would
> provide better hits than deeming this a 'rate' or a
> 'proportion'.
> 
> Of course, most sample size functions assume a normal
> distribution, while this data will be bounded between 0 and
> 1.  The scientist I'm working with feels it's important
> to make fair comparisons, any weight loss must account for
> the baseline weight.  A logistic transformation seems
> appropriate, but that term also didn't yield hits I
> recognized as useful.
> 
> Loss of weight --- compare treatments:
> Treatment A:  1 - Final weight / Initial weight
> Treatment B:  1 - Final weight / Initial weight
> 
> This appears to be a situation that would be common, but
> I'm not framing it in a way that matches an R package. 
> Any guidance is appreciated.
> 
> Regards, Paul
> 
> 
> Paul Prew   â–ª  Statistician
> 651-795-5942   â–ª   fax
> 651-204-7504 
> Ecolab Research Center   â–ª  Mail
> Stop ESC-F4412-A 
> 655 Lone Oak
> Drive   â–ª   Eagan, MN
> 55121-1560 
> 
> 
> 
> CONFIDENTIALITY NOTICE: 
> This e-mail communication and any attachments may contain
> proprietary and privileged information for the use of the
> designated recipients named above. 
> Any unauthorized review, use, disclosure or distribution is
> prohibited. 
> If you are not the intended recipient, please contact the
> sender by reply e-mail and destroy all copies of the
> original message.
> 
> 
>     [[alternative HTML version deleted]]
> 
> 
> ------------------------------
> 
> Message: 38
> Date: Tue, 23 Mar 2010 08:05:43 -0800 (PST)
> From: Pj253 <pj253 at cam.ac.uk>
> To: r-help at r-project.org
> Subject: Re: [R] using a list to index elements of a list
> Message-ID: <1269360343789-1679293.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Thanks Bill, that sorted it out! And thank you too Ben!
> 
> Bill and Ben. Are you familiar with the flowerpot men by
> any chance!?
> 
> Thanks again!
> 
> -- 
> View this message in context: http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-tp1679184p1679293.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 39
> Date: Tue, 23 Mar 2010 16:07:17 +0000
> From: Benilton Carvalho <beniltoncarvalho at gmail.com>
> To: William Dunlap <wdunlap at tibco.com>
> Cc: r-help at r-project.org,
> Pj253 <pj253 at cam.ac.uk>
> Subject: Re: [R] using a list to index elements of a list
> Message-ID:
>     <e71a39ea1003230907n88a255fp827da57bb80e7474 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> and in addition to bill's suggestion, you may want to
> consider not
> growing a list.
> 
> Instead of 'v <- list()', use:
> 
> v <- vector("list", nrow(A))
> 
> b
> 
> > Will your code work as you wish if you
> > replace the "for(v[[1]] in x[[1]]) { ... }"
> > with the following?
> > ? for(i in x[[1]]) {
> > ? ? ?v[[2]] <- i
> > ? ? ?...
> > ? }
> >
> > Bill Dunlap
> > Spotfire, TIBCO Software
> > wdunlap tibco.com
> 
> 
> 
> ------------------------------
> 
> Message: 40
> Date: Tue, 23 Mar 2010 11:34:23 -0500
> From: "John K. Williams" <sabesin2001 at gmail.com>
> To: Jim Lemon <jim at bitwrit.com.au>
> Cc: r-help at r-project.org
> Subject: Re: [R] filled.contour formatting questions
> Message-ID:
>     <936907d71003230934j4b88ed74u53c568638b832674 at mail.gmail.com>
> Content-Type: text/plain
> 
> Hmm yes that is what I'm looking for in terms of color
> scale control, but I
> need it for contoured plots.  John.
> 
> On Mon, Mar 22, 2010 at 10:32 PM, Jim Lemon <jim at bitwrit.com.au>
> wrote:
> 
> > On 03/23/2010 12:48 PM, John K. Williams wrote:
> >
> >> Hello, I'm having some trouble getting things to
> look as I want with
> >> filled.contour.
> >>
> >> 1.  My first issue is that I am unable to add
> line segments to my plot
> >> where
> >> I want them.  Using the rug pattern example:
> >> x<- y<- seq(-4*pi, 4*pi, len = 27);
> >> r<- sqrt(outer(x^2, y^2, "+"));
> >> filled.contour(cos(r^2)*exp(-r/(2*pi)));
> >> segments(0.2,0.2,1,0.2);
> >> The line segment is not found in relation to the
> x-axis but is seemingly
> >> squished over by the color bar.
> >>
> >> If I try to achieve the line this way:
> >>
> >>
> filled.contour(cos(r^2)*exp(-r/(2*pi)),plot.axes={lines(c(0.2,1),c(0.2,0.2))})
> >> Now when I add the axis back it is misaligned.
> >> axis(1).
> >>
> >> 2. Secondly I'm finding the literature difficult
> to understand on how to
> >> make a nice color scheme.  Below is a nice
> scheme I found from an example,
> >> except I don't understand why the scale seems to
> cycle into blue again for
> >> larger values, even though I think I am setting
> the number of levels of
> >> colors and contour levels to be equal. 
> Basically I want reds for the
> >> highest values and blues for the lowest:
> >>
> >>
> filled.contour(cos(r^2)*exp(-r/(2*pi)),nlevels=25,col=hsv(h=seq(from=.7,to=0,length=25)))
> >>
> >> 3.  I'm used to working with matlab where it
> was simple to make the color
> >> scale the same on multiple figures using
> caxis().  However I don't see
> >> this
> >> option for filled.contour (possibly it exists for
> levelplot() but I was
> >> having even less success understanding that
> one).  I only see the option
> >> to
> >> set the number of levels which doesn't really
> accomplish what I want for
> >> plots that are going to have widely varying
> limits.
> >>
> >>  Hi John,
> > I'm not sure that this is what you want, but the
> examples for the barp
> > function in the plotrix package include one for a
> color scale that extends
> > beyond the values that are to be plotted. That is, you
> can specify the range
> > of the color scale regardless of the actual values.
> >
> > Jim
> >
> >
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 41
> Date: Tue, 23 Mar 2010 08:35:50 -0800 (PST)
> From: jtouyz <jtouyz at uwaterloo.ca>
> To: r-help at r-project.org
> Subject: Re: [R] Changing global variables from functions
> Message-ID: <1269362150425-1679330.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Thanks for the help, I've fixed the problem.
> -Josh Elliott
> -- 
> View this message in context: http://n4.nabble.com/Changing-global-variables-from-functions-tp1595002p1679330.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 42
> Date: Tue, 23 Mar 2010 08:58:24 -0800 (PST)
> From: ApproxGaussian <pcasas at technomics.net>
> To: r-help at r-project.org
> Subject: [R] Optim() Help, Unusual Error
> Message-ID: <1269363504978-1679363.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Hello all, any help with the following would be
> appreciated.
> 
> I am attempting to maximize 28 parameters similtaneously in
> Optim().  The
> follwoing is my code:
> 
> Y<-comp[,9]
> n<-length(Y)
> 
> 
> e.1<-.5
> e.2<-.5
> e.3<-.5
> e.4<-.5
> e.5<-.5
> e.6<-.5
> e.7<-.5
> e.8<-.5
> e.9<-.5
> e.10<-.5
> e.11<-.5
> e.12<-.5
> e.13<-.5
> e.14<-.5
> e.15<-.5
> e.16<-.5
> e.17<-.5
> e.18<-.5
> e.19<-.5
> e.20<-.5
> e.21<-.5
> e.21<-.5
> e.22<-.5
> e.23<-.5
> e.24<-.5
> e.25<-.5
> e.26<-.5
> e.27<-.5
> e.28<-.5
> par<-(e.1,e.2,e.3,e.4,e.5,e.6,e.7,e.8,e.9,e.10,e.11,e.12,e.13,e.14,e.15,e.16,e.17,e.18,e.19,e.20,e.21,e.22,e.23,e.24,e.25,e.26,e.27,e.28)
> 
> 
> # Define the objective function:
> objective.function <- function(par,comp,Y,n) {
> e.1<-par[1]
> e.2<-par[2]
> e.3<-par[3]
> e.4<-par[4]
> e.5<-par[5]
> e.6<-par[6]
> e.7<-par[7]
> e.8<-par[8]
> e.9<-par[9]
> e.10<-par[10]
> e.11<-par[11]
> e.12<-par[12]
> e.13<-par[13]
> e.14<-par[14]
> e.15<-par[15]
> e.16<-par[16]
> e.17<-par[17]
> e.18<-par[18]
> e.19<-par[19]
> e.20<-par[20]
> e.21<-par[21]
> e.22<-par[22]
> e.23<-par[23]
> e.24<-par[24]
> e.25<-par[25]
> e.26<-par[26]
> e.27<-par[27]
> e.28<-par[28]
> 
> residuals.squared <- c()
> 
> for (i in 1:n) residuals.squared[i] <- (Y[i] - (
> ((e.26^comp[i,3])*(e.27^(comp[i,7]-mean(comp[,7])))*(e.28^comp[i,6])*(comp[i,65]^comp[i,5]))*
> (e.1*comp[i,10]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.21)
> +
> e.2*comp[i,11]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.21)
> +
> e.3*comp[i,12]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.21)
> +
> e.4*comp[i,13]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.22)
> +
> e.5*comp[i,14]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.22)
> +
> e.6*comp[i,15]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.22)
> +
> e.7*comp[i,16]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.23)
> +
> e.8*comp[i,17]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.24)
> +
> e.9*comp[i,18]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.24)
> +
> e.10*comp[i,19]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.24)
> +
> e.11*comp[i,20]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.24)
> +
> e.12*comp[i,21]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.13*comp[i,22]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.14*comp[i,23]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.15*comp[i,24]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.15*comp[i,25]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.16*comp[i,26]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.15*comp[i,27]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.12*comp[i,28]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25)
> +
> e.8*comp[i,29]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.24)
> +
> e.14*comp[i,30]*((((comp[i,34]+comp[i,35])+(e.17*(comp[i,36]+comp[i,37]+comp[i,38]))+(e.18*comp[i,41])+(e.19*comp[i,39])+(e.20*comp[i,42]))/(comp[i,31]+comp[i,32]+comp[i,33]))^e.25))^2)
> )
> sum.residuals.squared <- sum(residuals.squared)
> return(sum.residuals.squared)
> }
> 
> 
> optim.results <- optim(par, fn=objective.function,
> method = "Nelder-Mead",
> comp[,c(3,5,6,7,10:39,41:42,65)], Y=Y, n=n)
> 
> 
> The error I am recieving however states: 
> Error in fn(par, ...) : 
>   unused argument(s) (X = list(Air.Platform. = c(1,
> 1...
> 
> Where "Air.Platform." is the column name for comp[i,3] used
> in the first
> lines of my objective function.
> 
> I'm not sure how it is reminaing "unused".  Thanks for
> any help.
> 
> -Paul
> -- 
> View this message in context: http://n4.nabble.com/Optim-Help-Unusual-Error-tp1679363p1679363.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 43
> Date: Tue, 23 Mar 2010 10:08:27 -0500
> From: Dirk Eddelbuettel <dirk.eddelbuettel at r-project.org>
> To: r-announce <r-announce at r-project.org>
> Subject: [R] R Participation in the Google Summer of Code
> 2010
> Message-ID: <19368.55659.435905.884614 at ron.nulle.part>
> Content-Type: text/plain; charset="us-ascii"
> 
> 
> Dear R Users,
> 
> We would like to highlight that R has once again been
> selected to participate
> in the Google Summer of Code.  Suggested projects can
> be found in the R-Wiki:
> http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010. 
> The GSoC
> is a program from Google that offers student developers
> stipends to write
> code for various open source software projects (more
> information can be found
> here: http://code.google.com/soc/).
> 
> All discussion related to R and the Google Summer of Code
> should preferably
> tak place on the respective google group:
> http://groups.google.com/group/gsoc-r (gsoc-r at googlegroups.com).
>  
> We are currently in a time period during which interested
> students can
> discuss an idea from the wiki with the respective project
> mentor, or contact
> the gsoc-r group to propose a new one and find a
> mentor.  Please note that
> some projects on the R-Wiki also provide test questions, so
> please read these
> pages thoroughly before contacting a project mentor. The
> student application
> period opens on March 29th.
> 
> Best regards,
> 
> the R Project GSoC mentors
> 
> _______________________________________________
> R-announce at stat.math.ethz.ch
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-announce
> 
> 
> 
> ------------------------------
> 
> Message: 44
> Date: Tue, 23 Mar 2010 13:22:54 -0400
> From: milton ruser <milton.ruser at gmail.com>
> To: r-help at r-project.org
> Subject: [R] qplot(ggplo2): axis label sizes/colors
> Message-ID:
>     <3aaf1a031003231022x81ee586i26790b2b87bdd772 at mail.gmail.com>
> Content-Type: text/plain
> 
> Dear all,
> 
> How can I change the size and the color of axis?
> I would like that the xlab to be larger, xvalues to be
> larger, and xvalues in black instead of grey.
> 
> x=runif(10)
> y=runif(10)
> require(ggplo2)
> qplot(x,y)
> 
> cheers
> 
> milton
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 45
> Date: Wed, 24 Mar 2010 01:34:10 +0800
> From: Xie Chao <xiechaos at gmail.com>
> To: milton ruser <milton.ruser at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] qplot(ggplo2): axis label sizes/colors
> Message-ID:
>     <c2dbb5d1003231034m3d731136o84b54762a1ebee8a at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> http://had.co.nz/stat405/lectures/21-themes.pdf
> 
> On Wed, Mar 24, 2010 at 1:22 AM, milton ruser <milton.ruser at gmail.com>
> wrote:
> > Dear all,
> >
> > How can I change the size and the color of axis?
> > I would like that the xlab to be larger, xvalues to
> be
> > larger, and xvalues in black instead of grey.
> >
> > x=runif(10)
> > y=runif(10)
> > require(ggplo2)
> > qplot(x,y)
> >
> > cheers
> >
> > milton
> >
> > ? ? ? ?[[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 46
> Date: Tue, 23 Mar 2010 12:57:47 -0500
> From: AC Del Re <delre at wisc.edu>
> To: r-help at r-project.org
> Subject: [R] Displaying equations from .Rd files
> Message-ID:
>     <85cf8f8d1003231057o501b30b9xc493423b29b0fb3d at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi All,
> 
> I am reading through section 2.6 (Mathematics) of  the
> "Writing R
> Extensions" manuscript and am wondering where I can find
> more
> examples/documentation on the \deqn{ } function. I would
> like to learn how
> to display equations using this function but am not sure
> how to go about
> doing it. The one example provided in section 2.6 doesn't
> give me much of a
> sense on how to do this.
> 
> Thank you,
> 
>  AC
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 47
> Date: Tue, 23 Mar 2010 23:29:20 +0530
> From: Chidambaram Annamalai <quantumelixir at gmail.com>
> To: r-help at r-project.org
> Subject: [R] Operator overloading for custom classes
> Message-ID:
>     <7021740b1003231059s29312742m417131866bfbf557 at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi,
> 
> I need some help to get some of the object orientation,
> specifically the
> methods that overload the basic arithmetic operations, from
> sample C++
> code to R. I don't have experience with such advanced
> language features
> inside of R. So I was wondering if some of you could help
> me out in this
> regard.
> 
> I have written a simple demonstration of a forward mode
> automatic
> differentiator in C++ and it is currently hosted on
> github:
> http://github.com/quantumelixir/ad-demo/blob/master/simple.cpp.
> It uses
> simple operator overloading techniques to modify the
> meaning of the
> basic arithmetic operations (+, -, *, /) for the
> "derivative" type Dual
> number class that I have defined. Could you show me how
> this could be
> equivalently done in R? I want to know how to define custom
> classes and
> define the meaning of arithmetic for them.
> 
> I had checked for operator overloading in R but could only
> find the
> equivalence of a + b and '+'(a, b) in the R language
> definition. Could
> you show how I could extend the simple object oriented-ness
> in the C++
> code neatly to R?
> 
> Thanks a bunch!
> Chillu
> 
> PS: Sorry that I had mistakenly sent the email to the
> r-devel list earlier,
> instead of the intended r-help list. This is a copy of the
> same email.
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 48
> Date: Tue, 23 Mar 2010 11:11:45 -0700
> From: "Charles C. Berry" <cberry at tajo.ucsd.edu>
> To: Catherine ENG <caths.eng at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] information module Wilks' lambda
> criterion
> Message-ID: <Pine.LNX.4.64.1003231109420.32195 at tajo.ucsd.edu>
> Content-Type: text/plain; charset="x-unknown";
> Format="flowed"
> 
> On Tue, 23 Mar 2010, Catherine ENG wrote:
> 
> > Hi everybody,
> >
> > I was wondering if you can help me about a module. In
> fact, I'm looking for
> > a package or module about Wilks' lambda criterion in R
> environment. I didn't
> > find it in R website (
> 
> See
> 
>      ?summary.manova
> 
> HTH,
> 
> Chuck
> 
> > http://cran.cict.fr/web/packages/index.html#available-packages-W
> or
> > http://search.cpan.org/faq.html).
> > If this module exists, could you show me the command
> line.
> >
> > Thank you very much for your help,
> > Miss Catherine ENG
> >
> >
> > -----
> > Laboratoire de G?n?tique et Microbiologie UMR INRA
> 1128 - IFR 110
> > Universit? Henri Poincar? - Facult? des Sciences BP
> 239
> > 54506 Vandoeuvre-l?s-Nancy
> > T?l. : 06.58.25.37.66
> >
> >     [[alternative HTML version
> deleted]]
> >
> >
> 
> Charles C. Berry           
>                
> (858) 534-2098
>                
>                
>              Dept of
> Family/Preventive Medicine
> E mailto:cberry at tajo.ucsd.edu   
>             UC San Diego
> http://famprevmed.ucsd.edu/faculty/cberry/  La
> Jolla, San Diego 92093-0901
> 
> 
> ------------------------------
> 
> Message: 49
> Date: Tue, 23 Mar 2010 14:14:45 -0400
> From: "Bos, Roger" <roger.bos at rothschild.com>
> To: <r-help at r-project.org>
> Subject: [R] Creating pdfs using qplot in qqplot2
> Message-ID:
>     <D8C95B444AD6EE4AAD638D818A9CFD3403D49C58 at RINNYCSE000.rth.ad.rothschild.com>
>     
> Content-Type: text/plain;   
> charset="us-ascii"
> 
> I am trying to create plots within a for loop and output
> them to a pdf.
> Here is a working example using plot:
> 
>           gg <-
> data.frame(datadate=1:4, spread=5:8)
>           pdf()
>           for (i in 1:3) {
>              
> plot(gg$datadate, gg$spread, main=i)
>           }
>           dev.off()
> 
> I am trying to learn more about ggplot2 so I try a slight
> modification
> and it doesn't work.  Anyone know how to do this using
> qplot in ggplot2?
> 
> 
>         
>    gg <- data.frame(datadate=1:4,
> spread=5:8)
>           pdf()
>           for (i in 1:3) {
>              
> qplot(gg$datadate, gg$spread, geom="line", main=i)
>           }
>           dev.off()
> 
> ***************************************************************
> 
> This message is for the named person's use only. It
> may\...{{dropped:20}}
> 
> 
> 
> ------------------------------
> 
> Message: 50
> Date: Tue, 23 Mar 2010 13:21:39 -0500
> From: stephen sefick <ssefick at gmail.com>
> To: "Bos, Roger" <roger.bos at rothschild.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Creating pdfs using qplot in qqplot2
> Message-ID:
>     <c502a9e11003231121h26b2de80j96d87d17b5127b23 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> you have to print the object
> 
> gg <- data.frame(datadate=1:4, spread=5:8)
> >           pdf()
> >           for (i in
> 1:3) {
> +           
>    d <- qplot(gg$datadate, gg$spread,
> geom="line", main=i)
> +           print(d)}
> >       
>    dev.off()
> 
> On Tue, Mar 23, 2010 at 1:14 PM, Bos, Roger <roger.bos at rothschild.com>
> wrote:
> > I am trying to create plots within a for loop and
> output them to a pdf.
> > Here is a working example using plot:
> >
> > ? ? ? ? ?gg <- data.frame(datadate=1:4,
> spread=5:8)
> > ? ? ? ? ?pdf()
> > ? ? ? ? ?for (i in 1:3) {
> > ? ? ? ? ? ? ?plot(gg$datadate, gg$spread, main=i)
> > ? ? ? ? ?}
> > ? ? ? ? ?dev.off()
> >
> > I am trying to learn more about ggplot2 so I try a
> slight modification
> > and it doesn't work. ?Anyone know how to do this using
> qplot in ggplot2?
> >
> >
> > ? ? ? ? ? gg <- data.frame(datadate=1:4,
> spread=5:8)
> > ? ? ? ? ?pdf()
> > ? ? ? ? ?for (i in 1:3) {
> > ? ? ? ? ? ? ?qplot(gg$datadate, gg$spread,
> geom="line", main=i)
> > ? ? ? ? ?}
> > ? ? ? ? ?dev.off()
> >
> >
> ***************************************************************
> >
> > This message is for the named person's use only. It
> may\...{{dropped:20}}
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> -- 
> Stephen Sefick
> 
> Let's not spend our time and resources thinking about
> things that are
> so little or so large that all they really do for us is
> puff us up and
> make us feel like gods.  We are mammals, and have not
> exhausted the
> annoying little problems of being mammals.
> 
>            
>            
>         -K. Mullis
> 
> 
> 
> ------------------------------
> 
> Message: 51
> Date: Tue, 23 Mar 2010 12:27:35 -0600
> From: Mark Na <mtb954 at gmail.com>
> To: r-help at r-project.org
> Subject: [R] Conditional replacement of NA depending on
> value in the
>     previous column
> Message-ID:
>     <e40d78ce1003231127x7c98d544rf2670b2259956248 at mail.gmail.com>
> Content-Type: text/plain
> 
> Dear R-helpers,
> 
> I have a dataframe like this:
> 
> ID  X1  X2  X3  X4  X5  X6
> 49 
> 1   1   1   0   NA 
> NA
> 50 
> 1   1   1   1   NA 
> 1
> 
> I would like to convert a missing value (NA) that follows a
> 0 (zero) or
> another missing value (NA) into a 0 (zero).
> 
> So, the above lines would be converted to:
> 
> ID  X1  X2  X3  X4  X5  X6
> 49 
> 1   1   1   0   0   0
> 50 
> 1   1   1   1   NA 
> 1
> 
> I have been struggling with this all morning, so any help
> you could provide
> would be much appreciated.
> 
> Thank you!
> 
> Mark Na
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 52
> Date: Tue, 23 Mar 2010 11:51:45 -0700 (PDT)
> From: Phil Spector <spector at stat.berkeley.edu>
> To: Mark Na <mtb954 at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Conditional replacement of NA depending on
> value in
>     the previous column
> Message-ID:
>     <alpine.DEB.2.00.1003231148260.20188 at springer.Berkeley.EDU>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
> 
> Mark -
>     Does this do what you want?
> 
> dat = data.frame(X1=c(1,1),X2=c(1,1),X3=c(1,1),
>                
>   X4=c(0,1),X5=c(NA,NA),x6=c(NA,1))
> 
> fixit = function(x){
>       y = c(x[-1],0)
>       x[is.na(y) & is.na(x)] = 0
>       x}
> 
> t(apply(dat,1,fixit))
> 
>       X1 X2 X3 X4 X5 x6
> [1,]  1  1  1  0  0  0
> [2,]  1  1  1  1 NA  1
> 
> 
>             
>         - Phil Spector
>             
>          Statistical
> Computing Facility
>             
>          Department
> of Statistics
>             
>          UC
> Berkeley
>             
>          spector at stat.berkeley.edu
> 
> 
> 
> On Tue, 23 Mar 2010, Mark Na wrote:
> 
> > Dear R-helpers,
> >
> > I have a dataframe like this:
> >
> > ID  X1  X2  X3  X4  X5 
> X6
> > 49 
> 1   1   1   0   NA 
> NA
> > 50 
> 1   1   1   1   NA 
> 1
> >
> > I would like to convert a missing value (NA) that
> follows a 0 (zero) or
> > another missing value (NA) into a 0 (zero).
> >
> > So, the above lines would be converted to:
> >
> > ID  X1  X2  X3  X4  X5 
> X6
> > 49 
> 1   1   1   0   0   0
> > 50 
> 1   1   1   1   NA 
> 1
> >
> > I have been struggling with this all morning, so any
> help you could provide
> > would be much appreciated.
> >
> > Thank you!
> >
> > Mark Na
> >
> >     [[alternative HTML version
> deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 53
> Date: Tue, 23 Mar 2010 10:53:42 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] Creating pdfs using qplot in qqplot2
> Message-ID: <1269370422865-1679523.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> Bos, Roger-2 wrote:
> > 
> > I am trying to create plots within a for loop and
> output them to a pdf.
> > Here is a working example using plot:
> > 
> >           gg <-
> data.frame(datadate=1:4, spread=5:8)
> >           pdf()
> >           for (i in
> 1:3) {
> >           
>    plot(gg$datadate, gg$spread, main=i)
> >           }
> >       
>    dev.off()
> > 
> > I am trying to learn more about ggplot2 so I try a
> slight modification
> > and it doesn't work.  Anyone know how to do this
> using qplot in ggplot2?
> > 
> > 
> >         
>    gg <- data.frame(datadate=1:4,
> spread=5:8)
> >           pdf()
> >           for (i in
> 1:3) {
> >           
>    qplot(gg$datadate, gg$spread, geom="line",
> main=i)
> >           }
> >       
>    dev.off()
> > 
> 
> This question gets asked many, many times and is answered
> in FAQ 7.22:
> 
>  
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f
> 
> 
> Basically, "old-school" functions like plot() execute
> plotting commands
> directly when they are called.  With Lattice-based
> graphics, like ggplot2,
> the composition of the plot and the execution of the
> plotting commands are
> separated into two steps.  qplot() returns an object
> that contains the
> composition of the plot, the print() method performs the
> actual execution of
> plotting commands to a graphics device.
> 
> When functions are called interactively in the top-level
> environment, an
> implicit call to print() is executed to display the
> results.  When these
> same functions are used inside another function or for()
> loop, you will need
> to explicitly add the call to print() in order to get the
> same effect.
> 
> Hope this helps!
> 
> -Charlie
> 
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/Creating-pdfs-using-qplot-in-qqplot2-tp1679488p1679523.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 54
> Date: Tue, 23 Mar 2010 10:58:33 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] If else statements
> Message-ID: <1269370713597-1679530.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> tj wrote:
> > 
> > Thanks Sam for the short but very helpful answer.
> That's what I only want
> > to know.
> > Thanks.=)
> > 
> > ~tj     
> > 
> 
> Even though you got the answer you were looking for, I
> would still browse
> the material Matthew posted.  The "Introduction to R"
> is a standard R manual
> that helped me greatly when I was learning the R
> language.  The question you
> asked is answered in this manual and Eric Raymond's essay
> explains why
> asking questions that are answered in the manual can be
> socially risky on
> software mailing lists.
> 
> You don't want the last reply you ever get from a list to
> be "RTFM"!
> 
> -Charlie
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/If-else-statements-tp1678705p1679530.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 55
> Date: Tue, 23 Mar 2010 11:00:17 -0800 (PST)
> From: sjaffe <sjaffe at riskspan.com>
> To: r-help at r-project.org
> Subject: [R] rpad ?
> Message-ID: <1269370817109-1679534.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Is anyone using rpad? Is there any documentation or
> examples beyond that in
> the 'man' directory of the source? 
> 
> -- 
> View this message in context: http://n4.nabble.com/rpad-tp1679534p1679534.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 56
> Date: Tue, 23 Mar 2010 11:31:00 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] Operator overloading for custom classes
> Message-ID: <1269372660054-1679573.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> Chidambaram Annamalai wrote:
> > 
> > Hi,
> > 
> > I need some help to get some of the object
> orientation, specifically the
> > methods that overload the basic arithmetic operations,
> from sample C++
> > code to R. I don't have experience with such advanced
> language features
> > inside of R. So I was wondering if some of you could
> help me out in this
> > regard.
> > 
> > {snip}
> > 
> > 
> 
> For S3 objects:
> 
>   ?base::Ops
> 
>   http://n4.nabble.com/Operator-overloading-td854452.html#a854452
>   http://n4.nabble.com/Overloading-td850827.html#a850828
> 
> For S4 objects:
> 
>   ?methods::Ops
> 
>   http://n4.nabble.com/How-to-define-new-operators-td974842.html#a974842
> 
> 
> A good resource for reading material on S4 classes, which
> are more formally
> defined than S3 classes, can be found in the R wiki:
> 
>   http://rwiki.sciviews.org/doku.php?id=tips:classes-s4
> 
> 
> Hope this can get you started!
> 
> -Charlie
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/Operator-overloading-for-custom-classes-tp1679467p1679573.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 57
> Date: Tue, 23 Mar 2010 15:31:09 -0400
> From: Nikhil Kaza <nikhil.list at gmail.com>
> To: ApproxGaussian <pcasas at technomics.net>
> Cc: r-help at r-project.org
> Subject: Re: [R] Optim() Help, Unusual Error
> Message-ID: <7729CC35-EC83-468C-B77E-12A695D5609F at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed;
> delsp=yes
> 
> missed a c(...) here,
> therefore no par defined.
> 
> 
> On Mar 23, 2010, at 12:58 PM, ApproxGaussian wrote:
> 
> >
> par<-(e.1,e.2,e.3,e.4,e.5,e.6,e.7,e.8,e.9,e.10,e.11,e.12,e.13,e.14,e.
> 
> >
> 15,e.16,e.17,e.18,e.19,e.20,e.21,e.22,e.23,e.24,e.25,e.26,e.27,e.28)
> 
> 
> 
> ------------------------------
> 
> Message: 58
> Date: Tue, 23 Mar 2010 11:38:37 -0800 (PST)
> From: ApproxGaussian <pcasas at technomics.net>
> To: r-help at r-project.org
> Subject: Re: [R] Optim() Help, Unusual Error
> Message-ID: <1269373117050-1679582.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> I apologize, the "c" is in the original coding; I merely
> misprinted (copy and
> paste).
> 
> I have edited the orginal post to reflect this.
> -- 
> View this message in context: http://n4.nabble.com/Optim-Help-Unusual-Error-tp1679363p1679582.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 59
> Date: Tue, 23 Mar 2010 11:44:27 -0800 (PST)
> From: sjaffe <sjaffe at riskspan.com>
> To: r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID: <1269373467611-1679590.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Based on a private response, it seems that rpad is no
> longer being maintained
> and in fact no longer works with the latest R
> release.  I noticed that the
> web site listed in the FAQ no longer works, the code is
> being hosted by
> google code but it appears no one is working on it. 
> 
> Looking at the "R Web Interfaces" section of the R FAQ I
> don't really see
> anything comparable -- does anyone have a suggestion for a
> similar web-based
> front-end to R? 
> 
> >From the FAQ:
> 
> Rpad, developed and actively maintained by Tom Short,
> provides a
> sophisticated environment which combines some of the
> features of the
> previous approaches with quite a bit of JavaScript,
> allowing for a GUI-like
> behavior (with sortable tables, clickable graphics,
> editable output), etc. 
> -- 
> View this message in context: http://n4.nabble.com/rpad-tp1679534p1679590.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 60
> Date: Tue, 23 Mar 2010 14:48:21 -0500
> From: Douglas Bates <bates at stat.wisc.edu>
> To: Markus Loecher <markus.loecher at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] no predict function in lme4 ?
> Message-ID:
>     <40e66e0b1003231248y2c99b679j319ce193fefd6ce at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> It is not easy to decide what "predict" should return for a
> linear
> mixed model, let alone the more complicated cases.  Do
> you want
> predictions based on the fixed-effects only or based on a
> combination
> of the fixed-effects and the random-effects?  For the
> lme function in
> the nlme package we allowed "levels" of predictions but
> that won't
> work for all models that can be fit with lme4.
> 
> On Tue, Mar 23, 2010 at 9:18 AM, Markus Loecher
> <markus.loecher at gmail.com>
> wrote:
> > Dear mixed effects modelers,
> > I seem unable to find a predict method for mer objects
> in the package lme4.
> > Am I not seeing the forest for the trees ?
> >
> > Any pointer would be very helpful.
> > Thanks,
> > Markus
> >
> > ? ? ? ?[[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 61
> Date: Tue, 23 Mar 2010 11:08:55 -0800 (PST)
> From: kathy_BJ <song_bin2000 at yahoo.com>
> To: r-help at r-project.org
> Subject: Re: [R] help needed with boxplot
> Message-ID: <1269371335740-1679546.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Thank you so much for help, Jim. But I didn't get any plot
> after I submit the
> job except below, which indicating the number of lines for
> the two inputs.
> What's the problem?
> 
> Read 3360 records
> Read 3360 records
> 
> I know I didn't confuse you. 
> -- 
> View this message in context: http://n4.nabble.com/help-needed-with-boxplot-tp1677678p1679546.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 62
> Date: Tue, 23 Mar 2010 11:53:58 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID: <1269374038211-1679599.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> sjaffe wrote:
> > 
> > Based on a private response, it seems that rpad is no
> longer being
> > maintained and in fact no longer works with the latest
> R release.  I
> > noticed that the web site listed in the FAQ no longer
> works, the code is
> > being hosted by google code but it appears no one is
> working on it. 
> > 
> > Looking at the "R Web Interfaces" section of the R FAQ
> I don't really see
> > anything comparable -- does anyone have a suggestion
> for a similar
> > web-based front-end to R? 
> > 
> 
> You could try Sage:
> 
>   http://www.sagemath.org
> 
> You can get a notebook account at:
> 
>   http://www.sagenb.org
> 
> Sage uses python to integrate several open-source and
> closed-source
> mathmatics/computation packages and R is among one of the
> options available. 
> It provides a nice Mathematica-like notebook interface
> where you can mix
> computations and annotations.  If you don't want to
> type Sage code, just
> choose 'r' from the drop-down menu at the top of the
> worksheet next to the
> "Typeset" checkbox and the contents of every cell you enter
> will be passed
> directly to R for evaluation.
> 
> Hope this helps!
> 
> -Charlie
> 
> 
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/rpad-tp1679534p1679599.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 63
> Date: Tue, 23 Mar 2010 11:57:35 -0800 (PST)
> From: sjaffe <sjaffe at riskspan.com>
> To: r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID: <1269374255006-1679607.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> Sharpie wrote:
> > 
> > You could try Sage:
> > 
> >   http://www.sagemath.org
> > 
> 
> Yes, I've tried Sage (briefly) and it is very interesting.
> But what I'm
> looking for here is a client-server system that allows
> multiple users to
> access the results of R without exposing the details.
> -- 
> View this message in context: http://n4.nabble.com/rpad-tp1679534p1679607.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 64
> Date: Tue, 23 Mar 2010 12:06:52 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID: <1269374812867-1679624.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> sjaffe wrote:
> > 
> > Yes, I've tried Sage (briefly) and it is very
> interesting. But what I'm
> > looking for here is a client-server system that allows
> multiple users to
> > access the results of R without exposing the details.
> > 
> 
> Maybe you're looking for something similar to this webapp:
> 
>   http://rweb.stat.ucla.edu/ggplot2/
> 
> The author's website is at:
> 
>   http://www.stat.ucla.edu/~jeroen/live.html
> 
> I believe he used RApache to drive the site, but I'm not
> positive.  The
> widgets are done in ExtJS.
> 
> -Charlie
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/rpad-tp1679534p1679624.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 65
> Date: Wed, 24 Mar 2010 01:47:30 +0530
> From: Chidambaram Annamalai <quantumelixir at gmail.com>
> To: Sharpie <chuck at sharpsteen.net>
> Cc: r-help at r-project.org
> Subject: Re: [R] Operator overloading for custom classes
> Message-ID:
>     <7021740b1003231317w6e0cc005k11f5445e428aab26 at mail.gmail.com>
> Content-Type: text/plain
> 
> Thanks!
> 
> 
> On Wed, Mar 24, 2010 at 1:01 AM, Sharpie <chuck at sharpsteen.net>
> wrote:
> 
> >
> >
> > Chidambaram Annamalai wrote:
> > >
> > > Hi,
> > >
> > > I need some help to get some of the object
> orientation, specifically the
> > > methods that overload the basic arithmetic
> operations, from sample C++
> > > code to R. I don't have experience with such
> advanced language features
> > > inside of R. So I was wondering if some of you
> could help me out in this
> > > regard.
> > >
> > > {snip}
> > >
> > >
> >
> > For S3 objects:
> >
> >  ?base::Ops
> >
>http://n4.nabble.com/Operator-overloading-td854452.html#a854452
>http://n4.nabble.com/Overloading-td850827.html#a850828
> >
> > For S4 objects:
> >
> >  ?methods::Ops
> >
>http://n4.nabble.com/How-to-define-new-operators-td974842.html#a974842
> >
> >
> > A good resource for reading material on S4 classes,
> which are more formally
> > defined than S3 classes, can be found in the R wiki:
> >
>http://rwiki.sciviews.org/doku.php?id=tips:classes-s4
> >
> >
> > Hope this can get you started!
> >
> > -Charlie
> >
> > -----
> > Charlie Sharpsteen
> > Undergraduate-- Environmental Resources Engineering
> > Humboldt State University
> > --
> > View this message in context:
> > http://n4.nabble.com/Operator-overloading-for-custom-classes-tp1679467p1679573.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org
> mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained,
> reproducible code.
> >
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 66
> Date: Tue, 23 Mar 2010 21:46:45 +0100
> From: Erich Neuwirth <erich.neuwirth at univie.ac.at>
> To: r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID: <4BA928B5.7080100 at univie.ac.at>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> We are using RPad for a teaching application here.
> But we had to find many things the hard way,
> and additionally, it did not survive the latest R release
> change.
> There is a minimal repair, but the maintainer does not
> answer any email
> any more. We did the repair and are giving a modified
> version to our
> students, but we do not have enough resource to take over
> maintenance.
> 
> 
> 
> On 3/23/2010 8:00 PM, sjaffe wrote:
> > 
> > Is anyone using rpad? Is there any documentation or
> examples beyond that in
> > the 'man' directory of the source? 
> > 
> 
> -- 
> Erich Neuwirth, University of Vienna
> Faculty of Computer Science
> Computer Supported Didactics Working Group
> Visit our SunSITE at http://sunsite.univie.ac.at
> Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
> 
> 
> 
> ------------------------------
> 
> Message: 67
> Date: Tue, 23 Mar 2010 16:50:12 -0400
> From: shankar at bios.unc.edu
> To: r-help at r-project.org
> Cc: shankar at bios.unc.edu
> Subject: [R] Saving tab/csv delimited data with NaN's
> Message-ID: <20100323165012.sn318x65us00c8w8 at mail.bios.unc.edu>
> Content-Type: text/plain;   
> charset=ISO-8859-1;    DelSp="Yes";
>     format="flowed"
> 
> Hello,
> I am working multiple simulated data sets with missing
> values, I would  
> like to store these data sets in either tab delimited
> format for .csv  
> format with missing values marked as NaN's instead of
> NA's.
> 
> I read the import/export document which mentions that
> write.table  
> command converts NaN's to NA. Is there any other way I can
> store the  
> NaN's. I tried the write syntax it gives me error codes.
> Each data files are of dimensions 1000 x 21 .
> 
> I would appreciate any help in this regard.
> 
> Many thanks
> 
> 
> 
> ------------------------------
> 
> Message: 68
> Date: Wed, 24 Mar 2010 10:12:04 +1300
> From: Rolf Turner <r.turner at auckland.ac.nz>
> To: <shankar at bios.unc.edu>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Saving tab/csv delimited data with NaN's
> Message-ID: <60F846CD-B0D6-4DEF-A57E-532CD258E714 at auckland.ac.nz>
> Content-Type: text/plain; charset="us-ascii"
> 
> 
> On 24/03/2010, at 9:50 AM, shankar at bios.unc.edu
> wrote:
> 
> > Hello,
> > I am working multiple simulated data sets with missing
> values, I would  
> > like to store these data sets in either tab delimited
> format for .csv  
> > format with missing values marked as NaN's instead of
> NA's.
> > 
> > I read the import/export document which mentions that
> write.table  
> > command converts NaN's to NA. Is there any other way I
> can store the  
> > NaN's. I tried the write syntax it gives me error
> codes.
> > Each data files are of dimensions 1000 x 21 .
> > 
> > I would appreciate any help in this regard.
> 
> A feasible workaround is to convert your data to character
> before writing them.
> 
> Suppose that your data are in a data frame called
> ``clyde''.  Set
> 
> mung <- as.data.frame(lapply(clyde,as.character))
> write.csv(mung,"mung.csv",row.names=FALSE,quote=FALSE)
> 
> # Check:
> gorp <- read.csv("mung.csv")
> all.equal(gorp,clyde)
> [1] TRUE
> 
> HTH
> 
>     cheers,
> 
>         Rolf Turner
> ######################################################################
> Attention: 
> This e-mail message is privileged and confidential. If you
> are not the 
> intended recipient please delete the message and notify the
> sender. 
> Any views or opinions presented are solely those of the
> author.
> 
> This e-mail has been scanned and cleared by MailMarshal 
> www.marshalsoftware.com
> ######################################################################
> 
> 
> 
> ------------------------------
> 
> Message: 69
> Date: Tue, 23 Mar 2010 16:15:14 -0500
> From: Sarah Berke <skberke at gmail.com>
> To: r-help at r-project.org
> Subject: [R] Adding matrix rows that have the same name?
> Message-ID:
>     <ebcfe7821003231415j6927349bhdde7aa62520bb9b0 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Does anyone know if there is an R function that will take a
> matrix like this
> 
> jim     1  0  0  0 
> 0  0
> jim     0  1  0  0 
> 0  0
> jim     0  0  1  0 
> 0  0
> bob    1  0  0  0  0  0
> bob    0  0  1  0  0  0
> harry  0  0  1  0  0  0
> harry  0  0  0  1  0  0
> harry  0  0  0  0  1  0
> harry  0  0  0  0  0  1
> 
> and make it like this? (that is, add together rows that
> have the same name?)
> 
> jim    1 1 1 0 0 0
> bob   1 0 1 0 0 0
> harry 0 0 1 1 1 1
> 
> 
> here's the code I started with, if it helps
> 
> library (dummies)
> a <- c(1,1,1,2,2,3,3,3,3)
> b<- c("A","B","C","A","C","C","D","E","F")
> name<- c("jim", "jim", "jim", "bob", "bob", "harry",
> "harry", "harry", "harry")
> MyMat <- cbind (a, b)
> rownames (MyMat) <- name
> dum.mat.temp <- dummy ("b", MyMat)
>        #dum.mat.temp <-cbind
> (name, dum.mat.temp) # if you want names
> as a column
> dum.mat.temp
> 
> Many thanks in advance!
> --Sarah
> 
> 
> 
> ------------------------------
> 
> Message: 70
> Date: Tue, 23 Mar 2010 22:18:51 +0100
> From: Philippe Grosjean <phgrosjean at sciviews.org>
> To: sjaffe <sjaffe at riskspan.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID: <4BA9303B.5020807 at sciviews.org>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> Hello,
> 
> You could try svSocket that creates a socket server where
> several 
> clients can connect simultaneously. The server is
> restricted to local 
> clients for obvious security reasons, but if you would like
> to access it 
> though a network, you can use stunnel to transfer the data
> crypted with SSL.
> Best,
> 
> Philippe Grosjean
> 
> ..............................................<?}))><........
>   ) ) ) ) )
> ( ( ( ( (    Prof. Philippe Grosjean
>   ) ) ) ) )
> ( ( ( ( (    Numerical Ecology of Aquatic
> Systems
>   ) ) ) ) )   Mons University, Belgium
> ( ( ( ( (
> ..............................................................
> 
> On 23/03/10 20:57, sjaffe wrote:
> >
> >
> > Sharpie wrote:
> >>
> >> You could try Sage:
> >>
> >>    http://www.sagemath.org
> >>
> >
> > Yes, I've tried Sage (briefly) and it is very
> interesting. But what I'm
> > looking for here is a client-server system that allows
> multiple users to
> > access the results of R without exposing the details.
> 
> 
> 
> ------------------------------
> 
> Message: 71
> Date: Tue, 23 Mar 2010 18:24:22 -0300
> From: Henrique Dallazuanna <wwwhsd at gmail.com>
> To: Sarah Berke <skberke at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Adding matrix rows that have the same
> name?
> Message-ID:
>     <da79af331003231424l781fa074qe4db7343bee3512a at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Try this:
> 
> aggregate(as.data.frame(dum.mat.temp),
> list(row.names(dum.mat.temp)), sum)
> 
> On Tue, Mar 23, 2010 at 6:15 PM, Sarah Berke <skberke at gmail.com>
> wrote:
> > Does anyone know if there is an R function that will
> take a matrix like this
> >
> > jim ? ? 1 ?0 ?0 ?0 ?0 ?0
> > jim ? ? 0 ?1 ?0 ?0 ?0 ?0
> > jim ? ? 0 ?0 ?1 ?0 ?0 ?0
> > bob ? ?1 ?0 ?0 ?0 ?0 ?0
> > bob ? ?0 ?0 ?1 ?0 ?0 ?0
> > harry ?0 ?0 ?1 ?0 ?0 ?0
> > harry ?0 ?0 ?0 ?1 ?0 ?0
> > harry ?0 ?0 ?0 ?0 ?1 ?0
> > harry ?0 ?0 ?0 ?0 ?0 ?1
> >
> > and make it like this? (that is, add together rows
> that have the same name?)
> >
> > jim ? ?1 1 1 0 0 0
> > bob ? 1 0 1 0 0 0
> > harry 0 0 1 1 1 1
> >
> >
> > here's the code I started with, if it helps
> >
> > library (dummies)
> > a <- c(1,1,1,2,2,3,3,3,3)
> > b<- c("A","B","C","A","C","C","D","E","F")
> > name<- c("jim", "jim", "jim", "bob", "bob",
> "harry", "harry", "harry", "harry")
> > MyMat <- cbind (a, b)
> > rownames (MyMat) <- name
> > dum.mat.temp <- dummy ("b", MyMat)
> > ? ? ? #dum.mat.temp <-cbind (name, dum.mat.temp) #
> if you want names
> > as a column
> > dum.mat.temp
> >
> > Many thanks in advance!
> > --Sarah
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> -- 
> Henrique Dallazuanna
> Curitiba-Paran?-Brasil
> 25? 25' 40" S 49? 16' 22" O
> 
> 
> 
> ------------------------------
> 
> Message: 72
> Date: Tue, 23 Mar 2010 14:23:02 -0700
> From: ROLL Josh F <JRoll at lcog.org>
> To: "'David Winsemius'" <dwinsemius at comcast.net>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Setting breaks to data more appropriately
> Message-ID:
>     <506F591A54F21D4480EE337F77369C0501CFAFFD at LCEXG03.lc100.net>
> Content-Type: text/plain; charset="us-ascii"
> 
> David 
> Thanks you for the guidance.  I am looking to drive
> the data into the intervals.  Problem now is that I
> have a few 0 values that are returning as NA (e.g ->
> (0.1,0.2] (0.1,0.2] (0.1,0.2] <NA>     
> (0,0.1]  )
> This is causing issues when I try and use the brks to
> inform a clorepleth map.  I tried setting all na's to 0
> but because the dataset is in factor form (I guess this is
> why) it wont allow me to do so. Thoughts about how to handle
> the zero values?  Thanks 
> JR
> 
> -----Original Message-----
> From: David Winsemius [mailto:dwinsemius at comcast.net]
> 
> Sent: Monday, March 22, 2010 12:46 PM
> To: ROLL Josh F
> Cc: r-help at r-project.org
> Subject: Re: [R] Setting breaks to data more appropriately
> 
> 
> On Mar 22, 2010, at 1:49 PM, LCOG1 wrote:
> 
> >
> > Basic question.  For the below data, i would like
> to but each of the 
> > values in a bin that represents their value.  So
> the below would 
> > hopefully put .1 in the 0-.1 bin, .2 in the .11-.2 bin
> and so forth.  
> > The outlyingg values would then be put into and outer
> category 
> > representing everything
> > >1.  Im
> > using the breaks to inform some code for making a
> clorepleth map that 
> > represents probabilities, which in some cases IS
> greater than 1
> 
> ... not if it's a quantile or a probability.
> 
> > and i need
> > to identify those better.
> 
> Define "better".
> 
> > As my code stands now, my real data is put put into
> this form when 
> > brks is called:
> >
> >        0%     
>   10%        20%   
>     30%        40% 
>        
> > 50%        60%
> > 0.00000000 0.05054675 0.07787235 0.11235238 0.14424786
> 0.18089360 
> > 0.21475990
> >       70%     
>   80%        90%   
>    100%
> > 0.26309899 0.30807771 0.39478573 0.6573483.
> >
> > But what i want is for the values to be placed in bins
> corresponding 
> > to their value(0-.1, .11-.2, .21-.3 etc)
> >
> > Pct.SFD<-c(.1,.2,.3,.4,.5,.6,.7,.8,.9,1,2,3)
> > brks <- quantile(Pct.SFD, )
> >
> > I think this is clear.
> 
> It's not. You need to decide whether you want the breaking
> to be driven by you or by the data. If you are doing the
> driving then use
> 
> cut(object, breaks=c(seq(0,1, by=0.1), Inf) , right=TRUE)
> 
> If the data is doing the driving then:
> 
> cut(object, breaks=quantile(object, probs= seq(0,1,1/10 ) )
> ,
> right=TRUE)
> 
> --
> David.
> 
> > Thanks
> > --
> > View this message in context: 
> > http://n4.nabble.com/Setting-breaks-to-data-more-appropriately-tp16780
> > 19p1678019.html Sent from the R help mailing list
> archive at 
> > Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> 
> 
> 
> ------------------------------
> 
> Message: 73
> Date: Tue, 23 Mar 2010 21:41:07 +0000 (UTC)
> From: j verzani <jverzani at gmail.com>
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] rpad ?
> Message-ID: <loom.20100323T223656-425 at post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
> 
> sjaffe <sjaffe <at> riskspan.com> writes:
> 
> 
> 
> > 
> > 
> > Sharpie wrote:
> > > 
> > > You could try Sage:
> > > 
> > >   http://www.sagemath.org
> > > 
> > 
> > Yes, I've tried Sage (briefly) and it is very
> interesting. But what I'm
> > looking for here is a client-server system that allows
> multiple users to
> > access the results of R without exposing the details.
> 
> 
> 
> You might find gWidgetsWWW able to do what you want. Some
> demos are here:
> 
> www.math.csi.cuny.edu/gWidgetsWWW
> 
> --John
> 
> 
> 
> ------------------------------
> 
> Message: 74
> Date: Tue, 23 Mar 2010 16:49:19 -0500
> From: Marc Schwartz <marc_schwartz at me.com>
> To: "Prew, Paul" <Paul.Prew at ecolab.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Sample size for proportion, not binomial
> Message-ID: <C56551A0-FCE8-4FFE-8857-D16DD3827D11 at me.com>
> Content-Type: text/plain; charset=windows-1252
> 
> On Mar 23, 2010, at 11:05 AM, Prew, Paul wrote:
> 
> > Hello,  I am looking for a sample size function
> for samples sizes, to test proportions that are not binomial
> proportions.  The proportions represent a ratio of
> (final measure) / (baseline measure) on the same
> experimental unit.  Searches using RSeek and such bring
> multiple hits for binomial proportions, but that doesn't
> seem to fit my situation.  Perhaps there's some
> standard terminology from a different field that would
> provide better hits than deeming this a 'rate' or a
> 'proportion'.
> > 
> > Of course, most sample size functions assume a normal
> distribution, while this data will be bounded between 0 and
> 1.  The scientist I'm working with feels it's important
> to make fair comparisons, any weight loss must account for
> the baseline weight.  A logistic transformation seems
> appropriate, but that term also didn't yield hits I
> recognized as useful.
> > 
> > Loss of weight --- compare treatments:
> > Treatment A:  1 - Final weight / Initial weight
> > Treatment B:  1 - Final weight / Initial weight
> > 
> > This appears to be a situation that would be common,
> but I'm not framing it in a way that matches an R
> package.  Any guidance is appreciated.
> > 
> > Regards, Paul
> 
> 
> If you and the scientist are in a position of being open to
> better options of analyzing "change from baseline" data, I
> would recommend that you both read the following two
> papers:
> 
>  
> Statistics notes: analysing controlled trials with baseline
> and follow up measurements. 
> Vickers AJ, Altman DG.
> BMJ 2001;323:1123?4.
> http://www.bmj.com/cgi/content/full/323/7321/1123
> http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1121605/pdf/1123.pdf
> 
>  
> The use of percentage change from baseline as an outcome in
> a controlled trial is statistically inefficient: a
> simulation study. 
> Vickers AJ.
> BMC Med Res Methodol 2001;1:6.
> http://www.biomedcentral.com/1471-2288/1/6
> http://www.biomedcentral.com/content/pdf/1471-2288-1-6.pdf
> 
> 
> and review an additional web site:
> 
>   http://biostat.mc.vanderbilt.edu/wiki/Main/MeasureChange
> 
> 
> Once you are hopefully in a position of adopting a
> regression based approach (eg. FinalWeight ~ BaseWeight +
> Treatment), there are various options for calculating sample
> sizes.  The key advantage of this approach is that you
> get the baseline adjusted between-group comparison (the
> regression beta coefficient and confidence intervals for
> Treatment) which is the key outcome of interest in comparing
> treatments in a parallel design.
> 
> The easiest, albeit conservative approach for sample size,
> is to use power.t.test() on your assumptions of the
> inter-group delta for actual weight change (not percent
> change), the std dev for actual change, desired power and
> target alpha. 
> 
> I am not aware off-hand of any power/sample size functions
> in R for regular linear regression, though they may exist.
> There are third party programs that do provide that
> functionality. 
> 
> If you are willing to code and experiment a bit, you could
> construct a monte carlo simulation with a linear model,
> using data generated with rnorm() based upon reasonable
> assumptions about the distribution of your data in each
> group for the baseline and final values.
> 
> Once you get your actual data collected and ready for
> analysis, you will also need to test for a
> baseline*treatment interaction (FinalWeight ~ BaseWeight *
> Treatment), which can make the interpretation of treatment
> effects more complicated, since the treatment effect will be
> conditional upon the baseline weight, rather than being able
> to report a mean treatment effect.
> 
> HTH,
> 
> Marc Schwartz
> 
> 
> 
> ------------------------------
> 
> Message: 75
> Date: Tue, 23 Mar 2010 17:58:38 -0400
> From: Nikhil Kaza <nikhil.list at gmail.com>
> To: ApproxGaussian <pcasas at technomics.net>
> Cc: "r-help at r-project.org
> Forum" <r-help at r-project.org>
> Subject: Re: [R] Optim() Help, Unusual Error
> Message-ID: <EE4A02CC-44FF-4A00-80BD-C4392A5596A3 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed;
> delsp=yes
> 
> I cannot replicate the error.
> 
> The following seem to work.
> 
> Y <- runif(100)
> comp <- matrix(runif(6500),100,65)
> par <- rep(.5, 28)
> optim.results <- optim(par, fn=objective.function,
> method="Nelder- 
> Mead",comp=comp, Y=Y, n=100) # Not sure why you are
> selecting the  
> columns in the comp. That is probably the error
> 
> Nikhil
> 
> On Mar 23, 2010, at 3:38 PM, ApproxGaussian wrote:
> 
> >
> > I apologize, the "c" is in the original coding; I
> merely misprinted  
> > (copy and
> > paste).
> >
> > I have edited the orginal post to reflect this.
> > -- 
> > View this message in context: http://n4.nabble.com/Optim-Help-Unusual-Error-tp1679363p1679582.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> 
> 
> 
> ------------------------------
> 
> Message: 76
> Date: Tue, 23 Mar 2010 18:23:18 -0400
> From: David Winsemius <dwinsemius at comcast.net>
> To: ROLL Josh F <JRoll at lcog.org>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Setting breaks to data more appropriately
> Message-ID: <50EBD747-415E-46DD-80AA-EE0C1658A43E at comcast.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed;
> delsp=yes
> 
> 
> On Mar 23, 2010, at 5:23 PM, ROLL Josh F wrote:
> 
> > David
> > Thanks you for the guidance.  I am looking to
> drive the data into  
> > the intervals.  Problem now is that I have a few
> 0 values that are  
> > returning as NA (e.g -> (0.1,0.2] (0.1,0.2]
> (0.1,0.2] <NA>       
> > (0,0.1]  )
> > This is causing issues when I try and use the brks to
> inform a  
> > clorepleth map.  I tried setting all na's to 0
> but because the  
> > dataset is in factor form (I guess this is why) it
> wont allow me to  
> > do so. Thoughts about how to handle the zero
> values?  Thanks
> > JR
> >
> 
> ?cut
> 
> By default include.lowest is set to FALSE. Setting it to
> TRUE should  
> cure your missing zeroes problem. (My own feeling is that
> was a very  
> poor choice of defaults but I guess it is cast in stone
> now.)
> 
> You don't say how you tried setting NA's to zero (and doing
> so is not  
> a good idea if there are real zeroes in the data), but the
> is.na and  
> is.na<- functions are often needed for that purpose.
> 
> -- 
> David.
> > -----Original Message-----
> > From: David Winsemius [mailto:dwinsemius at comcast.net]
> > Sent: Monday, March 22, 2010 12:46 PM
> > To: ROLL Josh F
> > Cc: r-help at r-project.org
> > Subject: Re: [R] Setting breaks to data more
> appropriately
> >
> >
> > On Mar 22, 2010, at 1:49 PM, LCOG1 wrote:
> >
> >>
> >> Basic question.  For the below data, i would
> like to but each of the
> >> values in a bin that represents their value. 
> So the below would
> >> hopefully put .1 in the 0-.1 bin, .2 in the .11-.2
> bin and so forth.
> >> The outlying values would then be put into and
> outer category
> >> representing everything
> >>> 1.  Im
> >> using the breaks to inform some code for making a
> clorepleth map that
> >> represents probabilities, which in some cases IS
> greater than 1
> >
> > ... not if it's a quantile or a probability.
> >
> >> and i need
> >> to identify those better.
> >
> > Define "better".
> >
> >> As my code stands now, my real data is put put
> into this form when
> >> brks is called:
> >>
> >>       0%   
>     10%        20% 
>       30%        40%
> >> 50%        60%
> >> 0.00000000 0.05054675 0.07787235 0.11235238
> 0.14424786 0.18089360
> >> 0.21475990
> >>      70%       
> 80%        90%   
>    100%
> >> 0.26309899 0.30807771 0.39478573 0.67573483.
> >>
> >> But what i want is for the values to be placed in
> bins corresponding
> >> to their value(0-.1, .11-.2, .21-.3 etc)
> >>
> >> Pct.SFD<-c(.1,.2,.3,.4,.5,.6,.7,.8,.9,1,2,3)
> >> brks <- quantile(Pct.SFD, )
> >>
> >> I think this is clear.
> >
> > It's not. You need to decide whether you want the
> breaking to be  
> > driven by you or by the data. If you are doing the
> driving then use
> >
> > cut(object, breaks=c(seq(0,1, by=0.1), Inf) ,
> right=TRUE)
> >
> > If the data is doing the driving then:
> >
> > cut(object, breaks=quantile(object, probs=
> seq(0,1,1/10 ) ) ,
> > right=TRUE)
> >
> > --
> > David.
> >
> >> Thanks
> >> --
> >> View this message in context:
> >> http://n4.nabble.com/Setting-breaks-to-data-more-appropriately-
> 
> >> tp16780
> >> 19p1678019.html Sent from the R help mailing list
> archive at
> >> Nabble.com.
> >>
> >> ______________________________________________
> >> R-help at r-project.org
> mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained,
> reproducible code.
> >
> >
> 
> David Winsemius, MD
> West Hartford, CT
> 
> 
> 
> ------------------------------
> 
> Message: 77
> Date: Tue, 23 Mar 2010 14:03:01 -0800 (PST)
> From: Jim Price <price_ja at hotmail.com>
> To: r-help at r-project.org
> Subject: [R] Bold greek letters using plotmath
> Message-ID: <1269381781408-1679759.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> I'm trying to annotate some graphics using plotmath and
> finding out that the
> code I'm using isn't bolding the greek letters - it bolds
> the rest (once I
> adjusted the numerics to characters), it's just failing on
> the greek
> characters.
> 
> Any suggestions welcomed.
> 
> Jim Price.
> Cardiome Pharma Corp.
> 
> 
> Test code:
> 
> 
> plot(1:5, type = 'n')
> 
> 
> # The not bold version
> text(2, 2:4, cex = 2, labels = do.call(expression, 
>     unlist(list('Placebo', lapply(c(3, 6),
> function(.x) substitute(.x ~~ mu * g
> / kg / hr, list(.x = .x)))), recur = F)))
> 
> 
> # The bold version - note that the greek letter doesn't
> change
> text(4, 2:4, cex = 2, labels = do.call(expression, 
>     unlist(list(substitute(bold(Placebo)),
> lapply(as.character(c(3, 6)),
> function(.x) substitute(bold(.x ~~ mu * g / kg / hr),
> list(.x = .x)))),
> recur = F)))
> 
> 
> 
> 
> 
> 
> > sessionInfo()
> R version 2.10.0 (2009-10-26) 
> i386-pc-mingw32 
> 
> locale:
> [1] LC_COLLATE=English_United States.1252 
> LC_CTYPE=English_United
> States.1252   
> [3] LC_MONETARY=English_United States.1252
> LC_NUMERIC=C             
>             
> [5] LC_TIME=English_United States.1252    
> 
> attached base packages:
> [1] graphics  grDevices utils 
>    datasets 
> methods   stats 
>    base     
> 
> other attached packages:
> [1] foreign_0.8-38 
>    latticeExtra_0.6-1 RColorBrewer_1.0-2
> lattice_0.17-26   
> 
> loaded via a namespace (and not attached):
> [1] grid_2.10.0  tools_2.10.0
> 
> 
> -- 
> View this message in context: http://n4.nabble.com/Bold-greek-letters-using-plotmath-tp1679759p1679759.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 78
> Date: Tue, 23 Mar 2010 18:47:09 -0400
> From: Andrew Rominger <ajrominger at gmail.com>
> To: r-help at r-project.org
> Subject: [R] Diffusion entropy analysis
> Message-ID:
>     <69bf7b591003231547s529c6639hc570b99ae2bd75f3 at mail.gmail.com>
> Content-Type: text/plain
> 
> Hello,
> 
> Does anyone know of an R implementation of diffusion
> entropy analysis (DEA)
> as proposed by Scafetta dn Grigolini (2002)?  I was
> unable to find any
> existing functions, so I attempted to write up my own, but
> cannot reproduce
> known results, so obviously I'm doing something wrong.
> 
> If there does not appear to be any existing script, I'll
> send along my
> attempts for your critique.  I'd also be happy for any
> leads on scripts
> written in languages other than R.
> 
> Thanks very much in advance--
> Andy Rominger
> 
> Scafetta N, and Grigolini P (2002) Scaling detection in
> time series:
> Diffusion entropy analysis.  Phys. Rev. E 66:1:10.
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 79
> Date: Tue, 23 Mar 2010 15:34:44 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] Saving tab/csv delimited data with NaN's
> Message-ID: <1269387284983-1679844.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> shankar-17 wrote:
> > 
> > Hello,
> > I am working multiple simulated data sets with missing
> values, I would  
> > like to store these data sets in either tab delimited
> format for .csv  
> > format with missing values marked as NaN's instead of
> NA's.
> > 
> > I read the import/export document which mentions that
> write.table  
> > command converts NaN's to NA. Is there any other way I
> can store the  
> > NaN's. I tried the write syntax it gives me error
> codes.
> > Each data files are of dimensions 1000 x 21 .
> > 
> > I would appreciate any help in this regard.
> > 
> > Many thanks
> > 
> 
> > foo <- matrix(0,nrow=3,ncol=3)
> > foo
>      [,1] [,2] [,3]
> [1,]    0    0    0
> [2,]    0    0    0
> [3,]    0    0    0
> 
> > foo[3,3] <- NA
> > foo
>      [,1] [,2] [,3]
> [1,]    0    0    0
> [2,]    0    0    0
> [3,]    0    0   NA
> 
> > write.csv( foo, file='tst.csv', na = "NaN", row.names
> = F )
> > readLines( 'tst.csv' )
> [1] "\"V1\",\"V2\",\"V3\"" "0,0,0"     
>           "0,0,0"
> [4] "0,0,NaN"
> 
> Seems to work fine for me.  If you post a reproducible
> example, we could
> probably figure out why it is not working for you.
> 
> -Charlie
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/Saving-tab-csv-delimited-data-with-NaN-s-tp1679673p1679844.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 80
> Date: Wed, 24 Mar 2010 12:48:14 +1300
> From: Rolf Turner <r.turner at auckland.ac.nz>
> To: R-help Forum <r-help at r-project.org>
> Subject: [R] Plot ``freezes''.
> Message-ID: <F9A7477C-12CE-4505-B9A9-DB0B75FF9504 at auckland.ac.nz>
> Content-Type: text/plain; charset="us-ascii"
> 
> 
> In an elderly version of ``plotSymbols'' (now in the
> cwhmisc package) that
> I had lying around, there was the example
> 
> plot(1:10,xlab="\374")
> 
> which the comments said would give a u-umlaut as the x-axis
> label.
> 
> When I execute this plot
> 
>     (a) I get no x-axis label at all, and
> 
>     (b) the plot ``freezes'' in that further
> plotting commands
>     (e.g. plot(runif(42))) produce no
> results.  The plot window (X11)
>     remains as it was after the
> ``plot(1:10,xlab="\374")'' command.
>     No error message is given, but no new
> plot is produced.
> 
> If I do dev.off(), then normal plotting recommences. 
> Can anyone explain
> to me what is going on here?  My session info is given
> below.  I run R
> from the command line, from a terminal window.
> 
>     cheers,
> 
>         Rolf Turner
> 
> > sessionInfo()
> R version 2.10.1 (2009-12-14) 
> i386-apple-darwin8.11.1 
> 
> locale:
> [1] en_NZ.UTF-8/en_NZ.UTF-8/C/C/en_NZ.UTF-8/en_NZ.UTF-8
> 
> attached base packages:
> [1] datasets  utils 
>    stats 
>    graphics  grDevices
> methods   base     
> 
> other attached packages:
> [1] misc_0.0-12    fortunes_1.3-7
> MASS_7.3-4    
> 
> 
> 
> 
> ######################################################################
> Attention:\ This e-mail message is privileged and
> confid...{{dropped:9}}
> 
> 
> 
> ------------------------------
> 
> Message: 81
> Date: Wed, 24 Mar 2010 00:53:14 +0100
> From: Christoffer Karlsson <cmanbigbro at gmail.com>
> To: r-help at r-project.org
> Subject: Re: [R] Log linear model - Showing non-deviation
> form in
>     glm()
> Message-ID:
>     <621b8c671003231653k663fd049v19d3358ca7a56ac7 at mail.gmail.com>
> Content-Type: text/plain
> 
> I just found the assoc plot function in vcd which lets me
> visualize the data
> and shows which effects are significant.
> 
> I'm not sure if I'm misinterpreting the coefficients from
> R. The way I
> interpreted is that since, for example, the interaction
> term
> typNya:kategori1-10 is significant and positive, this would
> mean that theres
> a larger probability of someone belonging to the factor Nya
> to end up in
> "1-10" than someone from Gamla.
> However, when I change the order of the factors I get the
> same coefficients
> but for different factors. So for example if I switch place
> of "0" and
> "1-10" it will now instead show "0" as significant with the
> same coeff as
> for "1-10" in the original order.
> 
> The assoc plot still showed only "1-10" to be significant
> though.
> 
> Getting confused, so any help would be very much
> appreciated ;)
> Chris
> 
> On Tue, Mar 23, 2010 at 10:27 AM, Christoffer Karlsson
> <cmanbigbro at gmail.com
> > wrote:
> 
> > Hey,
> >
> > Whenever I set up a log linear model using glm(Y~. ,
> data=data,
> > family=poisson) I get the parameters in the form of
> deviation from the first
> > cell kombination.
> >
> > I find this to be hard to interpret when I for
> instance want to know if
> > there is a difference between two factors in the first
> category since those
> > parameters are not shown directly.
> > Is there any way to get the summary() command, or
> equivalent, to show me
> > all of the parameters in the model in non-deviation
> form?
> >
> > I can use loglin() to get the parameters, but it
> doesnt show significance
> > of the parameters from what I can tell.
> >
> > Alternatively, can anyone give a brief explanation of
> how to interpret the
> > model in deviation form? For example here I have the
> factors "Gamla" and
> > "Nya" and the categories "0", "1-10", "11-50",
> "51-100" and "101+"
> > The interpretation of the shown interaction terms are
> no problem, but how
> > do I figure if there is a difference between Gamla and
> Nya when it comes to
> > category "0"?
> >
> > (Intercept)           
> 7.74760    0.02078 372.852  < 2e-16 ***
> > typNya             
>   -2.34943    0.07040 -33.371  <
> 2e-16 ***
> > kategori1-10         
> -1.88966    0.05735 -32.950  < 2e-16 ***
> > kategori101+         
> -4.05872    0.15947 -25.451  < 2e-16 ***
> > kategori11-50     
>    -2.63561    0.08035
> -32.802  < 2e-16 ***
> > kategori51-100       
> -4.61210    0.20955 -22.010  < 2e-16 ***
> > typNya:kategori1-10    0.72561   
> 0.14935   4.858 1.18e-06 ***
> > typNya:kategori101+   -1.33945 
>   1.01486  -1.320    0.187
> > typNya:kategori11-50   0.18189 
>   0.25221   0.721    0.471
> > typNya:kategori51-100 -0.09291   
> 0.74056  -0.125    0.900
> >
> >
> > Thanks for any help, and sorry for the supposedly
> basic question!
> > Chris
> >
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 82
> Date: Wed, 24 Mar 2010 12:58:35 +1300
> From: Rolf Turner <r.turner at auckland.ac.nz>
> To: Sharpie <chuck at sharpsteen.net>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Saving tab/csv delimited data with NaN's
> Message-ID: <18EE06CE-124D-45E2-B6D5-E4925B5E26D5 at auckland.ac.nz>
> Content-Type: text/plain; charset="us-ascii"
> 
> 
> On 24/03/2010, at 12:34 PM, Sharpie wrote:
> 
> > 
> > 
> > shankar-17 wrote:
> >> 
> >> Hello,
> >> I am working multiple simulated data sets with
> missing values, I would  
> >> like to store these data sets in either tab
> delimited format for .csv  
> >> format with missing values marked as NaN's instead
> of NA's.
> >> 
> >> I read the import/export document which mentions
> that write.table  
> >> command converts NaN's to NA. Is there any other
> way I can store the  
> >> NaN's. I tried the write syntax it gives me error
> codes.
> >> Each data files are of dimensions 1000 x 21 .
> >> 
> >> I would appreciate any help in this regard.
> >> 
> >> Many thanks
> >> 
> > 
> >> foo <- matrix(0,nrow=3,ncol=3)
> >> foo
> >     [,1] [,2] [,3]
> > [1,]    0    0    0
> > [2,]    0    0    0
> > [3,]    0    0    0
> > 
> >> foo[3,3] <- NA
> >> foo
> >     [,1] [,2] [,3]
> > [1,]    0    0    0
> > [2,]    0    0    0
> > [3,]    0   
> 0   NA
> > 
> >> write.csv( foo, file='tst.csv', na = "NaN",
> row.names = F )
> >> readLines( 'tst.csv' )
> > [1] "\"V1\",\"V2\",\"V3\"" "0,0,0"     
>           "0,0,0"
> > [4] "0,0,NaN"
> > 
> > Seems to work fine for me.  If you post a
> reproducible example, we could
> > probably figure out why it is not working for you.
> 
> 
> This doesn't work if you have both NAs and NaNs in your
> data frame and you
> want to distinguish between these.  I.e. when you read
> the data back in,
> all NAs will have been converted to NaNs.
> 
> Admittedly the OP said he wanted to represent all NAs as
> NaNs, so your
> solution would seem to work for him.
> 
>     cheers,
> 
>         Rolf Turner
> 
> ######################################################################
> Attention:\ This e-mail message is privileged and
> confid...{{dropped:9}}
> 
> 
> 
> ------------------------------
> 
> Message: 83
> Date: Tue, 23 Mar 2010 19:08:38 -0500
> From: Ralf B <ralf.bierig at gmail.com>
> To: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: [R] Changing axis origin for plot
> Message-ID:
>     <45bd2a281003231708k4b93b88ep9f641543f9e056c5 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi all,
> 
> I am plotting data using the simple plot function:
> 
> plot(data$x, data$y)
> 
> which results in a standard plot with the axis origin in
> the lower left corner.
> 
> ^
> |
> |
> |
> |
> | O O
> | O O
> ---------------------------------->
> 
> Since my data are screen coordinates I need mirrored axis
> so that the
> origin for both axis is in the upper left corner; like
> this:
> 
> |-------------------------------->
> | O O
> | O O
> |
> |
> |
> |
> |
> v
> 
> Anybody know how? I did not find any parameter when
> consulting the
> help file. I assume its a more general parameter but where
> is that
> documented?
> 
> Ralf
> 
> 
> 
> ------------------------------
> 
> Message: 84
> Date: Tue, 23 Mar 2010 16:11:35 -0800 (PST)
> From: Sharpie <chuck at sharpsteen.net>
> To: r-help at r-project.org
> Subject: Re: [R] Saving tab/csv delimited data with NaN's
> Message-ID: <1269389495360-1679909.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
> Rolf Turner wrote:
> > 
> > 
> > On 24/03/2010, at 12:34 PM, Sharpie wrote:
> >>> foo <- matrix(0,nrow=3,ncol=3)
> >>> foo
> >>     [,1] [,2] [,3]
> >> [1,]    0    0    0
> >> [2,]    0    0    0
> >> [3,]    0    0    0
> >> 
> >>> foo[3,3] <- NA
> >>> foo
> >>     [,1] [,2] [,3]
> >> [1,]    0    0    0
> >> [2,]    0    0    0
> >> [3,]    0   
> 0   NA
> >> 
> >>> write.csv( foo, file='tst.csv', na = "NaN",
> row.names = F )
> >>> readLines( 'tst.csv' )
> >> [1] "\"V1\",\"V2\",\"V3\"" "0,0,0"   
>             "0,0,0"
> >> [4] "0,0,NaN"
> >> 
> >> Seems to work fine for me.  If you post a
> reproducible example, we could
> >> probably figure out why it is not working for
> you.
> > 
> > 
> > This doesn't work if you have both NAs and NaNs in
> your data frame and you
> > want to distinguish between these.  I.e. when you
> read the data back in,
> > all NAs will have been converted to NaNs.
> > 
> > Admittedly the OP said he wanted to represent all NAs
> as NaNs, so your
> > solution would seem to work for him.
> > 
> >     cheers,
> > 
> >         Rolf Turner
> > 
> 
> 
> Aye, it still works if I replace the NA in my matrix with
> NaN.  If there is
> a mixture of NAs and NaNs, there will be some loss of
> distinction as you
> say.
> 
> However, I can not tell if this is the case from the
> original post-- hence
> the need for an example!
> 
> -Charlie
> 
> -----
> Charlie Sharpsteen
> Undergraduate-- Environmental Resources Engineering
> Humboldt State University
> -- 
> View this message in context: http://n4.nabble.com/Saving-tab-csv-delimited-data-with-NaN-s-tp1679673p1679909.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 85
> Date: Tue, 23 Mar 2010 17:54:03 -0700
> From: Dennis Murphy <djmuser at gmail.com>
> To: Sarah Berke <skberke at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Adding matrix rows that have the same
> name?
> Message-ID:
>     <9a8a6c631003231754p67e46a96i492f32b8d39f0c6d at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi:
> 
> The plyr solution is as follows, where your 'matrix' is a
> data frame m whose
> first column is a factor:
> 
> > m
>      V1 V2 V3 V4 V5 V6 V7
> 1   jim  1  0  0 
> 0  0  0
> 2   jim  0  1  0 
> 0  0  0
> 3   jim  0  0  1 
> 0  0  0
> 4   bob  1  0  0 
> 0  0  0
> 5   bob  0  0  1 
> 0  0  0
> 6 harry  0  0  1  0  0  0
> 7 harry  0  0  0  1  0  0
> 8 harry  0  0  0  0  1  0
> 9 harry  0  0  0  0  0  1
> > str(m)
> 'data.frame':   9 obs. of  7
> variables:
>  $ V1: Factor w/ 3 levels "bob","harry",..: 3 3 3 1 1 2 2 2
> 2
>  $ V2: int  1 0 0 1 0 0 0 0 0
> <V3 through V7 are also numeric>
> 
> library(plyr)
> ddply(m, "V1", numcolwise(sum))
>      V1 V2 V3 V4 V5 V6 V7
> 1   bob  1  0  1 
> 0  0  0
> 2 harry  0  0  1  1  1  1
> 3   jim  1  1  1 
> 0  0  0
> 
> ddply() takes a data frame as input and outputs a data
> frame. "V1" specifies
> the (categorical) variable over which reductions are
> desired, and
> numcolwise(fun)
> applies the function supplied as its argument to all
> numeric columns.
> 
> HTH,
> Dennis
> 
> On Tue, Mar 23, 2010 at 2:15 PM, Sarah Berke <skberke at gmail.com>
> wrote:
> 
> > Does anyone know if there is an R function that will
> take a matrix like
> > this
> >
> > jim     1  0  0 
> 0  0  0
> > jim     0  1  0 
> 0  0  0
> > jim     0  0  1 
> 0  0  0
> > bob    1  0  0  0 
> 0  0
> > bob    0  0  1  0 
> 0  0
> > harry  0  0  1  0  0  0
> > harry  0  0  0  1  0  0
> > harry  0  0  0  0  1  0
> > harry  0  0  0  0  0  1
> >
> > and make it like this? (that is, add together rows
> that have the same
> > name?)
> >
> > jim    1 1 1 0 0 0
> > bob   1 0 1 0 0 0
> > harry 0 0 1 1 1 1
> >
> >
> > here's the code I started with, if it helps
> >
> > library (dummies)
> > a <- c(1,1,1,2,2,3,3,3,3)
> > b<- c("A","B","C","A","C","C","D","E","F")
> > name<- c("jim", "jim", "jim", "bob", "bob",
> "harry", "harry", "harry",
> > "harry")
> > MyMat <- cbind (a, b)
> > rownames (MyMat) <- name
> > dum.mat.temp <- dummy ("b", MyMat)
> >       #dum.mat.temp
> <-cbind (name, dum.mat.temp) # if you want names
> > as a column
> > dum.mat.temp
> >
> > Many thanks in advance!
> > --Sarah
> >
> > ______________________________________________
> > R-help at r-project.org
> mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained,
> reproducible code.
> >
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 86
> Date: Tue, 23 Mar 2010 18:05:56 -0700
> From: Hongwei Dong <pdxdong at gmail.com>
> To: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: [R] Monte Carlo simulation in R
> Message-ID:
>     <1b27d6791003231805u74991354j8f642dd3b74348b1 at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi, R-helpers,
> 
> I'm trying to use R to do a Monte Carlo simulation and need
> the help. What I
> have is a matrix that consists of the probabilities for the
> persons to
> choose zones. For example, in the matrix shown below, each
> column represents
> a person, and each row represents a zone. So, the
> probability that the first
> person will choose the 2nd zone is 30%.
> 
>  25% 30% 10%  30% 20% 0%  20% 50% 60%  50%
> 0% 10%  20% 0% 20%
> 
> Based on this matrix, I want to locate the persons to zones
> based on the
> probability using a Monte Carlo method. The result I want
> to see is like
> this:
> 
>  0 0 0  0 0 0  0 1 1  1 0 0  0 0 0
> 
> Could anyone please give some help? Thanks.
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 87
> Date: Wed, 24 Mar 2010 01:15:32 +0000 (UTC)
> From: Ben Bolker <bolker at ufl.edu>
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] no predict function in lme4 ?
> Message-ID: <loom.20100324T021156-234 at post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
> 
> Douglas Bates <bates <at> stat.wisc.edu>
> writes:
> 
> > It is not easy to decide what "predict" should return
> for a linear
> > mixed model, let alone the more complicated
> cases.  Do you want
> > predictions based on the fixed-effects only or based
> on a combination
> > of the fixed-effects and the random-effects?  For
> the lme function in
> > the nlme package we allowed "levels" of predictions
> but that won't
> > work for all models that can be fit with lme4.
> 
>   I do actually think there's a reasonable way to
> specify this --
> an indicator specifying which random effects should have
> their
> conditional modes included in the prediction (the default
> could
> be either 'none' or 'all').
> 
>   Further discussion should presumably move to
> r-sig-mixed-models.
> > 
> > On Tue, Mar 23, 2010 at 9:18 AM, Markus Loecher
> wrote:
> > > Dear mixed effects modelers,
> > > I seem unable to find a predict method for mer
> objects in the package lme4.
> > > Am I not seeing the forest for the trees ?
> 
>   In the meantime you can construct your own model
> matrices
> and use them to generate the predictions by hand -- see
> 
> http://glmm.wikidot.com/local--files/examples/Owls.pdf
> http://glmm.wikidot.com/local--files/examples/Owls.Rnw
> 
>   for a bit of a worked example.
> 
>   Ben Bolker
> 
> 
> 
> ------------------------------
> 
> Message: 88
> Date: Tue, 23 Mar 2010 21:20:04 -0400
> From: Tom Short <tshort.rlists at gmail.com>
> To: Erich Neuwirth <erich.neuwirth at univie.ac.at>,
> r-help at r-project.org
> Subject: Re: [R] rpad ?
> Message-ID:
>     <fd27013a1003231820s52a4174cv74ab4f4bae5d665a at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> As the author of Rpad, I'll say that it is officially
> abandoned. I
> just don't have the time or the need for my job. If someone
> is
> interested in maintaining it, I'll try to answer questions
> (the email
> address listed on the package hasn't worked for a while,
> and the
> mailing list got overwhelmed with spam).
> 
> Of the other R web interfaces I've played with or looked
> at, RApache
> is the most promising. It offers more performance and
> security than
> the Rpad approach. You can also make% some pretty
> interactive pages.
> The trade-off is that it's harder to build applications
> (the last time
> I looked anyway). To get interactivity, the RApache
> approach requires
> a fair amount of javascript programming. Rpad gives you
> interactivity
> fairly automatically as a webpage with embedded R code.
> 
> - Tom
> 
> Tom Short
> 
> 
> On Tue, Mar 23, 2010 at 4:46 PM, Erich Neuwirth
> <erich.neuwirth at univie.ac.at>
> wrote:
> > We are using RPad for a teaching application here.
> > But we had to find many things the hard way,
> > and additionally, it did not survive the latest R
> release change.
> > There is a minimal repair, but the maintainer does not
> answer any email
> > any more. We did the repair and are giving a modified
> version to our
> > students, but we do not have enough resource to take
> over maintenance.
> >
> >
> >
> > On 3/23/2010 8:00 PM, sjaffe wrote:
> >>
> >> Is anyone using rpad? Is there any-ocumentation
> or examples beyond that in
> >> the 'man' directory of the source?
> >>
> >
> > --
> > Erich Neuwirth, University of Vienna
> > Faculty of Computer Science
> > Computer Supported Didactics Working Group
> > Visit our SunSITE at http://sunsite.univie.ac.at
> > Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 89
> Date: Tue, 23 Mar 2010 21:59:42 -0400
> From: David Winsemius <dwinsemius at comcast.net>
> To: Hongwei Dong <pdxdong at gmail.com>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Monte Carlo simulation in R
> Message-ID: <3AD319BA-3688-48C2-8C2A-5F3A9FABC586 at comcast.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed;
> delsp=yes
> 
> 
> On Mar 23, 2010, at 9:05 PM, Hongwei Dong wrote:
> 
> > Hi, R-helpers,
> >
> > I'm trying to use R to do a Monte Carlo simulation and
> need the  
> > help. What I
> > have is a matrix that consists of the probabilities
> for the persons to
> > choose zones. For example, in the matrix shown below,
> each column  
> > represents
> > a person, and each row represents a zone. So, the
> probability that  
> > the first
> > person will choose the 2nd zone is 30%.
> >
> > 25% 30% 10%  30% 20% 0%  20% 50% 60% 
> 50% 0% 10%  20% 0% 20%
> 
> As Alex Trebeck would say: Can you put that in the form of
> an R data  
> object?
> 
> >
> > Based on this matrix, I want to locate the persons to
> zones based on  
> > the
> > probability using a Monte Carlo method. The result I
> want to see is  
> > like
> > this:
> >
> > 0 0 0  0 0 0  0 1 1  1 0 0  0 0 0
> >
> > Could anyone please give some help? Thanks.
> 
> You cannot specify what the result _will_ be and call the
> process  
> simulation of results at the same time. The sample function
> should  
> work for a vector. Why not use it?
> 
> -- 
> David.
> 
> 
> David Winsemius, MD
> West Hartford, CT
> 
> 
> 
> ------------------------------
> 
> Message: 90
> Date: Tue, 23 Mar 2010 16:16:16 -0800 (PST)
> From: LCOG1 <jroll at lcog.org>
> To: r-help at r-project.org
> Subject: [R] Getting choropleth map intervals correct
> Message-ID: <1269389776346-1679914.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Hello all, 
> Working on mapping some probabilities using R to a
> geographic unit called a
> TAZ.    The below data will work but you will
> have to set your directory for
> the shape file.  Never did this before so hopefully
> this works.  ResProbs is
> just supposed to be a value between 0-1, sorry if that more
> complicated than
> it needed to be.  
> 
> 
> TazFile <- "*directory*/TAZ.shp"
> TazShape <- readShapeSpatial(TazFile)
> TazShape<-TazShape[order(TazShape$TAZ_NUM),]
> 
> ResTaz<-25:666
> ResProbs<-rnorm(642,0:1)
> ResProbs[ResProbs>1]=.5
> ResProbs[ResProbs<-1]=.2
> ResProbs<-abs(ResProbs)
> 
> ResProbs..<-data.frame(ResTaz,ResProbs)
> names(ResProbs..)<-c("Taz","SFsubM")
> TazShape$SFsubM<-ResProbs..$SFsubM[match(TazShape$TAZ_NUM,ResProbs..$Taz)]
> brks<-cut(TazShape$SFsubM, breaks=c(seq(0,1, by=0.1),
> Inf) ,
> right=TRUE,include.lowest=TRUE)
> cols <- grey((length(brks):2)/length(brks))
> plot(TazShape, col=cols[findInterval(TazShape$SFsubM,
> brks,
> all.inside=TRUE)])
> 
> I get the error:
> Error in findInterval(TazShape$SFsubM, brks, all.inside =
> TRUE) : 
>   'vec' must be sorted non-decreasingly
> 
> The code i took this from created "brks" as a quantile
> returning:
>    0%        10% 
>       20%       
> 30%        40%     
>   50%        60% 
> 0.00000000 0.03858501 0.07693546 0.11647164 0.14702968
> 0.18308665 0.22484961 
>        70%     
>   80%        90%   
>    100% 
> 0.26566555 0.31217598 0.39463130 0.73439360 
> 
> which is not what i want but rather putting data into the
> correct "bins".  I
> remedied this by the above code describing "brks", which
> now returns an
> interval.  
> 
> So basically what im after is to illustrate probabilities
> for each of my
> geographic units for my shape file with breaks at each .1,
> using gray or any
> other color for that matter.  Thanks
> 
>   http://n4.nabble.com/file/n1679914/TAZ.shp TAZ.shp 
> -- 
> View this message in context: http://n4.nabble.com/Getting-choropleth-map-intervals-correct-tp1679914p1679914.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 91
> Date: Tue, 23 Mar 2010 20:00:15 -0700
> From: Hongwei Dong <pdxdong at gmail.com>
> To: David Winsemius <dwinsemius at comcast.net>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: [R] with data in the form of an R data objecte:
> Monte Carlo
>     simulation in R
> Message-ID:
>     <1b27d6791003232000l58eec98dk27a332fbfa7c12f at mail.gmail.com>
> Content-Type: text/plain
> 
> Hi,  please use the following the matrix z as the
> example:
> 
> x<-c(2,4,5,7,6,9,8,2,0)
> y<-matrix(x,3,3)
> z<-apply(y,2,function(x)x/sum(x))
> z
> 
> 
> 
> 
> On Tue, Mar 23, 2010 at 6:59 PM, David Winsemius <dwinsemius at comcast.net>wrote:
> 
> >
> > On Mar 23, 2010, at 9:05 PM, Hongwei Dong wrote:
> >
> >  Hi, R-helpers,
> >>
> >> I'm trying to use R to do a Monte Carlo simulation
> and need the help. What
> >> I
> >> have is a matrix that consists of the
> probabilities for the persons to
> >> choose zones. For example, in the matrix shown
> below, each column
> >> represents
> >> a person, and each row represents a zone. So, the
> probability that the
> >> first
> >> person will choose the 2nd zone is 30%.
> >>
> >> 25% 30% 10%  30% 20% 0%  20% 50%
> 60%  50% 0% 10%  20% 0% 20%
> >>
> >
> > As Alex Trebeck would say: Can you put that in the
> form of an R data
> > object?
> >
> >
> >
> >> Based on this matrix, I want to locate the persons
> to zones based on the
> >> probability using a Monte Carlo method. The result
> I want to see is like
> >> this:
> >>
> >> 0 0 0  0 0 0  0 1 1  1 0 0  0
> 0 0
> >>
> >> Could anyone please give some help? Thanks.
> >>
> >
> > You cannot specify what the result _will_ be and call
> the process
> > simulation of results at the same time. The sample
> function should work for
> > a vector. Why not use it?
> >
> > --
> > David.
> >
> >
> > David Winsemius, MD
> > West Hartford, CT
> >
> >
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 92
> Date: Tue, 23 Mar 2010 23:28:07 -0400
> From: Viswanathan Shankar <viswanat at email.unc.edu>
> To: Rolf Turner <r.turner at auckland.ac.nz>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Saving tab/csv delimited data with NaN's
> Message-ID: <4BA986C7.5080803 at email.unc.edu>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> Thank you a ton - this simplifies my work considerably.-
> Shankar
> 
> Rolf Turner wrote:
> > On 24/03/2010, at 9:50 AM, shankar at bios.unc.edu
> wrote:
> >
> >   
> >> Hello,
> >> I am working multiple simulated data sets with
> missing values, I would  
> >> like to store these data sets in either tab
> delimited format for .csv  
> >> format with missing values marked as NaN's instead
> of NA's.
> >>
> >> I read the import/export document which mentions
> that write.table  
> >> command converts NaN's to NA. Is there any other
> way I can store the  
> >> NaN's. I tried the write syntax it gives me error
> codes.
> >> Each data files are of dimensions 1000 x 21 .
> >>
> >> I would appreciate any help in this regard.
> >>     
> >
> > A feasible workaround is to convert your data to
> character before writing them.
> >
> > Suppose that your data are in a data frame called
> ``clyde''.  Set
> >
> > mung <- as.data.frame(lapply(clyde,as.character))
> >
> write.csv(mung,"mung.csv",row.names=FALSE,quote=FALSE)
> >
> > # Check:
> > gorp <- read.csv("mung.csv")
> > all.equal(gorp,clyde)
> > [1] TRUE
> >
> > HTH
> >
> >     cheers,
> >
> >         Rolf Turner
> >
> ######################################################################
> > Attention: 
> > This e-mail message is privileged and confidential. If
> you are not the 
> > intended recipient please delete the message and
> notify the sender. 
> > Any views or opinions presented are solely those of
> the author.
> >
> > This e-mail has been scanned and cleared by
> MailMarshal 
> > www.marshalsoftware.com
> >
> ######################################################################
> >
> >
> 
> 
> 
> ------------------------------
> 
> Message: 93
> Date: Wed, 24 Mar 2010 11:44:57 +0530
> From: vibha patel <vibhapatelddu at gmail.com>
> To: r-help at r-project.org
> Subject: [R] how to solve error in precict( ) while using
> with rpart?
> Message-ID:
>     <af4c5ea41003232314n29970155qb0835e1d2031d8ab at mail.gmail.com>
> Content-Type: text/plain
> 
> Hello,
> 
> I am working with rpart function but geting some error in
> prediction.
> the same code works fine with iris dataset.
> 
> but applying other dataset it doesn't work.
> sample code is given for reference.
> 
> > acc_model<-rpart(V1~V2+V3+V4+V5+V6+V7+V8,
> data=accEx.train)
> > plotcp(acc_model)
> >
> acc_find_cp<-(acc_model$cptable)[,"CP"][which.min(acc_model$cptable[,"xerror"])]
> > acc_prune_model<-prune(acc_model,acc_find_cp)
> >
> acc_predict_tree<-predict(acc_prune_model,newdata=accEx.test,
> type="class")
> Error in predict.rpart(acc_prune_model, newdata =
> accEx.test, type =
> "class") :
>   Invalid prediction for rpart object
> 
> #conf.mat
> #function(true, new)
> {
> t <- table(true, new)
> s <- sum(t)
> acc <- round((sum(diag(t)))/s, 2)
> res <- list(conf = t, accuracy = acc)
> }
> 
> # I thought the Error is  in match.arg(type) :
> # 'arg' should be one of “vector”, “prob”,
> “class”, “matrix”
> 
> # accEx.test # V1 is response V2 to V8 are predictors
>          V1   
>   V2    V3  V4   V5 
>   V6 V7  V8
> 1   3.66356 7.74414  -4.4 4.2 
> 0.0  18.0 19 116
> 2   3.04452 8.03398  -5.7 4.8
> -0.3  69.1  9 506
> 3   3.71357 4.70048 -13.5 4.3 
> 0.2  80.0  3  95
> 4   2.94444 7.52510   1.4
> 3.0  0.1 177.0 22 161
> 5   4.06044 7.76260   4.1
> 5.6  1.1 287.0  7  80
> 6   3.68888 7.88683   5.8 2.3
> -0.1 200.0  9  33
> 7   3.33220 7.81521   2.7
> 1.9  0.4 228.0  7 129
> 8   3.36730 7.77779   7.1
> 8.9  0.2 220.0 15 155
> 9   2.07944 6.89163   4.1
> 2.0  0.1 183.0  9 132
> 10  1.94591 7.67740   1.1 5.2 
> 0.1  43.1 10 480
> ......
> ......
> ......
> 
> >
> acc_predict_tree<-predict(acc_prune_model,newdata=accEx.test,
> type="vector")
> > acc_conf<-conf.mat(accEx.train,acc_predict_tree)
> Error in sort.list(unique.default(x), na.last = TRUE) :
>   'x' must be atomic for 'sort.list'
> Have you called 'sort' on a list?
> 
> how to solve this problem?
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 94
> Date: Wed, 24 Mar 2010 06:47:43 +0000 (GMT)
> From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
> To: Jim Price <price_ja at hotmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] Bold greek letters using plotmath
> Message-ID: <alpine.LFD.2.00.1003240634570.7003 at gannet.stats.ox.ac.uk>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
> 
> Plotmath does not have a bold symbol font -- R's plotting
> system has 
> only 5 fonts (see 'font' in ?par), and bold symbol fonts
> are not 
> commonly installed in plotting systems.
> 
> Strictly the symbols such as mu used in mathematical
> notation differ 
> from the letters used in Greek.   You may
> get a good substitute using 
> a Greek letter, depending on the device -- which you have
> not told us 
> but I would guess() was windows().
> 
> Try replating mu by "\u03bc".  (I am not using
> Windows, but this works 
> on X11() and quartz() for example.)
> 
> On Tue, 23 Mar 2010, Jim Price wrote:
> 
> >
> > I'm trying to annotate some graphics using plotmath
> and finding out that the
> > code I'm using isn't bolding the greek letters - it
> bolds the rest (once I
> > adjusted the numerics to characters), it's just
> failing on the greek
> > characters.
> >
> > Any suggestions welcomed.
> >
> > Jim Price.
> > Cardiome Pharma Corp.
> >
> >
> > Test code:
> >
> >
> > plot(1:5, type = 'n')
> >
> >
> > # The not bold version
> > text(2, 2:4, cex = 2, labels = do.call(expression,
> >     unlist(list('Placebo', lapply(c(3,
> 6), function(.x) substitute(.x ~~ mu * g
> > / kg / hr, list(.x = .x)))), recur = F)))
> >
> >
> > # The bold version - note that the greek letter
> doesn't change
> > text(4, 2:4, cex = 2, labels = do.call(expression,
> >    
> unlist(list(substitute(bold(Placebo)),
> lapply(as.character(c(3, 6)),
> > function(.x) 
> substitute(bold(.x ~~ mu * g / kg / hr), list(.x = .x)))),
> > recur = F)))
> >
> >
> >
> >
> >
> >
> >> sessionInfo()
> > R version 2.10.0 (2009-10-26)
> > i386-pc-mingw32
> >
> > locale:
> > [1] LC_COLLATE=English_United States.1252 
> LC_CTYPE=English_United
> > States.1252
> > [3] LC_MONETARY=English_United States.1252
> LC_NUMERIC=C
> > [5] LC_TIME=English_United States.1252
> >
> > attached base packages:
> > [1] graphics  grDevices utils 
>    datasets 
> methods   stats     base
> >
> > other attached packages:
> > [1] foreign_0.8-38 
>    latticeExtra_0.6-1 RColorBrewer_1.0-2
> lattice_0.17-26
> >
> > loaded via a namespace (and not attached):
> > [1] grid_2.10.0  tools_2.10.0
> 
> 
> -- 
> Brian D. Ripley,           
>       ripley at stats.ox.ac.uk
> 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, UK           
>     Fax:  +44 1865 272595
> 
> 
> 
> ------------------------------
> 
> Message: 95
> Date: Wed, 24 Mar 2010 01:53:06 -0500
> From: Ralf B <ralf.bierig at gmail.com>
> To: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: [R] R and/or REngine kills Java
> Message-ID:
>     <45bd2a281003232353x467b0253k530e78b732deab35 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi all,
> 
> I am using R and JRI under Windows XP Pro. I am posting
> this question
> here since the reason might be R related (since I am
> running an R
> script) but there is also a very good chance that it is JRI
> only
> (since I am using the JRI interface to activate the script)
> -- in
> which case I want to apologize for misplacing this
> message.
> 
> I have a method that instantiates an REngine object every
> time it is
> called. It runs a script provided by a file name and closes
> REngine
> afterward. The script works fine, the png file is
> successfully
> generated and the PNG file is released so that I can delete
> it if I
> want ( but I don't in that case). For some strange reason,
> when
> running this code twice I get the following error: upon
> which the Java
> Virtual machine dies on me.
> 
>  Any explanation would be greatly appreciated!
> 
> Best,
> Ralf
> 
> Here the Java code, the R code, and the Java VM error:
> 
> ++++++++++++++++ START JAVA CODE ++++++++++++++++++
> 
> /** Helper method */
> private static void eval(Rengine r, String s) {
>     r.eval(s, false);
> }
>     
> /** Assigns the given java value to the given R variable
> name */
> private static void assign(Rengine r, String rVariableName,
> String javaValue) {
>     r.assign(rVariableName, javaValue);
> }
> 
> public void run() throws Exception {
>         String filepath =
> this.path;
>         
>         if (filepath != null)
> {
>            
> File rFile = new File(filepath );
>             if
> (rFile.exists()) {    // run R script
>            
>     // start R engine
>            
>     if (!Rengine.versionCheck()) {
>            
>         System.err.println("**
> Version mismatch - Java files don't match
> library version.");
>            
>         System.exit(1);
>            
>     }
>            
>     // creating R engine
>            
>     Rengine rEngine = new Rengine(null,
> false, new EmptyCallbacks());
>            
>     // the engine creates R is a new thread,
> so we should wait until it's ready
>            
>     if (!rEngine.waitForR()) {
>            
>        
> System.out.println("Cannot load R for " +
> this.getClass().getName());
>            
>         return;
>            
>     }
> 
>            
>     // executing logic
>            
>     try {
>            
>         assign(rEngine,
> "filename", filepath);
>            
>         eval(rEngine,
> "source(filename)");
>            
>     } catch (Exception e) {
>            
>        
> System.out.println(this.getClass().getName() + ": Error in R
> code: " + e);
>            
>         e.printStackTrace();
>            
>         // stopping R engine
>            
>        
> System.out.println("Error when running script - rEngine
> stopped!");
>            
>         if (rEngine != null){
>            
>            
> rEngine.end();
>            
>         }
>            
>     }
> 
>            
>     // stopping R engine
>            
>     rEngine.end();
>             } else
> {
>            
>     throw new Exception(getClass().getName()
> + " not run - missing
> R file - location: " + rFile.getAbsolutePath());
>             }
>         }
>     }
> 
> +++++++++++++++++++++ END JAVA CODE
> +++++++++++++++++++++++++
> 
> 
> +++++ START  R Code ++++++++
> library(RJDBC)
> 
> # db connection
> driver <-
> JDBC("com.mysql.jdbc.Driver","lib/mysql-connector-java-5.0.6-bin.jar")
> con <- dbConnect(driver, "jdbc:mysql://localhost/mydb",
> "xxx", "yyy")
> 
> # list tables
> dbListTables(con)
> 
> # user, task and event information
> result = dbGetQuery(con, "SELECT x,y from mytable;")
> png(file="output.png")
> plot(result$x, result$y)
> dev.off()
> 
> +++++ START  R Code ++++++++
> 
> ERROR:
> 
> #
> # An unexpected error has been detected by Java Runtime
> Environment:
> #
> #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=....,
> pid=5400, tid=3204
> #
> # Java VM: Java HotSpot(TM) Client VM (11.2-b01 mixed mode,
> ....)
> # Problematic frame:
> # C  [R.dll+0x1136fe]
> #
> 
> # An error report file with more information is saved as:
> # ....
> [WARN] 404 - GET /output.png (127.0.0.1) 1402 bytes
>    Request headers
>       Host: localhost:8888
>       User-Agent: ....
>       Accept:
> image/png,image/*;q=0.8,*/*;q=0.5
>       Accept-Language: en-us,en;q=0.5
>       Accept-Encoding: gzip,deflate
>       Accept-Charset:
> ISO-8859-1,utf-8;q=0.7,*;q=0.7
>       Keep-Alive: 115
>       Connection: keep-alive
>       Referer: http://localhost....
>    Response headers
>       Content-Length: 1402
>       Content-Type: text/html;
> charset=iso-8859-1
> #
> # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> # The crash happened outside the Java Virtual Machine in
> native code.
> # See problematic frame for where to report the bug.
> #
> 
> 
> 
> ------------------------------
> 
> Message: 96
> Date: Wed, 24 Mar 2010 07:11:14 +0000 (GMT)
> From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
> To: Rolf Turner <r.turner at auckland.ac.nz>
> Cc: R-help Forum <r-help at r-project.org>
> Subject: Re: [R] Plot ``freezes''.
> Message-ID: <alpine.LFD.2.00.1003240648350.7003 at gannet.stats.ox.ac.uk>
> Content-Type: text/plain; charset="iso-8859-15";
> Format="flowed"
> 
> On Wed, 24 Mar 2010, Rolf Turner wrote:
> 
> >
> > In an elderly version of ``plotSymbols'' (now in the
> cwhmisc package) that
> > I had lying around, there was the example
> >
> > plot(1:10,xlab="\374")
> >
> > which the comments said would give a u-umlaut as the
> x-axis label.
> 
> In a Latin-1 encoding, which R gave up as default in
> 2.1.0.
> You should just be able to use
> 
> plot(1:10,xlab="?")
> 
> or failing that (and the mailer may trash that line)
> 
> plot(1:10,xlab="\u00fc")
> 
> > When I execute this plot
> >
> >     (a) I get no x-axis label at all,
> and
> >
> >     (b) the plot ``freezes'' in that
> further plotting commands
> >     (e.g. plot(runif(42))) produce no
> results.  The plot window (X11)
> >     remains as it was after the
> ``plot(1:10,xlab="\374")'' command.
> >     No error message is given, but no
> new plot is produced.
> >
> > If I do dev.off(), then normal plotting
> recommences.  Can anyone explain
> > to me what is going on here?  My session info is
> given below.  I run R
> > from the command line, from a terminal window.
> 
> My guess is that this is your 'elderly' Mac OS X11 plotting
> system.
> Does X11(type="Xlib") behave?  If so, this suggests
> that the Mac OS X 
> implementation of cairo (supplied by Simon Urbanek) is not
> too robust 
> (which in a several ways we already know).  On Linux I
> get warnings
> 
> (process:14674): Pango-WARNING **: Invalid UTF-8 string
> passed to 
> pango_layout_set_text()
> 
> and a 'broken char' symbol on the plot.
> 
> >     cheers,
> >
> >         Rolf Turner
> >
> >> sessionInfo()
> > R version 2.10.1 (2009-12-14)
> > i386-apple-darwin8.11.1
> >
> > locale:
> > [1]
> en_NZ.UTF-8/en_NZ.UTF-8/C/C/en_NZ.UTF-8/en_NZ.UTF-8
> >
> > attached base packages:
> > [1] datasets  utils 
>    stats 
>    graphics  grDevices
> methods   base
> >
> > other attached packages:
> > [1] misc_0.0-12    fortunes_1.3-7
> MASS_7.3-4
> 
> -- 
> Brian D. Ripley,           
>       ripley at stats.ox.ac.uk
> 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, UK           
>     Fax:  +44 1865 272595
> 
> ------------------------------
> 
> Message: 97
> Date: Tue, 23 Mar 2010 21:36:27 -0800 (PST)
> From: cbarcelo <caren.barcelo at gmail.com>
> To: r-help at r-project.org
> Subject: [R] how to make a histogram with non-numeric x's?
> Message-ID: <1269408987751-1680093.post at n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> Hello,
> I need to make a histogram with variable x bin ranges. For
> example my bins
> are 0-15, 15-25, 25-40 etc. Any suggestions?
> Thanks!
> 
> -- 
> View this message in context: http://n4.nabble.com/how-to-make-a-histogram-with-non-numeric-x-s-tp1680093p1680093.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> 
> 
> ------------------------------
> 
> Message: 98
> Date: Wed, 24 Mar 2010 01:32:59 -0700
> From: Jim Silverton <jim.silverton at gmail.com>
> To: r-help at r-project.org
> Subject: Re: [R] Affymetrix Cancer Dataset
> Message-ID:
>     <b137ab71003240132j754bec0l3af258e3202ac955 at mail.gmail.com>
> Content-Type: text/plain
> 
> I am looking for an online (easily accessible) form of the
> samples of
> genetic data for those with cancer and those without
> cancer. Can anyone
> direct me in the right place?
> 
> Thanks,
> 
> Jim
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> Message: 99
> Date: Wed, 24 Mar 2010 09:36:38 +0100
> From: Henrik Bengtsson <hb at stat.berkeley.edu>
> To: Jim Silverton <jim.silverton at gmail.com>
> Cc: r-help <r-help at r-project.org>
> Subject: Re: [R] Affymetrix Cancer Dataset
> Message-ID:
>     <59d7961d1003240136l6a8f16c6n74391cb9be8e015 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> You might find something of interest via this page:
> 
>   http://www.aroma-project.org/node/51
> 
> /Henrik
> 
> On Wed, Mar 24, 2010 at 9:32 AM, Jim Silverton <jim.silverton at gmail.com>
> wrote:
> > I am looking for an online (easily accessible) form of
> the samples of
> > genetic data for those with cancer and those without
> cancer. Can anyone
> > direct me in the right place?
> >
> > Thanks,
> >
> > Jim
> >
> > ? ? ? ?[[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org
> 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.
> >
> 
> 
> 
> ------------------------------
> 
> Message: 100
> Date: Wed, 24 Mar 2010 20:17:21 +1100
> From: Jim Lemon <jim at bitwrit.com.au>
> To: Ralf B <ralf.bierig at gmail.com>
> Cc: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Changing axis origin for plot
> Message-ID: <4BA9D8A1.7060003 at bitwrit.com.au>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> On 03/24/2010 11:08 AM, Ralf B wrote:
> > Hi all,
> >
> > I am plotting data using the simple plot function:
> >
> > plot(data$x, data$y)
> >
> > which results in a standard plot with the axis origin
> in the lower left corner.
> >
> > ^
> > |
> > |
> > |
> > |
> > | O O
> > | O O
> > ---------------------------------->
> >
> > Since my data are screen coordinates I need mirrored
> axis so that the
> > origin for both axis is in the upper left corner; like
> this:
> >
> > |-------------------------------->
> > | O O
> > | O O
> > |
> > |
> > |
> > |
> > |
> > v
> >
> > Anybody know how? I did not find any parameter when
> consulting the
> > help file. I assume its a more general parameter but
> where is that
> > documented?
> 
> Hi Ralf,
> I don't know of any options or call to "par" that will
> change which axes 
> are displayed. You can do what you want like this:
> 
> plot(...,xaxt="n")
> axis(3,...)
> 
> unless you want to reverse the direction of the ordinate
> (y-axis). In 
> that case, have a look at the revaxis function in the
> plotrix package.
> 
> Jim
> 
> 
> 
> ------------------------------
> 
> Message: 101
> Date: Wed, 24 Mar 2010 20:30:29 +1100
> From: Jim Lemon <jim at bitwrit.com.au>
> To: cbarcelo <caren.barcelo at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] how to make a histogram with non-numeric
> x's?
> Message-ID: <4BA9DBB5.5090901 at bitwrit.com.au>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> On 03/24/2010 04:36 PM, cbarcelo wrote:
> >
> > Hello,
> > I need to make a histogram with variable x bin ranges.
> For example my bins
> > are 0-15, 15-25, 25-40 etc. Any suggestions?
> > Thanks!
> >
> Hi cbarcelo,
> You can just do this:
> 
> x<-sample(0:40,100,TRUE)
> hist(x,breaks=c(0,15,25,40))
> 
> which will produce densities, or:
> 
> hist(x,breaks=c(0,15,25,40),freq=TRUE)
> 
> which will display counts, but complain about it, or:
> 
> barplot(hist(x,breaks=c(0,15,25,40))$counts,
>   names.arg=c("(0-15]","(15-25]","(25-40]"))
> 
> which may be what you want.
> 
> Jim
> 
> 
> 
> ------------------------------
> 
> Message: 102
> Date: Wed, 24 Mar 2010 10:20:24 -0000 (GMT)
> From: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> To: "r-help at r-project.org"
> <r-help at r-project.org>
> Subject: Re: [R] Monte Carlo simulation in R
> Message-ID: <XFMail.100324102024.Ted.Harding at manchester.ac.uk>
> Content-Type: text/plain; charset=iso-8859-1
> 
> On 24-Mar-10 01:05:56, Hongwei Dong wrote:
> > Hi, R-helpers,
> > 
> > I'm trying to use R to do a Monte Carlo simulation and
> need
> > the help. What I have is a matrix that consists of the
> probabilities
> > for the persons to choose zones. For example, in the
> matrix shown
> > below, each column represents a person, and each row
> represents a
> > zone. So, the probability that the first person will
> choose the
> > 2nd zone is 30%.
> > 
> >  25% 30% 10%  30% 20% 0%  20% 50%
> 60%  50% 0% 10%  20% 0% 20%
> > 
> > Based on this matrix, I want to locate the persons to
> zones based
> > on the probability using a Monte Carlo method. The
> result I want
> > to see is like this:
> > 
> >  0 0 0  0 0 0  0 1 1  1 0 0 
> 0 0 0
> > 
> > Could anyone please give some help? Thanks.
> 
> You will need to state (and probably formulate) the problem
> better.
> You have presented your "matrix" as a single line of 5
> blocks of 3.
> 
>   25% 30% 10%  30% 20% 0%  20% 50% 60% 
> 50% 0% 10%  20% 0% 20%
> 
> It is ambiguous as to whether a block of 3 is a row or a
> column.
> So this could represent
> 
>   Person = 1   2   3
> ----------------------
> Zone = 1  25% 30% 10%
>        2  30% 20%  0%
>        3  20% 50% 60%
>        4  50%  0% 10%
>        5  20%  0% 20%
> 
> in which Person=1 and Zone=3 gets 30% (as you state).
> Or it could represent
> 
>   Person =
> 1   2   3   4   5
> ------------------------------
> Zone = 1  25% 30% 20% 50% 20%
>        2  30% 20% 50% 
> 0%  0%
>        3  10%  0% 60%
> 10% 20%
> 
> Once again, Person=1 and Zone=2 gets 30%. So your example
> does
> not identify which of these two representations is the one
> you intend.
> 
> I suspect you mean the first, since in that you have
> columns
> 2 and 3 adding up to 100% (which, as probabilities over
> the
> choices each Person could make, they have to do), and this
> does not occur for any column of the second. But column 1
> in
> the first does not add up to 100% -- so what would you
> then
> mean by the percentages in column 1? Or do you intend an
> interpretation of your statement according to which the
> percentages in the columns do not represent probabilities
> which add to 1?
> 
> In that case, the second representation could also be
> valid.
> But then what do your percentages mean?
> 
> More details, please!
> Ted.
> 
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 24-Mar-10           
>                
>            Time:
> 10:20:22
> ------------------------------ XFMail
> ------------------------------
> 
> 
> 
> ------------------------------
> 
> Message: 103
> Date: Wed, 24 Mar 2010 11:57:35 +0100
> From: Simon Kiss <sjkiss at gmail.com>
> To: r-help at r-project.org
> Subject: [R] R Full Screen
> Message-ID: <52000FBA-C584-4CE2-98F9-F1B3BB702FD7 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed; delsp=yes
> 
> Hello all,
> I'm new user with R and just completed a five day course on
> the  
> program. Somehow, a few basic questions remain unanswered.
> I'm working  
> on a Mac Os X system and have my laptop connected to a
> large, flat- 
> screen monitor. I can't make any of the Quartz windows fill
> the  
> monitor's screen; I'd like to make them full screen to
> identify points  
> in a dense scatterplot.
> Thank you for any suggestions. Yours, Simon Kiss
> *********************************
> Simon J. Kiss, PhD
> SSHRC and DAAD Post-Doctoral Fellow
> John F. Kennedy Institute of North America Studies
> Free University of Berlin
> Lansstra?e 7-9
> 14195 Berlin, Germany
> Cell: +49 (0)1525-300-2812,
> Web: http://www.jfki.fu-berlin.de/index.html
> 
> 
> 
> ------------------------------
> 
> Message: 104
> Date: Wed, 24 Mar 2010 22:03:38 +1100
> From: Jim Lemon <jim at bitwrit.com.au>
> To: kathy_BJ <song_bin2000 at yahoo.com>,
> R Project Help
>     <R-help at r-project.org>
> Subject: Re: [R] help needed with boxplot
> Message-ID: <4BA9F18A.3060106 at bitwrit.com.au>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> On 03/24/2010 06:08 AM, kathy_BJ wrote:
> >
> > Thank you so much for help, Jim. But I didn't get any
> plot after I submit the
> > job except below, which indicating the number of lines
> for the two inputs.
> > What's the problem?
> >
> > Read 3360 records
> > Read 3360 records
> >
> > I know I didn't confuse you.
> 
> Okay, let's make up some data and produce a set of
> boxplots.
> 
> file1<-data.frame(
>  
> col1=sample(c(050000000:052000000,220000000:229000000),1000),
>   col2=sample(0:270,1000,TRUE),
>   col3=runif(1000,50,80),col4=runif(1000,50,80),
>   col5=sample(c("RED","GREEN","BLUE"),1000,TRUE))
> file2<-data.frame(
>  
> col1=sample(c(050000000:052000000,220000000:229000000),1000),
>   col2=sample(0:270,1000,TRUE),
>   col3=runif(1000,50,80),col4=runif(1000,50,80),
>   col5=sample(c("RED","GREEN","BLUE"),1000,TRUE))
> file1$col_group<-cut(file1$col2,breaks=c(0,20,50,70,271),
>   right=FALSE)
> file2$col_group<-cut(file2$col2,breaks=c(0,20,50,70,271),
>   right=FALSE)
> reds1<-file1$col5=="RED"
> reds2<-file2$col5=="RED"
> greens1<-file1$col5=="GREEN"
> greens2<-file2$col5=="GREEN"
> blues1<-file1$col5=="BLUE"
> blues2<-file2$col5=="BLUE"
> file1$col43<-file1$col4-file1$col3
> file2$col43<-file2$col4-file2$col3
> col_group11<-as.numeric(file1$col_group)==1
> col_group12<-as.numeric(file1$col_group)==2
> col_group13<-as.numeric(file1$col_group)==3
> col_group14<-as.numeric(file1$col_group)==4
> col_group21<-as.numeric(file2$col_group)==1
> col_group22<-as.numeric(file2$col_group)==2
> col_group23<-as.numeric(file2$col_group)==3
> col_group24<-as.numeric(file2$col_group)==4
> x11(width=9)
> boxplot(file1$col43[reds1&col_group11],
>   file2$col43[reds2&col_group21],
>   file1$col43[reds1&col_group12],
>   file2$col43[reds2&col_group22],
>   file1$col43[reds1&col_group13],
>   file2$col43[reds2&col_group23],
>   file1$col43[reds1&col_group14],
>   file2$col43[reds2&col_group24],
>   main="Comparison of RED col4 and col3 differences
> across col2 groups",
>   names=rep("",8))
> require(plotrix)
> staxlab(at=1:8,
>  
> labels=paste(c("file1","file2"),rep(levels(file1$col_group),each=2)))
> 
> This should produce a set of 8 boxplots comparing the
> medians, etc. of 
> the differences of col4 and col3 between file1 and file 2
> for all of the 
> entries with col5="RED" across the levels of col_group. I
> don't know 
> whether this is what you want, but it might get you
> started.
> 
> Jim
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> R-help at r-project.org
> 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.
> 
> End of R-help Digest, Vol 85, Issue 24
> **************************************
> 






More information about the R-help mailing list