Re: [R] Interrupt R?

2010-07-11 Thread Prof Brian Ripley
On Sun, 11 Jul 2010, Spencer Graves wrote: Hi, Richard and Duncan: Thank you both very much. You provided different but workable solutions. 1. With Rgui 2.11.1 on Vista x64, the escape worked, but neither ctrl-c nor ctrl-C worked for me. Why did you expect them too? C

Re: [R] cbind in for loops

2010-07-11 Thread Joshua Wiley
Hi, Assuming that you have read the files into R, and that their names (in R) are held in some object (e.g., 'file2'), then this works do.call(what = cbind, args = mget(x = file2, envir = .GlobalEnv) Here is a reproducible example: x1 <- data.frame(x = 1:10) x2 <- data.frame(y = 1:10) file.name

Re: [R] boxplot on all the columns

2010-07-11 Thread Tal Galili
Actually, boxplot (bhtest1) Should do what you want... Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (Eng

Re: [R] Is there a "Mixed effect model" for regression/classification trees?

2010-07-11 Thread Tal Galili
Hello Achim, Thank you very much, this looks exactly like what I was looking for. (p.s: Their presentation here Is most helpful) Best, Tal Contact Details:--- C

Re: [R] problem with comparisons for vectors

2010-07-11 Thread Joshua Wiley
This is also mentioned in FAQ 7.31 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Also if you search the R-help archives for 'precision' you can find a lot of threads discussing the issue in further depth. On Sun, Jul 11, 2010 at 9:02 PM, Wu Gon

[R] boxplot on all the columns

2010-07-11 Thread jd6688
how to use boxplot on all the columns from he date frame instead of manually entering the columns like below bhtest1 <- read.table("bhtest1.txt", header=TRUE) boxplot (bhtest1[,2], bhtest1[,3], bhtest1[, 4], bhtest1[,5], bhtest1[,6], bhtest1[,7]) please help, Thanks, -- View this mes

Re: [R] make an model object (e.g. nlme) available in a user defined function (xyplot related)

2010-07-11 Thread Deepayan Sarkar
On Mon, Jul 12, 2010 at 2:51 AM, Jun Shen wrote: > Dear all, > > When I construct an nlme model object by calling nlme(...)->mod.nlme, > this object can be used in xyplot(). Something like > > xyplot(x,y,.. > .. > ind.predict<-predict(mod.nlme) > .. > ) is working fine in console envir

[R] cbind in for loops

2010-07-11 Thread jd6688
I have 30 files in the current directories, i would like to perform the cbind(fil1,file2,file3,file4file30) how could i do this in a for loop: such as: file2 <- list.files(pattern=".out3$") for (j in file2) { cbind(j)...how to implement cbind here } Thanks.

[R] long to wide on larger data set

2010-07-11 Thread Juliet Hannah
I have a data set that has 4 columns and 53860858 rows. I was able to read this into R with: cc <- rep("character",4) myData <- read.table("myData.csv",header=FALSE,skip=1,colClasses=cc,nrow=53860858,sep=",") I need to reshape this data from long to wide. On a small data set the following lines

Re: [R] RSQLite install R x86_64 fail

2010-07-11 Thread Seth Falcon
On Sun, Jul 11, 2010 at 4:25 PM, David Ruau wrote: > Hi Seth, > > Thanks for the answer. > I have install R using macport (since many years now). It compile R from > source using gcc 4.4 by default. But I don't think this is the problem > because I manage to install many other package that do no

[R] Marking the tail of a distribution (was (no subject))

2010-07-11 Thread Bill.Venables
Here is a way: ### x <- sort(c(seq(-4, 4, length=100), 1.96)) hx <- dnorm(x) par(pty="s") plot(x, hx, type="l", xlab="z value", ylab="Density", main="density of N(0,1)") abline(v=1.96, col="red") abline(h = 0) top <- x >= 1.96 tail <- rbind(cbind(x[top], hx[top]), c(4, 0), c(1.96, 0)) polygon(t

Re: [R] problem with comparisons for vectors

2010-07-11 Thread Wu Gong
I don't know the real reason, but help("==") gives some clues. For numerical and complex values, remember == and != do not allow for the finite representation of fractions, nor for rounding error. Using all.equal with identical is almost always preferable. See the examples. x1 <- 0.5 - 0.3 x2

Re: [R] (no subject)

2010-07-11 Thread RICHARD M. HEIBERGER
You need three more lines of code abline(h=0) xx <- seq(1.96, 4, length=25) polygon(x=c(xx[1],xx,xx[25]), y=c(0,dnorm(xx),0), col='red') Please see the normal.and.t.dist function in the HH package for more detailed control of the graph. ## install.packages("HH") ## if you don't have it yet

Re: [R] (no subject)

2010-07-11 Thread Charles C. Berry
On Sun, 11 Jul 2010, li li wrote: Hi all, I want to add the red color under the standard normal curve to the right of 1.96. Can anyone give me a hand? Please see the code below. Thank you. x <- seq(-4, 4, length=100) hx <- dnorm(x) par(pty="s") plot(x, hx, type="l", xlab="z value", ylab="

Re: [R] The formula interface of SVM

2010-07-11 Thread Steve Lianoglou
Hi, On Sun, Jul 11, 2010 at 7:11 PM, Amy Hessen wrote: > > Hi > Could you please explain the line that I got from the documentation of R? > does it mean that there is a difference between using  and not using the > formula interface with SVM ?: > If the predictor variables include factors, the

[R] (no subject)

2010-07-11 Thread li li
Hi all, I want to add the red color under the standard normal curve to the right of 1.96. Can anyone give me a hand? Please see the code below. Thank you. x <- seq(-4, 4, length=100) hx <- dnorm(x) par(pty="s") plot(x, hx, type="l", xlab="z value", ylab="Density", main="density of N(0,1)"

[R] The formula interface of SVM

2010-07-11 Thread Amy Hessen
Hi Could you please explain the line that I got from the documentation of R? does it mean that there is a difference between using and not using the formula interface with SVM ?: If the predictor variables include factors, the formula interface must be used to get a correct model matrix.

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-11 Thread Ravi Varadhan
I guess it is ok, but then a warning should be added, when describing the `abs.tol' parameter in the help file to state that changing it may result in premature stopping when f(x*) = 0. Regards, Ravi. Ravi Varadhan, Ph.D. A

Re: [R] RSQLite install R x86_64 fail

2010-07-11 Thread David Ruau
Hi Seth, Thanks for the answer. I have install R using macport (since many years now). It compile R from source using gcc 4.4 by default. But I don't think this is the problem because I manage to install many other package that do not need RSQLite. The configure options for the macport port are

Re: [R] Compress string memCompress/Decompress

2010-07-11 Thread Seth Falcon
On Sun, Jul 11, 2010 at 11:31 AM, Matt Shotwell wrote: > On Fri, 2010-07-09 at 20:02 -0400, Erik Wright wrote: >> Hi Matt, >> >> This works great, thanks! >> >> At first I got an error message saying BLOB is not implemented in RSQLite.   >> When I updated to the latest version it worked. > > SQLit

Re: [R] RSQLite install R x86_64 fail

2010-07-11 Thread Seth Falcon
Hi David, On Sun, Jul 11, 2010 at 12:27 PM, David Ruau wrote: > On a fresh install of R on mac os x 10.6.4 (snow leopard) RSQLite > did not install while running biocLite() How did you install R? > $ R > biocLite("RSQLite") > Using R version 2.11.1, biocinstall version 2.6.7. > Installing Bioc

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-11 Thread Duncan Murdoch
On 11/07/2010 10:22 AM, Ravi Varadhan wrote: Hi, I am ok with setting abs.tol=0. Here is an nlminb.patch that has this. There is just one line of code that has been added: control$abs.tol <- 0 I have commented where this change happens. I am sorry if I was not being clear. I just wante

Re: [R] Is there a "Mixed effect model" for regression/classification trees?

2010-07-11 Thread Achim Zeileis
On Sun, 11 Jul 2010, Tal Galili wrote: Hello all, This is more a statistical question then an R question, but I am sure it will have an R interpretation to it. If I wish to predict an outcome based on some potential features, I could (in some cases) use either regression or regression-tree. Ho

[R] make an model object (e.g. nlme) available in a user defined function (xyplot related)

2010-07-11 Thread Jun Shen
Dear all, When I construct an nlme model object by calling nlme(...)->mod.nlme, this object can be used in xyplot(). Something like xyplot(x,y,.. .. ind.predict<-predict(mod.nlme) .. ) is working fine in console environment. But the same structure is not working in a user defined fun

[R] Is there a "Mixed effect model" for regression/classification trees?

2010-07-11 Thread Tal Galili
Hello all, This is more a statistical question then an R question, but I am sure it will have an R interpretation to it. If I wish to predict an outcome based on some potential features, I could (in some cases) use either regression or regression-tree. However, if my observations are divided to g

Re: [R] Interrupt R?

2010-07-11 Thread Spencer Graves
Hi, Richard and Duncan: Thank you both very much. You provided different but workable solutions. 1. With Rgui 2.11.1 on Vista x64, the escape worked, but neither ctrl-c nor ctrl-C worked for me. 2. The TCLTK version works but seems to require either more

Re: [R] data export HELP!

2010-07-11 Thread jim holtman
Not necessarily the best way if your dataframe will get large, but it should work: parameters <- NULL # where you will collect the result for(j in 1:dim(r)[2]){ indiv=r[,j][which(r[,j]>-1)] #removes -1 growth data age.1=age[1:length(indiv)] length.ind=data.frame(age.1,indiv,

Re: [R] eval and assign in loop problem

2010-07-11 Thread Patrick Connolly
On Fri, 09-Jul-2010 at 08:25AM -0700, S.Nicholas wrote: |> deaR useRs, |> |> I am trying to assign different values to different objects in a for loop. |> The following is a toy example of the part that has been giving me a hard |> time. |> |> The first "for loop" generates four objects, b0, b1,

[R] data export HELP!

2010-07-11 Thread adriana1986
Hello! So, this is going to seem like a very simple question - I am quite new to R and am having some trouble figuring out little nuances: I am running a loop that goes through my data and performs a nls parameter estimation on each data set. At the end of the loop, I would like to collect the p

[R] RSQLite install R x86_64 fail

2010-07-11 Thread David Ruau
Hi, On a fresh install of R on mac os x 10.6.4 (snow leopard) RSQLite did not install while running biocLite() $ R R version 2.11.1 (2010-05-31) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 [...] Loading required package: utils BioC_mirror = http://www.biocond

Re: [R] Interrupt R?

2010-07-11 Thread Duncan Murdoch
On 11/07/2010 2:29 PM, Spencer Graves wrote: How can one interrupt the following gracefully: while(TRUE){ Sys.sleep(1) } In R2.11.1 under Emacs+ESS, some sequence of ctrl-g, ctrl-c eventually worked for me. Under Rgui 2.11.1, the only way I've found was to kill R.

Re: [R] Interrupt R?

2010-07-11 Thread RICHARD M. HEIBERGER
Use the timer in tcl. See this email from Phillipe Grosjean with details. https://stat.ethz.ch/pipermail/r-help/2009-July/203151.html Rich [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] Fast string comparison

2010-07-11 Thread Sharpie
Ralf B wrote: > > What is the fastest way to compare two strings in R? > > Ralf > Which way is not fast enough? In other words, are you asking this question because profiling showed one of R's string comparison operations is causing a massive bottleneck in your code? If so, which one and how

Re: [R] F# vs. R

2010-07-11 Thread Sharpie
Sergey Goriatchev wrote: > > Hello, Marc > > No, I do not want to validate Cox PH. :-) > I do use R daily, though right now I do not use the statistical part that > much. > > I just generally wonder if any R-user tried F# and his/her opinions. > > Regards, > Sergey > In my work as a program

Re: [R] Compress string memCompress/Decompress

2010-07-11 Thread Matt Shotwell
On Fri, 2010-07-09 at 20:02 -0400, Erik Wright wrote: > Hi Matt, > > This works great, thanks! > > At first I got an error message saying BLOB is not implemented in RSQLite. > When I updated to the latest version it worked. SQLite began to support BLOBs from version 3.0. > > Is there any rea

[R] Interrupt R?

2010-07-11 Thread Spencer Graves
How can one interrupt the following gracefully: while(TRUE){ Sys.sleep(1) } In R2.11.1 under Emacs+ESS, some sequence of ctrl-g, ctrl-c eventually worked for me. Under Rgui 2.11.1, the only way I've found was to kill R. Suggestions on something more graceful?

Re: [R] Durban Watson statistics

2010-07-11 Thread Achim Zeileis
On Sun, 11 Jul 2010, Leigh E. Lommen wrote: I would like to do the Durban-Watson test on a time series of log returns. 2 questions: 1) If I am just trying to find out if there is serial correlation, what do I do for the residuals? there is no model, so do I just use the log retu

Re: [R] Inserting an image into a PDF file

2010-07-11 Thread Marc Schwartz
On Jul 11, 2010, at 10:51 AM, David Winsemius wrote: > > On Jul 11, 2010, at 11:06 AM, Dennis Fisher wrote: > >> Colleagues, >> >> I am creating a PDF document from R using pdf(), the document contains text >> / images created with R. I also have an image in either PDF / TIFF / JPEG >> forma

Re: [R] F# vs. R

2010-07-11 Thread Steven Lembark
On Wed, 07 Jul 2010 14:34:05 -0300 Bernardo Rangel Tura wrote: > F# is public, but is not open source. > > F# run in windows but run in AIX, linux, MAC, UNIX etc? > > Compiled code should run faster than R, but is precise? > > Compiled code should run faster than R, but is reliable? > > Comp

Re: [R] Inserting an image into a PDF file

2010-07-11 Thread David Winsemius
On Jul 11, 2010, at 11:06 AM, Dennis Fisher wrote: Colleagues, I am creating a PDF document from R using pdf(), the document contains text / images created with R. I also have an image in either PDF / TIFF / JPEG format (in this case, a scanned image saved as a file). I would like to

[R] Durban Watson statistics

2010-07-11 Thread Leigh E. Lommen
I would like to do the Durban-Watson test on a time series of log returns. 2 questions: 1) If I am just trying to find out if there is serial correlation, what do I do for the residuals? there is no model, so do I just use the log returns (time series) itself? 2) what is the code in R t

[R] Inserting an image into a PDF file

2010-07-11 Thread Dennis Fisher
Colleagues, I am creating a PDF document from R using pdf(), the document contains text / images created with R. I also have an image in either PDF / TIFF / JPEG format (in this case, a scanned image saved as a file). I would like to insert the image into the PDF file. Any ideas on how to

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-11 Thread Ravi Varadhan
Hi, I am ok with setting abs.tol=0. Here is an nlminb.patch that has this. There is just one line of code that has been added: control$abs.tol <- 0 I have commented where this change happens. I am sorry if I was not being clear. I just wanted to have the authors to also have a look at t

Re: [R] a very particular plot

2010-07-11 Thread Hadley Wickham
Hi Ian, Have a look at the examples in http://had.co.nz/ggplot2/geom_tile.html for some ideas on how to do this with ggplot2. Hadley On Sat, Jul 10, 2010 at 8:10 PM, Ian Bentley wrote: > Hi all, > > Thanks for the really great help I've received on this board in the past. > > I have a very part

Re: [R] Fast string comparison

2010-07-11 Thread Hadley Wickham
== ? Hadley On Sun, Jul 11, 2010 at 2:08 PM, Ralf B wrote: > What is the fastest way to compare two strings in R? > > Ralf > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http

[R] Fast string comparison

2010-07-11 Thread Ralf B
What is the fastest way to compare two strings in R? Ralf __ 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, self

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version, 2.11.1)

2010-07-11 Thread Duncan Murdoch
On 10/07/2010 9:48 AM, Prof. John C Nash wrote: I won't add to the quite long discussion about the vagaries of nlminb, but will note that over a long period of software work in this optimization area I've found a number of programs and packages that do strange things when the objective is a func

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-11 Thread Duncan Murdoch
On 11/07/2010 5:00 AM, Matthew Killeya wrote: Thanks. Seems to me the easiest sensible fix might be to change the default abs.tol=0 in R and add a warning in the help files? That was exactly my suggestion in the message to which Ravi was replying, but he apparently has doubts. Duncan Murd

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-11 Thread Matthew Killeya
Thanks. Seems to me the easiest sensible fix might be to change the default abs.tol=0 in R and add a warning in the help files? Matt On 11 July 2010 01:41, Duncan Murdoch wrote: > On 10/07/2010 7:32 PM, Ravi Varadhan wrote: > >> Hi, >> >> The best solution would be to identify where the problem

Re: [R] getting data from table command

2010-07-11 Thread nn roh
Thanks very much :). On Sat, Jul 10, 2010 at 10:02 PM, jim holtman wrote: > Is this what you want: > > > x <- c(1,2,2,2,3,3,3,4,4,5) > > z <- table(x) > > z > x > 1 2 3 4 5 > 1 3 3 2 1 > > as.integer(rep(names(z), z)) > [1] 1 2 2 2 3 3 3 4 4 5 > > > > > On Sat, Jul 10, 2010 at 10:55 AM, nn roh

Re: [R] Using Ubuntu as a Server

2010-07-11 Thread Tobias Verbeke
Hi Leandro, On 07/10/2010 08:46 PM, Leandro Marino wrote: I want to know how can I configure R in a Ubuntu to be a server. I am planning to use R in a Windows machine with Tinn-R, but I want R running at an Ubuntu Lucid machine. How can i do this? One possibility is to use Eclipse/StatET on

Re: [R] simple apply syntax

2010-07-11 Thread Prof Brian Ripley
On Sun, 11 Jul 2010, Robin Jeffries wrote: I know this is a simple question, but I have yet to master the apply statements. Any help would be appreciated. You don't want to use apply() here: rbinom is vectorized. However, you cannot use mat$x on a matrix, and the cbind() gave you a matrix an

Re: [R] simple apply syntax

2010-07-11 Thread Joshua Wiley
Hello Robin, I cannot quite figure out what your final goal is (it's late and I'm low on caffeine so if I missed the obvious, bear with me). I think you may mean the rbinom() function rather than the binomial() function (see ?rbinom and ?binomial, respectively). At any rate, this should get you

[R] simple apply syntax

2010-07-11 Thread Robin Jeffries
I know this is a simple question, but I have yet to master the apply statements. Any help would be appreciated. I have a column of probabilities and sample sizes, I would like to create a column of binomial random variables using those corresponding probabilities. Eg. mat = as.matrix(cbi