Re: [R] runtime on ising model

2010-10-26 Thread Mike Marchywka
> Date: Tue, 26 Oct 2010 12:53:14 -0400 > From: mike...@gmail.com > To: j...@bitwrit.com.au > CC: r-help@r-project.org > Subject: Re: [R] runtime on ising model > > I have an update on where the issue is coming from. > > I commented out the code for "

[R] Cut including the 0 value as separate bin

2010-10-26 Thread LCOG1
Hi everyone, I have been using R too long to have to ask this but here i am. How do i create a separate bin for the 0 value? So for: #Create data frame DF<-data.frame(A=0:20) #Create label vector labs<-1:6 #Create buckets and label DF$Cut<-cut(DF$A,c(0,4,8,12,14,16,20),labels=labs,include.l

[R] Formatting durations

2010-10-26 Thread Susanta Mohapatra
Hi, I am working with a dataset for sometime and I need some help in parsing some data. There is a column called "Duration" which has data like following: 2 minutes => 120 2 min => 120 10 seconds =>10 2 hrs =>7200 2-3 minutes => 150 or 120 5 minutes (when i arrived => 300 Flyby approx 20 sec. =

[R] About the recursion in R

2010-10-26 Thread Xiuquan Wang
Hi, I am now using R to implement a stepwise algrithom which includes a recursion function. e.g: a = 1 *f_recursion* = function(id) { b = a + id; #: row A if (...){ a = a +1;* f_recursion*(b) } #: row B else{ } } --

[R] see code of plot.survfit

2010-10-26 Thread Bond, Stephen
How can I expose the code behind plot.survfit?? Thanks a lot. Stephen B [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

Re: [R] About the recursion in R

2010-10-26 Thread Duncan Murdoch
On 26/10/2010 5:17 PM, Xiuquan Wang wrote: Hi, I am now using R to implement a stepwise algrithom which includes a recursion function. e.g: a = 1 *f_recursion* = function(id) { b = a + id; #: row A if (...){ a = a +1;* f_recursion*(b) } #: row B

Re: [R] lme vs. lmer results

2010-10-26 Thread Dimitri Liakhovitski
Thanks a lot, Douglas. It's very heplful. A clarification question about specifying the model in lmer. You said it should be: mix.lmer <- lmer(DV ~a+b+c+d+(e+f+g+h+ii|group), mydata) I assume it was a typo and you meant that the last predictor in brackets should be i (rather than ii), right? Als

Re: [R] Dispersion ( Plot error bars ) help

2010-10-26 Thread Ben Bolker
Peter Francis me.com> writes: > > Dear List, > > I am looking to plot error bars on a line using dispersion. > > I have values for the upper value and for the lower values, however > i am unsure how to plot different values > for the upper CI and the lower CI? > > I have been using > > disp

Re: [R] see code of plot.survfit

2010-10-26 Thread Ben Bolker
Bond, Stephen cibc.com> writes: > > How can I expose the code behind plot.survfit?? library(survival) survival:::plot.survfit __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

Re: [R] see code of plot.survfit

2010-10-26 Thread Brian Diggs
On 10/26/2010 2:33 PM, Bond, Stephen wrote: How can I expose the code behind plot.survfit?? Uwe Ligges. R Help Desk: Accessing the sources. R News, 6(4):43-45, October 2006. http://cran.r-project.org/doc/Rnews/ Thanks a lot. Stephen B [[alternative HTML version deleted]] --

Re: [R] calculate area between intersecting polygons

2010-10-26 Thread Remko Duursma
I don't know why I forgot that you can do this as well : area.poly(intersect(p1,p2)) ... a bit more straightforward. greetings, Remko -- View this message in context: http://r.789695.n4.nabble.com/calculate-area-between-intersecting-polygons-tp3012980p3014581.html Sent from the R help mailin

[R] discerning plot dots using colors

2010-10-26 Thread elaine kuo
Dear List, I am using the command plot to present the relationship between bird richness (Y axis) and elevation (X axis). However, I would like to observe the distributions of bird richness in different administrative areas (A, B, C, …., G) in this plot. For example, the dots in area A mig

Re: [R] LaTeX output with mlogit or multinom

2010-10-26 Thread Marc Schwartz
On Oct 26, 2010, at 2:59 PM, Ben Hunter wrote: > Hi everyone, > > Why am I having such a tough time finding a way to put an mlogit summary > table into latex? Everywhere I read says that using Sweave and latex is the > most sophisticated, dynamic way to get output, but it appears very limited > i

Re: [R] discerning plot dots using colors

2010-10-26 Thread Daisy Englert Duursma
There are several ways to do this but the package ggplot2 library(ggplot2) qplot(displ,hwy,data=mpg,colour=factor(cyl)) On Wed, Oct 27, 2010 at 9:06 AM, elaine kuo wrote: > Dear List, > > > > I am using the command plot to present the relationship > > between bird richness (Y axis) and elevatio

Re: [R] discerning plot dots using colors

2010-10-26 Thread Peter Langfelder
On Tue, Oct 26, 2010 at 3:13 PM, Daisy Englert Duursma wrote: > There are several ways to do this but the package ggplot2 > > library(ggplot2) > qplot(displ,hwy,data=mpg,colour=factor(cyl)) > > That can of course be done also using the standard plot command (substitute variable names as necessar

Re: [R] Which version control system to learn for managing R projects?

2010-10-26 Thread Gabor Grothendieck
On Tue, Oct 26, 2010 at 12:16 PM, Tal Galili wrote: > Hello all, > > I wish to learn a version control system for managing my R (data analysis) > projects. > > I know of SVN and github, and wonder if there is any reason for which I > should prefer the one over the other (or any other platform). An

Re: [R] to determine the variable importance in svm

2010-10-26 Thread Max Kuhn
> The caret package has answers to all your questions. >> 1) How to obtain a variable (attribute) importance using >> e1071:SVM (or other >> svm methods)? I haven't implemented a model-specific method for variables importance for SVM models. I know of one package (svmpath) that will return the re

Re: [R] Which version control system to learn for managing R projects?

2010-10-26 Thread Hadley Wickham
> 1. What is everyone else using?  The network effect is important since > you want people to be able to access your repository and you want to > leverage your knowledge of the version control system for other > projects' repositories.  To that extent Subversion is the clear choice > since its used

[R] cube root of a negative number

2010-10-26 Thread Gregory Ryslik
Hi, This might be me missing something painfully obvious but why does the cube root of the following produce an NaN? > (-4)^(1/3) [1] NaN > As we can see: > (-1.587401)^3 [1] -4 Thanks! Greg __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] LaTeX output with mlogit or multinom

2010-10-26 Thread Achim Zeileis
On Tue, 26 Oct 2010, Marc Schwartz wrote: On Oct 26, 2010, at 2:59 PM, Ben Hunter wrote: Hi everyone, Why am I having such a tough time finding a way to put an mlogit summary table into latex? Everywhere I read says that using Sweave and latex is the most sophisticated, dynamic way to get out

Re: [R] cube root of a negative number

2010-10-26 Thread Kjetil Halvorsen
Look at this: > x <- as.complex(-4) > x [1] -4+0i > x^(1/3) [1] 0.793701+1.37473i > (-4)^(1/3) [1] NaN It seems that R gives you the principal root, which is complex, and not the real root. Kjetil On Tue, Oct 26, 2010 at 8:05 PM, Gregory Ryslik wrote: > Hi, > > This might be me missing somethi

Re: [R] Formatting durations

2010-10-26 Thread Gabor Grothendieck
On Tue, Oct 26, 2010 at 3:28 PM, Susanta Mohapatra wrote: > Hi, > > I am working with a dataset for sometime and I need some help in parsing > some data. > > There is a column called "Duration" which has data like following: > > 2 minutes => 120 > 2 min => 120 > 10 seconds =>10 > 2 hrs =>7200 >  2

Re: [R] cube root of a negative number

2010-10-26 Thread sachinthaka . abeywardana
hmm interesting. When I did -4^(1/3) got the correct answer, but then again that's because it processes the negative later. i.e. -4^(1/2) gave me -2 instead of the 2i I expected. Also when I did (-4+0i)^(1/3) it gave me 0.793701+1.37473i. Possible bug? Sachin --- Please consider the environment b

Re: [R] cube root of a negative number

2010-10-26 Thread Bill.Venables
To take it one step further: > x <- as.complex(-4) > cx <- x^(1/3) > > r <- complex(modulus = Mod(cx), argument = Arg(cx)*c(1,3,5)) > r [1] 0.793701+1.37473i -1.587401+0.0i 0.793701-1.37473i > r^3 [1] -4+0i -4+0i -4+0i > So when you ask for "the" cube root of -4, R has a choice of three p

Re: [R] Formatting durations

2010-10-26 Thread Gabor Grothendieck
On Tue, Oct 26, 2010 at 7:17 PM, Gabor Grothendieck wrote: > On Tue, Oct 26, 2010 at 3:28 PM, Susanta Mohapatra > wrote: >> Hi, >> >> I am working with a dataset for sometime and I need some help in parsing >> some data. >> >> There is a column called "Duration" which has data like following: >>

Re: [R] Cut including the 0 value as separate bin

2010-10-26 Thread Henrique Dallazuanna
Try this: cut(DF$A, c(-Inf, 0, 4, 8, 12, 14, 16, 20)) On Tue, Oct 26, 2010 at 7:01 PM, LCOG1 wrote: > > Hi everyone, > > I have been using R too long to have to ask this but here i am. How do i > create a separate bin for the 0 value? So for: > > #Create data frame > DF<-data.frame(A=0:20)

[R] installing ONLY the documentation files (Rd) for many packages?

2010-10-26 Thread Kjetil Halvorsen
I have been searching the documentation for some time nmow, but cannot find it. It must be possible to download packages (many), but only install the help system? How? Kjetil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] cube root of a negative number

2010-10-26 Thread Berwin A Turlach
G'day Gregory, On Tue, 26 Oct 2010 19:05:03 -0400 Gregory Ryslik wrote: > Hi, > > This might be me missing something painfully obvious but why does the > cube root of the following produce an NaN? > > > (-4)^(1/3) > [1] NaN 1/3 is not exactly representable as a binary number. My guess is tha

Re: [R] cube root of a negative number

2010-10-26 Thread Spencer Graves
install.packages('sos')# if you don't have it already library(sos) rs <- ???roots # 216 matches summary(rs) # in 106 packages rs # opens a web browser with all 216 matched in a table # listing the package with the most matches first. # This included roots{signal}, which referenced polyroot{base},

Re: [R] cube root of a negative number

2010-10-26 Thread Jeff Newmiller
Because it is implemented as antilog((1/3)*log(-4)) most likely using base 2 for the log/antilog functions. "Gregory Ryslik" wrote: >Hi, > >This might be me missing something painfully obvious but why does the >cube root of the following produce an NaN? > >> (-4)^(1/3) >[1] NaN >> > >As we ca

[R] Data.frame Vs Matrix Vs Array: Definitions Please

2010-10-26 Thread Matt Curcio
Hi All, I am learning R and having a little trouble with the usage and proper definitions of data.frames vs. matrix vs vectors. I have read many R tutorials, and looked over ump-teen 'cheat' sheets and have found that no one has articulated a really good definition of the differences between 'data.

Re: [R] cube root of a negative number

2010-10-26 Thread Berwin A Turlach
G'day Bill, On Wed, 27 Oct 2010 10:34:27 +1100 wrote: [...] > It is no surprise that this does not work when working in the real > domain, except "by fluke" with something like > > > -4^(1/3) > [1] -1.587401 > > > > where the precedence of the operators is not what you might expect. > Now th

Re: [R] Data.frame Vs Matrix Vs Array: Definitions Please

2010-10-26 Thread Gabor Grothendieck
On Tue, Oct 26, 2010 at 8:37 PM, Matt Curcio wrote: > Hi All, > I am learning R and having a little trouble with the usage and proper > definitions of data.frames vs. matrix vs vectors. I have read many R > tutorials, and looked over ump-teen 'cheat' sheets and have found that > no one has articul

[R] clinical data analysis

2010-10-26 Thread guoya li
I have two sets of data national wide: total patient number=500,000, 8400 died, mortality rate=1.7% Hospital1: total patient number=230, 6 died, mortality rate=2.6%   Is the mortality rate of hospital1 different from mortality rate of nationl wide?   Which function or package should I use to solve

[R] GAM function in mgcv package

2010-10-26 Thread Lorenzo Cattarino
Hi R-users I am trying to use the GAM function of the mgcv package. But I am having problem trying to specify the k parameter. Although I managed to run some models by giving to the parameter some (random) value, and it is explained by Wood (2006) that it does not seem to "really" affect th

[R] writing a table

2010-10-26 Thread lord12
When ever I write a table of columns to a csv file the columns are offset by one column and do not match the column headers. How do I align my columns with the column headers? Also, how do I change the name of my column headers. -- View this message in context: http://r.789695.n4.nabble.com/wri

[R] trouble with histograms

2010-10-26 Thread Marcel Curlin
Hi, I have tab-delimited data with an unequal number of entries per column, of the sort: A B C 1 2 2 3 4 1 5 2 2 6 2 5 2 3 6 2 I would like to make a histogram of the frequencies of each represented number in a "stacked" histogram, where you can see the contribution of eac

Re: [R] writing a table

2010-10-26 Thread Remko Duursma
This probably fixes it, although an example would be nice : write.csv(dfr, row.names=FALSE) you change the names with the ?names function before writing it to a csv file. remko -- View this message in context: http://r.789695.n4.nabble.com/writing-a-table-tp3014821p3014839.html Sent from the

Re: [R] clinical data analysis

2010-10-26 Thread Remko Duursma
?prop.test -- View this message in context: http://r.789695.n4.nabble.com/clinical-data-analysis-tp3014811p3014856.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Zoom in in a plot

2010-10-26 Thread Alaios
Actually I want to see how close are some point to a line segment so I want to use some zoom lenses and zoom in and out into different parts of the plot and see how some places look like. Best Regards From: Greg Snow Sent: Tue, October 26, 2010 6:47:32 P

Re: [R] installing ONLY the documentation files (Rd) for many packages?

2010-10-26 Thread Prof Brian Ripley
On Tue, 26 Oct 2010, Kjetil Halvorsen wrote: I have been searching the documentation for some time nmow, but cannot find it. It must be possible to download packages (many), but only install the help system? I am not sure what you actally want: R CMD INSTALL does not install the Rd files --

[R] [R-pkgs] Introducing the futile.paradigm, a package for functional dispatching in R

2010-10-26 Thread Nurometic R Help
Hello useRs, I'm pleased to announce the general availability of the R package futile.paradigm, which is a language extension that implements functional dispatching in R. This is an alternative to the current object-oriented styles, replacing them with a functional programming style that provides

Re: [R] cube root of a negative number

2010-10-26 Thread Prof Brian Ripley
In this particular case it is part of the C99 stanadrd (7.12.7.4) for the 'pow' function R uses. On Wed, 27 Oct 2010, Berwin A Turlach wrote: G'day Gregory, On Tue, 26 Oct 2010 19:05:03 -0400 Gregory Ryslik wrote: Hi, This might be me missing something painfully obvious but why does the cu

<    1   2