[R] Dickey-Fuller Tests with no constant and no trend

2009-05-15 Thread jbrukh
R has a Dickey-Fuller Test implementation (adf.test) that tests for unit roots in an autoregressive process with a constant and linear trend. Is there a DF implementation that doesn't use the constant or trend? Thanks, Jake. -- View this message in context: http://www.nabble.com/Dickey-Fulle

[R] problem with mle.stepwise

2009-05-15 Thread eariasca
Hello, I am getting some unexpected results when using mle.stepwise: # BEGIN require(wle) x1 = runif(100) x2 = runif(100) y = 3 + 2*x1 + rnorm(100) # so x1 is in the model, but not x2 mle.stepwise(y ~ x1 + x2, type = "Backward") # Backward selection gets it right, the other

[R] anova(cph(..) output

2009-05-15 Thread pompon
Hello, I am a beginner in R and statistics, so my question may be trivial. Sorry in advance. I performed a Cox proportion hazard regression with 2 categorical variables with cph{design}. Then an anova on the results. the output is > anova(cph(surv(survival, censor) ~ plant + leaf.age + plant*le

[R] (no subject)

2009-05-15 Thread Debbie Zhang
Dear R users, Does anyone know how to write a function involving derivative? i.e. I want to implementing Newton's method in R, so my function is something like x<- x-y/y' I am not sure how to write y' in my function. Can anyone help? In addition, if I want to implementing newton's method

Re: [R] About the efficiency of R optimization function

2009-05-15 Thread spencerg
You might get some information about what is available in R using the new "RSiteSearch" package. For example: library(RSiteSearch) ipm <- RSiteSearch.function('interior point method') hits(ipm) # 39 SQP <- RSiteSearch.function('SQP') hits(SQP) # 2 sqp <- RSiteSearch.function('sequential

Re: [R] ggplot2: annotating plot with mathematical formulae

2009-05-15 Thread stephen sefick
how about this a <- 1:10 b <- 1:10 d <- paste("x","^","{n-1}") qplot(a,b, xlab=expression(x^{n-1}))+geom_text(aes(4,8, label=d)) On Fri, May 15, 2009 at 10:02 PM, Paul Emberson wrote: > Hi, > > Is there a way of annotating a ggplot plot with mathematical formulae? > > I can do > > geom_text(aes(

[R] ggplot2: annotating plot with mathematical formulae

2009-05-15 Thread Paul Emberson
Hi, Is there a way of annotating a ggplot plot with mathematical formulae? I can do geom_text(aes(label="some text", ... but I can't do geom_text(aes(label=expression(x^{n-1}), ... It gives the error Error: geom_text requires the following missing aesthetics: label Is there a convenient equ

Re: [R] assign unique size of point in xyplot

2009-05-15 Thread hadley wickham
On Thu, May 14, 2009 at 2:14 PM, Garritt Page wrote: > Hello,I am using xyplot to try and create a conditional plot.  Below is a > toy example of the type of data I am working with > > slevel <- rep(rep(c(0.5,0.9), each=2, times=2), times=2) > > tlevel <- rep(rep(c(0.5,0.9), each=4), times=2) > >

Re: [R] Graphical output format

2009-05-15 Thread cls59
baptiste auguie-2 wrote: > > > Just a thought: > > There was recently a discussion here on the pgfSweave [1] driver --- > it should be possible to use it in conjunction with XeTeX [2] to > process the pgf output. Presumably there will be issues of alignment > and spacing but at least ar

Re: [R] assign unique size of point in xyplot

2009-05-15 Thread Deepayan Sarkar
On Thu, May 14, 2009 at 12:14 PM, Garritt Page wrote: > Hello,I am using xyplot to try and create a conditional plot.  Below is a > toy example of the type of data I am working with > > slevel <- rep(rep(c(0.5,0.9), each=2, times=2), times=2) > > tlevel <- rep(rep(c(0.5,0.9), each=4), times=2) > >

Re: [R] About the efficiency of R optimization function

2009-05-15 Thread cls59
popo UBC wrote: > > Hi Charlie, > > Thank you so much for suggestions!! > > Actually, I used the optimization toolbox in MABLAB before and I even > wrote > some numerical optimization programs by myself. As far as I know, some > commercial optimization softwares had already replaced L-BFGS-B

Re: [R] Matrix package,solve() errors and crashes Please help

2009-05-15 Thread Surendar Swaminathan
> > Hello All, > Please help me with this problem.I have been having this problem for over a month now and I could not find any information.I later realised that error is with MATRIX package. I am working on graph object using IGRAPH version 0.5.2-2 package & wanted to do Bonacich Power. What I

[R] Memory size problems in R

2009-05-15 Thread Fernando José Nascimento Sebastião
Dear all, I have some problems how to increase memory in R. I tried to start R by calling e.g. :(in the Properties, Shortcut tab, Target field) Rgui.exe --max-mem-size=2Gb (Is this correct?) But the error message still continue: > X<-princomp(MAT2D.AltGeop61.90) Error: cannot allocate vect

[R] Converting numbers to and from raw

2009-05-15 Thread Stavros Macrakis
How can I convert an integer or double to and from their internal representation as raws of length 4 and 8? The following works for positive integers (including those represented as floats): # Convert integer (represented as integer or double) to sequence # of raw bytes, least-significant byte fi

Re: [R] can you tell what .Random.seed *was*?

2009-05-15 Thread Dirk Eddelbuettel
On 15 May 2009 at 13:08, G. Jay Kerns wrote: | Thanks very much to Warren and Stavros for their additional insight. | Putting all of this together, I think I am now ready to formulate my | question intelligently: | | Using Sweave, I want to distribute randomly generated problems AND | answers to

Re: [R] can you tell what .Random.seed *was*?

2009-05-15 Thread Stavros Macrakis
On Fri, May 15, 2009 at 12:07 PM, Stavros Macrakis wrote: > system.time(whatseed(runif(1))) Sorry, though I got lucky and my overall result is roughly correct, this is an incorrect time measure. It should be r <- runif(1); system.time(whatseed(r)) because R's call-by-need semantics don't e

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread Ravi Varadhan
Hi, I think "quadratic programming" is the way to go. Look at "solve.QP" or "limSolve" package. Here is a toy example that I had worked out some time back for a linear least squares problem with simple box constraints: # Problem: minimize ||Ax - y||, subject to low <= x <= upp require(limSolve

Re: [R] Sweave: Howto write real TeX formula in plot

2009-05-15 Thread cameron.bracken
cls59 wrote: > > install.packages('pgfSweave',repos='http://www.rforge.net') > For others that are not on Linux. I would suggest using the r-forge site for binary installation. The binaries on rforge.net are not completely up to date in some cases. install.packages("pgfSweave", repos="http:/

Re: [R] readBin: read from defined offset TO defined offset?

2009-05-15 Thread Johannes Graumann
Thanks guys! Duncan's hints regarding "character" (which I was naturally using ;0) and the double "readBin" solved my problem - I'm extracting an index from a REALLY big XML file to get fast direct access to subsections, so that I only have to parse them rather than the whole thing (only SAX-st

Re: [R] can you tell what .Random.seed *was*?

2009-05-15 Thread Warren Young
G. Jay Kerns wrote: I want it to be *difficult* for students to figure out the seed and automatically generate solutions on their own. Hmmm Would it really be a bad thing if someone reverse engineered this to generate answers given the problem set? If it's hard enough to do that, it'd b

Re: [R] drawing arrows

2009-05-15 Thread Christophe Dutang
Thanks, I'll take a look. Christophe Le 15 mai 09 à 20:11, Greg Snow a écrit : > Duncan mentioned the arrows function, which may do everything you > want. But, also look at the my.symbols function in the > TeachingDemos package for another way to draw arrows, or to draw > your circles and

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread spencerg
I suggest you try to translate your constraints into an unconstrained constrained problem using logarithms, then do "nonlinear mixed effects modeling" as described in chapters 6-8 of Pinheiro and Bates (2000). To do this, I would first start with the simpler linear estimation problem to g

Re: [R] drawing arrows

2009-05-15 Thread Greg Snow
Duncan mentioned the arrows function, which may do everything you want. But, also look at the my.symbols function in the TeachingDemos package for another way to draw arrows, or to draw your circles and arrows in 1 step. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Hea

Re: [R] Simulation

2009-05-15 Thread Wacek Kusnierczyk
Greg Snow wrote: > Another possibility (maybe more readable, gives the option of a list, > probably not faster): > > Replicate(1000, rexp(15,1) ) > > provided that simplify=FALSE: is(replicate(10, rexp(15, 1))) # "matrix" ... is(replicate(10, rexp(15, 1), simplify=FALSE)) # "

Re: [R] creating and then executing command strings

2009-05-15 Thread Greg Snow
The arrow "<-" is used to assign a value to a variable, the equals sign "=" is used to specify the value for a function argument. Recent versions of R allow "=" to be used for "<-" at the top level and certain circumstances which some people find more convenient, but can also lead to confusion

Re: [R] Rotating x-axis categorical labels

2009-05-15 Thread Marc Schwartz
On May 15, 2009, at 12:18 PM, Bill Hudspeth wrote: Hello, I am using barplot to generate a histogram of population by county. I need to plot the bars for about 35 counties, and would like to rotate the county name labels on the x-axis to a vertical orientation so that I can fit them all. An

[R] Rotating x-axis categorical labels

2009-05-15 Thread Bill Hudspeth
Hello, I am using barplot to generate a histogram of population by county. I need to plot the bars for about 35 counties, and would like to rotate the county name labels on the x-axis to a vertical orientation so that I can fit them all. An example of my syntax is below: r.barplot(x,main=main, xl

Re: [R] memory usage grows too fast

2009-05-15 Thread Ping-Hsun Hsieh
Hi William, Thanks for the comments and explanation. It is really good to know the details of rowMeans. I did modified Peter's codes from length(x[x=="02"]) to sum(x=="02"), though it improved only in few seconds. :) Best, Mike -Original Message- From: William Dunlap [mailto:wdun...@tib

[R] Any R workshops on BUGS or resampling or other...?

2009-05-15 Thread Kevin W
I would like to know about any workshops/meetings on the topics of (1) using some version of BUGS with R (2) resampling methods (3) other advanced courses. Thanks for any ideas. Kevin Wright [[alternative HTML version deleted]] __ R-help@r-pro

Re: [R] can you tell what .Random.seed *was*?

2009-05-15 Thread G. Jay Kerns
> > Set.seed takes an integer argument, that is, 2^32-1 distinct values > (cf NA_integer_), so the very simplest approach, brute-force search, > has a hope of working: > > whatseed <- function (v)  { >   i <- as.integer(-2^31+1); max <- as.integer(2^31-1) >   while (i } > >> (OK, being able to figu

[R] drawing arrows

2009-05-15 Thread christophe dutang
Hi, I would like to draw arrows in a classic 2D plot. Which package should I use? is there R base functions that do job? On google, I could not find any useful discussion about this topic, except a link to the function 'grid.arrows' of the grid package. My problem is I would like to draw arrows

Re: [R] drawing arrows

2009-05-15 Thread Duncan Murdoch
On 5/15/2009 12:43 PM, christophe dutang wrote: Hi, I would like to draw arrows in a classic 2D plot. Which package should I use? is there R base functions that do job? On google, I could not find any useful discussion about this topic, except a link to the function 'grid.arrows' of the grid pa

Re: [R] Simulation

2009-05-15 Thread Greg Snow
I wrote "replicate" but the darn e-mail program "fixed" it for me. I expected replicate to be a bit slower, but not by that amount. I just wanted to include replicate as a more readable version of lapply while still improving over the loop approach. -- Gregory (Greg) L. Snow Ph.D. Statistica

Re: [R] memory usage grows too fast

2009-05-15 Thread Ping-Hsun Hsieh
Thanks for Peter, William, and Hadley's helps. Your codes are much more concise than mine. :P Both William and Hadley's comments are the same. Here are their codes. f <- function(dataMatrix) rowMeans(datamatrix=="02") And Peter's codes are the following. apply(yourMatrix, 1, f

Re: [R] error writing to connection

2009-05-15 Thread Duncan Murdoch
On 5/15/2009 9:22 AM, Stefo Ratino wrote: Hello, I am using: save(data,file="D:/mayData.RData"), and I have the following error: Error in save(data, file = "D:/mayData.RData") : error writing to connection Do you have permission to create a file there? Try it from outside R. Duncan Murdoc

Re: [R] error writing to connection

2009-05-15 Thread Marc Schwartz
On May 15, 2009, at 8:22 AM, Stefo Ratino wrote: Hello, I am using: save(data,file="D:/mayData.RData"), and I have the following error: Error in save(data, file = "D:/mayData.RData") : error writing to connection Thank you very much in advance, Stefo Presuming that drive 'D' exists an

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread Avraham . Adler
Thank you both very much for your replies. What makes this a little less straightforward, at least to me, is that there needs to be constraints on the solved parameters. They most certainly need to be positive and there may be an upper limit as well. The true best linear fit would have negative en

Re: [R] Printing to screen a matrix or data.frame in one chunk (not splitting columns)

2009-05-15 Thread Marc Schwartz
On May 15, 2009, at 10:58 AM, Adrián Cortés wrote: Hello, I saw this nice trick I want to replicate but I lost the source and I hope one of you can point me to the solution. My problem is that I don't know the correct words to query this. When I print to screen a matrix or data.frame the

Re: [R] Printing to screen a matrix or data.frame in one chunk (not splitting columns)

2009-05-15 Thread Martin Maechler
> "AC" == Adrián Cortés > on Fri, 15 May 2009 08:58:04 -0700 writes: AC> Hello, AC> I saw this nice trick I want to replicate but I lost the source and I hope AC> one of you can point me to the solution. My problem is that I don't know AC> the correct words to query

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread spencerg
Dear Doug, et al.: What would you recommend for analyzing a longitudinal abundance survey of 22 species, when the species were not selected at random? A prominent scientist tried to tell me that mixed-effects modeling is inappropriate in that case because the species were selected pur

Re: [R] Simulation

2009-05-15 Thread Ben Bolker
Greg Snow wrote: > Another possibility (maybe more readable, gives the option of a list, > probably not faster): > > Replicate(1000, rexp(15,1) ) > I think that should be "replicate" The matrix form is quite a bit faster, but don't know if that will matter -- times below are for doing this

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread spencerg
Dear Avraham: For problems with many parameters to estimate, I highly recommend Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer). This book includes numerous examples showing how to use the "nlme" package. The value of this book is greatly enhanced by the

Re: [R] replace "%" with "\%"

2009-05-15 Thread Wacek Kusnierczyk
Marc Schwartz wrote: > > On May 15, 2009, at 9:46 AM, Liviu Andronic wrote: > >> Dear all, >> I'm trying to gsub() "%" with "\%" with no obvious success. >>> temp1 <- c("mean", "sd", "0%", "25%", "50%", "75%", "100%") >>> temp1 >> [1] "mean" "sd" "0%" "25%" "50%" "75%" "100%" >>> gsub

Re: [R] Simulation

2009-05-15 Thread Greg Snow
Another possibility (maybe more readable, gives the option of a list, probably not faster): Replicate(1000, rexp(15,1) ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-proj

[R] Using column length in plot gives error

2009-05-15 Thread MikSmith
Hi I'm trying to write a generic script for processing some data which finishes off with some plots. Given Im never sure how many columns will be in my dataframe I wanted to using the following plot(spectra.wavelength, cormat, type = "l", ylim=c(-1,1), xlab="Wavelength (nm)", ylab="Correlation"

Re: [R] can you tell what .Random.seed *was*?

2009-05-15 Thread Stavros Macrakis
On Thu, May 14, 2009 at 3:36 PM, G. Jay Kerns wrote: > set.seed(something) > x <- rnorm(100) > y <- runif(500) > # bunch of other stuff ... > Now, I give you a copy of my script.R (with the set.seed statement > removed, of course) together with the .RData file that was generated > by the save.imag

[R] Plotting question re. cuminc

2009-05-15 Thread K F Pearce
Hello everyone, (This is my second question posted today on the R list). I am carrying out a competing risks analysis using the cuminc function...this takes the form: cuminc(ftime,fstatus,group) In my study, fstatus has 3 different causes of failure (1,2,3) there are also censored cases (0).

[R] Using column length in plot gives error

2009-05-15 Thread MikSmith
Hi I'm trying to write a generic script for processing some data which finishes off with some plots. Given Im never sure how many columns will be in my dataframe I wanted to using the following plot(spectra.wavelength, cormat, type = "l", ylim=c(-1,1), xlab="Wavelength (nm)", ylab="Correlation"

[R] error writing to connection

2009-05-15 Thread Stefo Ratino
Hello,   I am using: save(data,file="D:/mayData.RData"), and I have the following error:   Error in save(data, file = "D:/mayData.RData") : error writing to connection   Thank you very much in advance, Stefo [[alternative HTML version deleted]]

[R] Printing to screen a matrix or data.frame in one chunk (not splitting columns)

2009-05-15 Thread Adrián Cortés
Hello, I saw this nice trick I want to replicate but I lost the source and I hope one of you can point me to the solution. My problem is that I don't know the correct words to query this. When I print to screen a matrix or data.frame the columns are split and printed below the previous ones; eve

Re: [R] replace "%" with "\%"

2009-05-15 Thread Ted Harding
On 15-May-09 14:46:27, Liviu Andronic wrote: > Dear all, > I'm trying to gsub() "%" with "\%" with no obvious success. >> temp1 <- c("mean", "sd", "0%", "25%", "50%", "75%", "100%") >> temp1 > [1] "mean" "sd" "0%" "25%" "50%" "75%" "100%" >> gsub("%", "\%", temp1, fixed=TRUE) > [1] "m

[R] Function Surv and interpretation

2009-05-15 Thread K F Pearce
Dear everyone, My question involves the use of the survival object. We can have Surv(time,time2,event, type=, origin = 0) (1) As detailed on p.65 of: http://cran.r-project.org/web/packages/survival/survival.pdf My data (used in my study) is 'right ce

[R] data summary and some automated t.tests.

2009-05-15 Thread stephen sefick
I would like to preform a t.test to each of the measured variables (sand.silt etc.) with a mean and sd for each of the treatments (up or down), and out put this as a table I am having a hard time starting- maybe it is to close to lunch. Any suggestions would be greatly appreciated. Stephen S

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread Douglas Bates
On Wed, May 13, 2009 at 5:21 PM, wrote: > > Hello. > > I am trying to optimize a set of parameters using /optim/ in which the > actual function to be minimized contains matrix multiplication and is of > the form: > > SUM ((A%*%X - B)^2) > > where A is a matrix and X and B are vectors, with X as p

Re: [R] Help with loops

2009-05-15 Thread Jorge Ivan Velez
Dear Amit, The following should get you started. What I'm doing is creating an identifiers (g) with the "names" of the columns you want to group for and then use a combination of apply() and tapply() to get the mean for each row in the levels of g. In your case, you have more columns than I have in

Re: [R] Additional points to scatter plot show up at wrong place

2009-05-15 Thread Peter Dalgaard
Peter Menzel wrote: > Hi everyone, > > I have a problem with adding points to scatter plots. > The plot is drawn with the scatterplot() function from the car library: > > scatterplot(data[,2] ~ data[,1], > data=data,smooth=F,reg.line=F,xlim=c(0.5,1),ylim=c(0.5,1),ylab="ML",xlab="Freq",cex.lab=1.9

Re: [R] replace "%" with "\%"

2009-05-15 Thread Liviu Andronic
Thanks all for the prompt responses. Now Hmisc::latex() no longer generates errors on Rcmdr::numSummary() objects (with `tempa' below being such an object). > colnames(tempa$table) <- gsub("%", "\\%", colnames(tempa$table), fixed=TRUE) > latex(tempa$table, cdec=3) Best regards, Liviu On Fri, May

Re: [R] creating and then executing command strings

2009-05-15 Thread Philipp Schmidt
On Fri, May 15, 2009 at 3:38 PM, Romain Francois wrote: > Hi, > > You can either parse and eval the string you are making, as in: > > eval( parse( text = paste("avg_",colname, " <- 0;", sep='') ) ) > > > Or you can do something like this: > > df[[ paste( "avg_", colname, sep = "" ) ]] <- 0 > Than

Re: [R] replacing default axis labels on a plot - SOLUTION

2009-05-15 Thread Graves, Gregory
The original problem posed was: On 14/05/2009 7:31 AM, Graves, Gregory wrote: > I have 3 columns: flow, month, and monthname, where month is 1-12, and > monthname is name of month. I can't get the plot to replace the 1-12 > with monthname using ticks.lab. What am I doing wrong? > > plot(flow

Re: [R] replace "%" with "\%"

2009-05-15 Thread Marc Schwartz
On May 15, 2009, at 9:46 AM, Liviu Andronic wrote: Dear all, I'm trying to gsub() "%" with "\%" with no obvious success. temp1 <- c("mean", "sd", "0%", "25%", "50%", "75%", "100%") temp1 [1] "mean" "sd" "0%" "25%" "50%" "75%" "100%" gsub("%", "\%", temp1, fixed=TRUE) [1] "mean

[R] analysis of circular data with mixed models???

2009-05-15 Thread Steven Van Wilgenburg
Hi. I am trying to model data on movements (direction) of birds and the response variables are compass directions (0 to 360). I have found two packages CircStats and Circular that can implement linear models for a circular response, which will do what I need for the data set I am currently wor

[R] replace "%" with "\%"

2009-05-15 Thread Liviu Andronic
Dear all, I'm trying to gsub() "%" with "\%" with no obvious success. > temp1 <- c("mean", "sd", "0%", "25%", "50%", "75%", "100%") > temp1 [1] "mean" "sd" "0%" "25%" "50%" "75%" "100%" > gsub("%", "\%", temp1, fixed=TRUE) [1] "mean" "sd" "0%" "25%" "50%" "75%" "100%" Warning m

Re: [R] Problem with viewports, print.trellis and more/newpage

2009-05-15 Thread Sebastien . Bihorel
Hi Deepayan, Thank you very much for the tip. After removing the 'more' argument and another couple of hours, I finally found something that works for my multi-page multi-graph plots. For documentation, the script is: library(lattice) library(grid) foo <- data.frame(x=1:10,y=1:10) # Defines so

Re: [R] Using sample to create Training and Test sets

2009-05-15 Thread Max Kuhn
>> Forgive the newbie question, I want to select random rows from my >> data.frame to create a test set (which I can do) but then I want to >> create a training set using whats left over. >> The caret package has a function, createDataPartition, that does the split taking into account the distribu

Re: [R] Additional points to scatter plot show up at wrong place

2009-05-15 Thread Stefan Grosse
On Fri, 15 May 2009 15:43:33 +0200 Peter Menzel wrote: PM> scatterplot(data[,2] ~ data[,1], PM> data=data,smooth=F,reg.line=F,xlim=c(0.5,1),ylim=c(0.5,1),ylab="ML",xlab="Freq",cex.lab=1.9,cex.axis=1.8) Side remark: you don't need do data[,2] if you have specified data=data as you did. So var1~v

Re: [R] Help with loops

2009-05-15 Thread David Freedman
I'm not quite sure what you want to do, but this might help: d=data.frame(replicate(40, rnorm(20))) d$sample=rep(c('a','b','c','d'),each=5) lib(doBy) summaryBy(.~sample,da=d) David Freedman Amit Patel-7 wrote: > > > Hi > I am trying to create a loop which averages replicates in my data. > The

Re: [R] warning message while installing a package

2009-05-15 Thread Marc Schwartz
On May 15, 2009, at 9:04 AM, Duncan Murdoch wrote: On 5/15/2009 11:04 AM, meenus...@gmail.com wrote: Dear all I was trying to install the package ISwR and got the following message. I was connected to the internet. Warning: unable to access index for repository http://cms.unipune.ernet.in/co

Re: [R] warning message while installing a package

2009-05-15 Thread Duncan Murdoch
On 5/15/2009 11:04 AM, meenus...@gmail.com wrote: Dear all I was trying to install the package ISwR and got the following message. I was connected to the internet. Warning: unable to access index for repository http://cms.unipune.ernet.in/computing/cran/bin/windows/contrib/2.8 That's a proble

[R] warning message while installing a package

2009-05-15 Thread meenusahi
Dear all I was trying to install the package ISwR and got the following message. I was connected to the internet. Warning: unable to access index for repository http://cms.unipune.ernet.in/computing/cran/bin/windows/contrib/2.8 Please help. regards M. __

[R] Additional points to scatter plot show up at wrong place

2009-05-15 Thread Peter Menzel
Hi everyone, I have a problem with adding points to scatter plots. The plot is drawn with the scatterplot() function from the car library: scatterplot(data[,2] ~ data[,1], data=data,smooth=F,reg.line=F,xlim=c(0.5,1),ylim=c(0.5,1),ylab="ML",xlab="Freq",cex.lab=1.9,cex.axis=1.8) after that, I draw

[R] Issue displaying legend for large data

2009-05-15 Thread anisha_sinnarkar
Hi, We are working on R project with the latest version 2.9.0. We are using matplot and barplot functions to draw different graphs. End user may generate graphs for large number of data. Also, each point to be plotted may have large name (around 170 characters). These names (Y axis points) need

Re: [R] displaying results

2009-05-15 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 5/15/2009 8:33 AM, deanj2k wrote: >> Hi everyone, can anyone tell me how i can change how i display >> mean(age), i >> want it to say The mean age of patients within the sample is mean(age) > > I think you want something like this: > > cat(sprintf("The mean age of patient

Re: [R] creating and then executing command strings

2009-05-15 Thread Romain Francois
Hi, You can either parse and eval the string you are making, as in: eval( parse( text = paste("avg_",colname, " <- 0;", sep='') ) ) Or you can do something like this: df[[ paste( "avg_", colname, sep = "" ) ]] <- 0 Romain Philipp Schmidt wrote: Hi: I very recently started experimenting wi

Re: [R] displaying results

2009-05-15 Thread Duncan Murdoch
On 5/15/2009 8:33 AM, deanj2k wrote: Hi everyone, can anyone tell me how i can change how i display mean(age), i want it to say The mean age of patients within the sample is mean(age) I think you want something like this: cat(sprintf("The mean age of patients within the sample is %.1f.\n", me

[R] creating and then executing command strings

2009-05-15 Thread Philipp Schmidt
Hi: I very recently started experimenting with R and am occasionally running into very basic problems that I can't seem to solve. If there is an R-newbies forum that is more appropriate for these kinds of questions, please direct me to it. I'd like to automatically add vectors to a dataframe. I a

Re: [R] can you tell what .Random.seed *was*?

2009-05-15 Thread Warren Young
Duncan Murdoch wrote: 1) can you tell me what my original set.seed() value was? (I wouldn't be able to figure it out, but maybe someone can) The only way I know is to test all 2^32 possible values of the seed. I think cryptographers would know faster ways. Well, I'm not a cryptographer, bu

Re: [R] help with as.numeric

2009-05-15 Thread Marc Schwartz
On May 15, 2009, at 6:57 AM, deanj2k wrote: hi everyone, wondering if you could help me with a novice problem. I have a data frame called subjects with a height and weight variable and want to calculate a bmi variable from the two. i have tried: attach(subjects) bmi <- (weight)/((height

[R] Fw: Help with loops(corrected question)

2009-05-15 Thread Amit Patel
--- On Fri, 15/5/09, Amit Patel wrote: > From: Amit Patel > Subject: Help with loops > To: r-help@r-project.org > Date: Friday, 15 May, 2009, 12:17 PM > Hi > I am trying to create a loop which averages replicates in > my data. > The original data has many rows. and consists of 40 column > zz[

Re: [R] need help

2009-05-15 Thread Jorge Ivan Velez
Dear H Z, Take a look at the examples in require(MASS) ?glm.nb This might be useful as well summary(glm.nb(yourvariable ~ 1, data = yourdata)) HTH, Jorge On Fri, May 15, 2009 at 7:26 AM, H Z wrote: > Dear all > please ,I need to write a function in R to estimate the parameters of > negativ

Re: [R] displaying results

2009-05-15 Thread Simon Pickett
Absolutely no idea what you mean, Try reconstructing your question in concise English with reproducible code. Simon. - Original Message - From: "deanj2k" To: Sent: Friday, May 15, 2009 1:33 PM Subject: [R] displaying results Hi everyone, can anyone tell me how i can change how

Re: [R] selecting points on 3D scatterplots

2009-05-15 Thread John Fox
Dear list members, I was out of town when this message arrived and so didn't respond at the time. I did respond to a private email from the poster. Yes, the scatter3d() function in the Rcmdr package can identify points in 3D scatterplots drawn with rgl via the identify3d() function in the same pa

Re: [R] Using sample to create Training and Test sets

2009-05-15 Thread Liaw, Andy
Here's one possibility: idx <- sample(nrow(acc)) training <- acc[idx[1:400], ] testset <- acc[-idx[1:400], ] Andy From: Chris Arthur > > Forgive the newbie question, I want to select random rows from my > data.frame to create a test set (which I can do) but then I want to > create a training

Re: [R] need help

2009-05-15 Thread Simon Pickett
Read about glm by typing ?glm There are tons of books and pdfs out there to show you the basics. http://cran.r-project.org/other-docs.html HTH, Si. - Original Message - From: "H Z" To: Sent: Friday, May 15, 2009 12:26 PM Subject: [R] need help Dear all please ,I need to write

Re: [R] displaying results

2009-05-15 Thread stephen sefick
Read the posting guide please. Self-contained, minimal, reproducible code. On Fri, May 15, 2009 at 8:33 AM, deanj2k wrote: > > Hi everyone, can anyone tell me how i can change how i display mean(age), i > want it to say The mean age of patients within the sample is mean(age) > -- > View this mes

Re: [R] How to do a pretty panel plot?

2009-05-15 Thread stephen sefick
M <- (structure(list(date = structure(c(13634, 13665, 13695, 13726, 13757, 13787, 13818, 13848, 13879, 13910, 13939, 13970, 14000, 14031, 14061, 14092, 14123, 14153, 14184, 14214, 14245, 14276, 14304, 14335), class = "Date"), cospi = c(1987.31, 2033.37, 2140.13, 2120.66, 2427.09, 2917.7, 2915.28, 3

Re: [R] Simulation

2009-05-15 Thread Ben Bolker
On Fri, 15 May 2009 19:17:37 +1000 Kon Knafelman wrote: KK> I hve the same problem as the initial one, except i need 1000 KK> samples of size 15, and my distribution is Exp(1). I've adjusted KK> some of the loop formulas for my n=15, but im unsure how to proceed KK> in the quickest way. KK> Ca

[R] displaying results

2009-05-15 Thread deanj2k
Hi everyone, can anyone tell me how i can change how i display mean(age), i want it to say The mean age of patients within the sample is mean(age) -- View this message in context: http://www.nabble.com/displaying-results-tp23558890p23558890.html Sent from the R help mailing list archive at Nabbl

Re: [R] help with as.numeric

2009-05-15 Thread Nutter, Benjamin
as.numeric() doesn't convert factors to the explicit value, nor should it. Under what you're expecting, ff you have a factor where the levels are "Female" and "Male", using as.numeric() wouldn't produce anything meaningful. However, as.numeric() does something much smarter. It converts "Female"

Re: [R] Using sample to create Training and Test sets

2009-05-15 Thread Frank E Harrell Jr
Note that the single split sample technique is not competitive with other approaches unless the sample size exceeds around 20,000. Frank Chris Arthur wrote: Forgive the newbie question, I want to select random rows from my data.frame to create a test set (which I can do) but then I want to c

Re: [R] transposing/rotating XY in a 3D array

2009-05-15 Thread andzsin
Dear Kushantha, Thank you very much. Very nice, indeed. Gabor __ R-help@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

Re: [R] fitdistr for t distribution

2009-05-15 Thread lagreene
Thanks Jorge, but I still don't understand where they come from. when I use: fitdistr(mydata, "t", df = 9) and get values for m and s, and the variance of my data should be the df/s? I jsut want to be able to confirm how m and s are calculated mydt <- function(x, m, s, df) dt((x-m)/s, df)/s f

[R] need help

2009-05-15 Thread H Z
Dear all please ,I need to write a function in R to estimate the parameters of negative binomial distribution and then calculate the loglikelihood amount for given data.Is there any one to help me. thank you very much for any help Best regards [[alternative HTML version deleted

[R] help with as.numeric

2009-05-15 Thread deanj2k
hi everyone, wondering if you could help me with a novice problem. I have a data frame called subjects with a height and weight variable and want to calculate a bmi variable from the two. i have tried: attach(subjects) bmi <- (weight)/((height/100)^2) but it comes up with the error: Warning me

[R] Help with loops

2009-05-15 Thread Amit Patel
Hi I am trying to create a loop which averages replicates in my data. The original data has many rows. and consists of 40 column zz[,2:41] plus row headings in zz[,1] I am trying to average each set of values (i.e. zz[1,2:3] averaged and placed in average_value[1,2] and so on. below is my script

Re: [R] Help with kalman-filterd betas using the dlm package

2009-05-15 Thread spencerg
1. Might you look again at section "2. Maximum likelihood estimation" of the "dlm" vignette? It describes how to estimate parameters. 2. Have you started with the code on those 2 pages, confirming that you can make that work and understand what it does? If yes, then try to

Re: [R] Problems intalling on Suse 10.3 x86_64 OS

2009-05-15 Thread Stefan Grosse
On Thu, 14 May 2009 12:32:18 -0700 (PDT) PDXRugger wrote: P> P> Alright, i am unsure of the posting rules for these types of P> questions but i will be as help ful as possible. My windows based P> system cant handle a model i am running so i am trying to install R Why? To many data? P> on our

Re: [R] Help with kalman-filterd betas using the dlm package

2009-05-15 Thread tom81
I have studied both the vinguette and other material I've been able to get my hands on and Im starting to get a better understanding. And I'm defenitly going to buy Petris, Petrone, and Campagnoli (2009) Dynamic Linear Models with R. But that's not publish yet so I 'm not getting much help there.

[R] Intel® Core™2 Quad Processors

2009-05-15 Thread whatn...@gmail.com
Introducing the Intel® Core™2 Quad processor for desktop PCs, designed to handle massive compute and visualization workloads enabled by powerful multi-core technology. Providing all the bandwidth you need for next-generation highly-threaded applications, the latest four-core Intel Core 2 Quad proce

[R] Using sample to create Training and Test sets

2009-05-15 Thread Chris Arthur
Forgive the newbie question, I want to select random rows from my data.frame to create a test set (which I can do) but then I want to create a training set using whats left over. Example code: acc <- read.table("accOUT.txt", header=T, sep = ",", row.names=1) #select 400 random rows in data trai

[R] Intel® Core™2 Quad Processors

2009-05-15 Thread whatn...@gmail.com
Introducing the Intel® Core™2 Quad processor for desktop PCs, designed to handle massive compute and visualization workloads enabled by powerful multi-core technology. Providing all the bandwidth you need for next-generation highly-threaded applications, the latest four-core Intel Core 2 Quad proce

  1   2   >