Re: [R] bar chart with means - using ggplot

2009-09-12 Thread Dianne Cook
I would recommend not representing means by bars at all. Bars are for counts, stacking from zero. Means are point estimates. ggplot has a lot of routines for displaying means with errors bars: geom_linerange, geom_pointrange. To hone your ggplot skills I recommend looking into these geoms.

[R] mclustBIC version 3.3.1

2009-09-12 Thread madmax1425
Hi there, I started getting a new error with the latest mclust package version 3.3.1. My only solution was to install the older package 3.2.1 or even 3.1-10. , (i think older ones will still work since i ve been using it for a while) the sentence giving trouble is: BIC -

Re: [R] State Space models in R

2009-09-12 Thread Stephan Kolassa
Hi, Rob Hyndman's forecast package does exponential smoothing forecasting based on state space models (and lots of other stuff, ARIMA et al.). It's not exactly the companion package to his book, but it comes close. The book's (Forecasting with Exponential Smoothing - The State Space

Re: [R] Completion for proto objects

2009-09-12 Thread Vitalie S.
On Fri, 11 Sep 2009 18:56:36 +0200, Gabor Grothendieck ggrothendi...@gmail.com wrote: in the devel version. If that does not help let me know offline and I will try to help you. Thanks Gabor, I solved the problem. Here is the code in case somebody else wants to have full completions for

[R] How to visualize paired t-test results?

2009-09-12 Thread johannes rara
I would like to know if you have any suggestions how to visualize the results from a paired t-test (see the example data below). I tried to produce plots that show the mean and CI's from the original data and the estimate of the difference between means and the confidence intervals (see below)

[R] could not find function Varcov after upgrade of R?

2009-09-12 Thread zhu yao
After upgrading R to 2.9.2, I can't use the anova() fuction. It says could not find function Varcov . What's wrong with my computer? Help needed, thanks! Yao Zhu Department of Urology Fudan University Shanghai Cancer Center No. 270 Dongan Road, Shanghai, China [[alternative HTML version

[R] consistent results with heatmap.2

2009-09-12 Thread mkcheste
Hi, I am trying to create a heatmap with some specific requirements. Specifically, I need to be able to center the color-scale around 0, and I need to truncate the data so that a few extreme values do not cause the rest of the heatmap to appear black (on a red/green scale). After reading

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread zhu yao
I uses the Design library. take this example: library(Design) n - 1000 set.seed(731) age - 50 + 12*rnorm(n) label(age) - Age sex - factor(sample(c('Male','Female'), n, rep=TRUE, prob=c(.6, .4))) cens - 15*runif(n) h - .02*exp(.04*(age-50)+.8*(sex=='Female')) dt - -log(runif(n))/h

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread David Winsemius
On Sep 12, 2009, at 5:24 AM, zhu yao wrote: After upgrading R to 2.9.2, I can't use the anova() fuction. It says could not find function Varcov . What's wrong with my computer? Help needed, thanks! You have not given us very much information but from the naming conventions I would guess

[R] Save data in txt

2009-09-12 Thread Lucas Sevilla García
Hi everyone I have a little problem with R. I built a lineal regression equation using stepAIC function in both directions. Once I get this formula (lineal regression), I would like to save in a txt file data refered to p-value, r-squared, coefficients,...from the choosen model previously

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread David Freedman
I've had the same problem with predict.Design, and have sent an email to the maintainer of the Design package at Vanderbilt University. I wasn't even able to run the examples given on the help page of predict.Design - I received the same error about Varcov that you did. I *think* it's a

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread Carlos Alzola
Did you type library(Hmisc,T) before loading Design? Carlos -- From: David Freedman 3.14da...@gmail.com Sent: Saturday, September 12, 2009 8:26 AM To: r-help@r-project.org Subject: Re: [R] could not find function Varcov after upgrade of R? I've

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread David Winsemius
I am unable to reproduce that problem, either. Have both of you updated both the Design and Hmisc packages? Varcov is in Hmisc. -- David Winsemius On Sep 12, 2009, at 8:26 AM, David Freedman wrote: I've had the same problem with predict.Design, and have sent an email to the maintainer of

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread Frank E Harrell Jr
I apologize for this change in the Hmisc package which breaks the current version of Design in CRAN. Design should be updated by early next week. In the meantime there are two solutions: 1. Install the rms package which is a replacement for Design with better graphics, and note the few

Re: [R] Save data in txt

2009-09-12 Thread David Winsemius
On Sep 12, 2009, at 7:56 AM, Lucas Sevilla García wrote: Hi everyone I have a little problem with R. I built a lineal regression equation using stepAIC function in both directions. Once I get this formula (lineal regression), I would like to save in a txt file data refered to p-value,

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread Mark Difford
Hi Zhu, could not find function Varcov after upgrade of R? Frank Harrell (author of Design) has noted in another thread that Hmisc has changed... The problem is that functions like anova.Design call a function in the _old_ Hmisc package called Varcov.default. In the new version of Hmisc this

Re: [R] Working with large matrix

2009-09-12 Thread Douglas Bates
On Fri, Sep 11, 2009 at 12:15 PM, A Ezhil ezhi...@yahoo.com wrote: Dear All, I have large matrix (46000 x 11250). I would like to do the linear regression for each row. I wrote a simple function that has lm() and used apply(mat,1,func). The issue is that it takes ages to load the file and

Re: [R] SPSS Statistics-R Integration Plug-In

2009-09-12 Thread Muenchen, Robert A (Bob)
Hi Michael, I've used the R plug-in and really like it. You can read my instructions on how to install and use it by going to Amazon.com, searching for the book, R for SAS and SPSS Users and then search inside the book for the section, Running R from SPSS. I've only got about 3 pages on it (28

Re: [R] Working with large matrix

2009-09-12 Thread Jonathan Baron
Another possible interpretation is that each row contains several vectors, possibly laid end to end. For example, if the row J were length 30 (which it isn't), the first 10 might be Y, the next 10 X1, and the next N2. The function might be lm(J[1:10] ~ J[11:20] + J[21:30]). If this is what is

Re: [R] mclustBIC version 3.3.1

2009-09-12 Thread Uwe Ligges
madmax1425 wrote: Hi there, I started getting a new error with the latest mclust package version 3.3.1. My only solution was to install the older package 3.2.1 or even 3.1-10. , (i think older ones will still work since i ve been using it for a while) the sentence giving trouble is: BIC

[R] how to find maximum for multivariable data

2009-09-12 Thread caroline choong
Dear all, I have a data set as follows: ID cycle.number cycle.result 1 2525 1 38 2 2525 2 38 3 2525 3 25 4 2525 4

Re: [R] ggplot2::qplot() -- arbitary transformations of coordinate system?

2009-09-12 Thread hadley wickham
Is there a place to find a list of the legal values for the coord_trans parameters. I spent a bunch of time searching the ggplot2 docs and r-help for same without success. I also made an attempt at looking at the code in R which also failed. In the book, or with apropos(^Trans, ignore = F)

Re: [R] how to find maximum for multivariable data

2009-09-12 Thread Henrique Dallazuanna
Try this: If cycle.number is ordered: do.call(rbind, lapply(split(x, x$ID), tail, 1)) On Sat, Sep 12, 2009 at 12:36 PM, caroline choong carolinevcho...@gmail.com wrote: Dear all, I have a data set as follows: ID cycle.number cycle.result 1 2525

Re: [R] how to find maximum for multivariable data

2009-09-12 Thread David Winsemius
On Sep 12, 2009, at 11:36 AM, caroline choong wrote: Dear all, I have a data set as follows: ID cycle.number cycle.result 1 2525 1 38 2 2525 2 38 3 2525 3

[R] [R-pkgs] New package sos for searching help pages of contributed packages

2009-09-12 Thread spencerg
Searching help pages of contributed packages just got easier with the release of the new sos package. This is a replacement for and substantial enhancement of the existing RSiteSearch package. To learn more about it, try vignette(sos). We hope you find this as useful as we

[R] Survreg function + deviation

2009-09-12 Thread Felipe
I am trying to estimate by MLE weibull coefficients and deviation. But how can i estimate deviation? I tried to find at the list and at the internet this but couldn't make it. Anyone could help me on this? Thanks. [[alternative HTML version deleted]]

[R] median() function on zoo objects

2009-09-12 Thread Marc Chiarini
Hello R-help community: I have what I think is a simple question that I hope someone can answer. When using the median() function on any zoo object (in particular, mine is an irregular time series), I get the following error, which is thrown from .gt(): Error in if (xi == xj) 0L else if

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread David Freedman
Thanks for the reminder - actually I think I've become sloppy about the 'T' (and the order of loading the Hmisc and Design packages), but that doesn't seem to be the problem. Also, all of my packages have been updated david Carlos Alzola wrote: Did you type library(Hmisc,T) before loading

Re: [R] how to determine if a variable is already set?

2009-09-12 Thread carol white
Thanks for your replies. I use the following script: if(!exists(i)) stop (set the variable i, call. = FALSE) but before the stop expression, Error gets displayed: Error: set the variable i Is there another function that stops the execution, prints an expression without printing Error or any

Re: [R] median() function on zoo objects

2009-09-12 Thread Gabor Grothendieck
Can you provide a reproducible example. See last line to every message on r-help. When I try it it works: median(zoo(1:3)) 2 2 On Sat, Sep 12, 2009 at 1:14 PM, Marc Chiarini marc.chiar...@tufts.edu wrote: Hello R-help community: I have what I think is a simple question that I hope someone

[R] Triangular distribution for kernel regression

2009-09-12 Thread Bryan
Hello, I am trying to get fitted/estimated values using kernel regression and a triangular kernel. I have found packages that easily fit values from a kernel regression (e.g. ksmooth) but do not have a triangular distribution option, and density estimators that have triangular distribution

Re: [R] Triangular distribution for kernel regression

2009-09-12 Thread Gabor Grothendieck
Try: RSiteSearch(kernel triangular) On Sat, Sep 12, 2009 at 1:51 PM, Bryan thespamho...@gmail.com wrote: Hello, I am trying to get fitted/estimated values using kernel regression and a triangular kernel.  I have found packages that easily fit values from a kernel regression (e.g. ksmooth)

[R] stack overflow when loading workspace

2009-09-12 Thread sebed1110-divers
Dear all, I can't load my workspace of 25Mo on R version 2.9.2, because of a stack overflow. But I saved it normally (save.image()), and I didn't get any notification... Does anyone know what that can be due to? Is there any limitation of number of objects (+/-63000)? Thanks Edwige Polus.

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread Uwe Ligges
David Freedman wrote: Thanks for the reminder - actually I think I've become sloppy about the 'T' (and the order of loading the Hmisc and Design packages), but that doesn't seem to be the problem. Also, all of my packages have been updated Note that Frank Harrell already answered that

Re: [R] stack overflow when loading workspace

2009-09-12 Thread Uwe Ligges
sebed1110-div...@yahoo.fr wrote: Dear all, I can't load my workspace of 25Mo on R version 2.9.2, because of a stack overflow. But I saved it normally (save.image()), and I didn't get any notification... Does anyone know what that can be due to? Is there any limitation of number of objects

Re: [R] median() function on zoo objects

2009-09-12 Thread Marc Chiarini
My apologies. I don't know how it happened, but somehow the library must have been corrupted. I re-installed the zoo package, and all was well again. Thanks! Regards, Marc Gabor Grothendieck wrote: Can you provide a reproducible example. See last line to every message on r-help. When I

[R] ggplot2: deterministic position_jitter geom_line with position_jitter

2009-09-12 Thread Stephan Kolassa
Dear guRus, I am starting to work with the ggplot2 package and have two very dumb questions: 1) deterministic position_jitter - the jittering is stochastic; is there any way to get a deterministic jittering? For instance: example.data -

Re: [R] ggplot2: deterministic position_jitter geom_line with position_jitter

2009-09-12 Thread hadley wickham
On Sat, Sep 12, 2009 at 1:34 PM, Stephan Kolassa stephan.kola...@gmx.de wrote: Dear guRus, I am starting to work with the ggplot2 package and have two very dumb questions: 1) deterministic position_jitter - the jittering is stochastic; is there any way to get a deterministic jittering? For

Re: [R] How to visualize paired t-test results?

2009-09-12 Thread Tal Galili
Hello johannes, You're example looks nice and I am hoping to see more ideas from other members. Just one tiny idea: In - stripchart Also use ylim to include the ZERO line (and then actually add the line) like this: plot.ylim - c(min(d, 0), max(d, 0)) abline(h = 0, lty = 2, col = blue, lwd =2)

Re: [R] Triangular distribution for kernel regression

2009-09-12 Thread Bryan
Gabor, Thanks for your quick reply (on a weekend even!) I've looked through the results of the search you recommended, and several related searches, and don't see anything exceptionally helpful. Kernel regression is a relatively new analysis for me; I apologize for needing a little more

Re: [R] R on Multi Core

2009-09-12 Thread Tal Galili
Also have a look at the foreach package: http://finzi.psych.upenn.edu/R/library/foreach/html/foreach-package.html On Fri, Sep 11, 2009 at 11:05 PM, Noah Silverman n...@smartmediacorp.comwrote: Hi, Our discussions about 64 bit R has led me to another thought. I have a nice dual core

Re: [R] Triangular distribution for kernel regression

2009-09-12 Thread Gabor Grothendieck
What about kknn -- that was listed as having the triangular distribution? On Sat, Sep 12, 2009 at 3:42 PM, Bryan thespamho...@gmail.com wrote: Gabor, Thanks for your quick reply (on a weekend even!)  I've looked through the results of the search you recommended, and several related searches,

[R] medcouple-based outlier detection in R

2009-09-12 Thread Manuj Sharma
I need to detect outliers in a large data set which is highly right-skewed. I plan to use medcouple-based outlier detection. Is there any support for medcouple-based outlier detection in R? Are there any other routines in R to perform outlier detection in highly right-skewed data? Manuj Sharma

Re: [R] medcouple-based outlier detection in R

2009-09-12 Thread David Winsemius
On Sep 12, 2009, at 3:54 PM, Manuj Sharma wrote: I need to detect outliers in a large data set which is highly right- skewed. I plan to use medcouple-based outlier detection. Is there any support for medcouple-based outlier detection in R? library(sos) # a package that links to Baron's

Re: [R] Triangular distribution for kernel regression

2009-09-12 Thread Mark Difford
Hi Brian, I am trying to get fitted/estimated values using kernel regression and a triangular kernel. Look at Loader's locfit package. You are likely to be pleasantly surprised. Regards, Mark. Bryan-65 wrote: Hello, I am trying to get fitted/estimated values using kernel regression

[R] Re : stack overflow when loading workspace

2009-09-12 Thread sebed1110-divers
Hi, the error message is Error: protect(): protection stack overflow Edwige. Dear all, I can't load my workspace of 25Mo on R version 2.9.2, because of But I saved it normally (save.image()), and I didn't get any notification... Does anyone know what

[R] Best Subset Selection - Leaps Package

2009-09-12 Thread Lars Bishop
Dear Experts, I'm a new R user and I'll appreciate your help regarding the following. I'm trying to generate an exhaustive search of all candidate models in a simple linear regression and select the one with the lowest CV-error (or alternatively the lowest Error on a Test set -- if I have lots of

Re: [R] Triangular distribution for kernel regression

2009-09-12 Thread Bryan
I originally looked over kknn because I need to be able to specify a bandwidth parameter. I am trying to replicate some previous non-R work in R, so I can't stray to far from the procedure used there. In reading the paper referenced in the docs, I see that kknn can reduce to the Nadaraya–Watson

Re: [R] Triangular distribution for kernel regression

2009-09-12 Thread Gabor Grothendieck
You can specify the number of nearest neighbors. On Sat, Sep 12, 2009 at 5:16 PM, Bryan thespamho...@gmail.com wrote: I originally looked over kknn because I need to be able to specify a bandwidth parameter.  I am trying to replicate some previous non-R work in R, so I can't stray to far from

Re: [R] Re : stack overflow when loading workspace

2009-09-12 Thread Duncan Murdoch
On 12/09/2009 5:04 PM, sebed1110-div...@yahoo.fr wrote: Hi, the error message is Error: protect(): protection stack overflow 63000 objects is far more than most people would use, so you may have hit an internal limit. The protection stack is used internally by R to temporarily mark objects

[R] (no subject)

2009-09-12 Thread KABELI MEFANE
Dear All   I hope you can help me with this small problem. I want to draw a normal distribution line to this data: p-rnorm(100, mean=5, sd=3000) hist(p)   Kabeli [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] how to determine if a variable is already set?

2009-09-12 Thread Don MacQueen
Do watch out, however, for *where* i exits. That is, if you type search() you will see a list of environments in which i might be found. You're probably assuming that i, if exists(i) is true, is in .GlobalEnv, but it might be in one of the other environments, in which case exists('i') will be

Re: [R] Normal distribution

2009-09-12 Thread KABELI MEFANE
 Dear All   let me go one step further by asking you if you could help me show that the distribution of this data in normal.  have a little idea (by trial and error) but i seem to not fully understand how its done.   H-rnorm(100, mean=5, sd=3000) par(las=1) hist(H, breaks=seq(4, 6,

Re: [R] (no subject)

2009-09-12 Thread David Freedman
A better subject for your question might have been helpful. There are many options for hist and truehist in the MASS package, but this might help: x=rnorm(100, mean=5, sd=3000) hist(x, prob=T) x2=density(x) lines(x2$x,x2$y) KABELI MEFANE wrote: Dear All   I hope you can help me with

Re: [R] (no subject)

2009-09-12 Thread KABELI MEFANE
Thank you Sir   I have been trying to come up with the code for 6 hours thats why i ended up forgetting the title.   Kabeli --- On Sat, 12/9/09, David Freedman 3.14da...@gmail.com wrote: From: David Freedman 3.14da...@gmail.com Subject: Re: [R] (no subject) To: r-help@r-project.org Date:

Re: [R] Normal distribution

2009-09-12 Thread jim holtman
Why don't you just do this: H-rnorm(100, mean=5, sd=3000) par(las=1) hist(H, breaks=seq(4, 6, 1000), freq=F) f- function(x) exp(-(x-5000)^2/1800)/sqrt(1800*pi) x- seq(4, 6, 100) lines(x, dnorm(x, 5, 3000)) On Sat, Sep 12, 2009 at 5:47 PM, KABELI

Re: [R] Normal distribution

2009-09-12 Thread KABELI MEFANE
Thank You   It really works fine and i do understand it. Now i can sleep, its 0200 hours here. Why don't you just do this: H-rnorm(100, mean=5, sd=3000) par(las=1) hist(H, breaks=seq(4, 6, 1000), freq=F) f- function(x) exp(-(x-5000)^2/1800)/sqrt(1800*pi) x- seq(4,

[R] the integer of a given location

2009-09-12 Thread darkhorn
I have a huge number such as 78923698701 z-78923698701 I want to find the integer of a given location, for example here, what is the 2nd number? 8. Thanks in advance! -- View this message in context: http://www.nabble.com/the-integer-of-a-given-location-tp25418729p25418729.html Sent from the R

Re: [R] the integer of a given location

2009-09-12 Thread jim holtman
Is this what you want: z-78923698701 substring(as.character(z), 2, 2) [1] 8 On Sat, Sep 12, 2009 at 6:16 PM, darkhorn darkh...@gmail.com wrote: I have a huge number such as 78923698701 z-78923698701 I want to find the integer of a given location, for example here, what is the 2nd

Re: [R] the integer of a given location

2009-09-12 Thread Jorge Ivan Velez
Hi darkhorn, Here are two suggestions: # Suggestion 1 z - 78923698701 foo - function(x, pos) strsplit(as.character(x),)[[1]][pos] foo(z,2) # [1] 8 # Suggestion 2 foo2 - function(x, pos) substr(x,pos,pos) foo2(z,2) # [1] 8 See ?strsplit and ?substr for more details. HTH, Jorge On Sat, Sep 12,

Re: [R] the integer of a given location

2009-09-12 Thread darkhorn
Thank you very much. :-) as.integer(substring(as.character(z), 2, 2)) [1] 8 as.integer(foo2(z,2)) [1] 8 -- View this message in context: http://www.nabble.com/the-integer-of-a-given-location-tp25418729p25419555.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Barplot+Table

2009-09-12 Thread gunksta
Marc Schwartz-3 wrote: Using the data that is in the online plot rather than the above, here is a first go. Note that I am not drawing the background grid in the barplot or the lines for table below it. These could be added if you really need them. snip HTH, Marc Schwartz

[R] Manage an unknown and variable number of data frames

2009-09-12 Thread Mark Knecht
Hi, In the code below I create a small data.frame (dat) and then cut it into different groups using CutList. The lists in CutList allow to me choose whatever columns I want from dat and allow me to cut it into any number of groups by changing the lists. It seems to work OK but when I'm done I

Re: [R] zoo plot: yearly marks on X-Axis

2009-09-12 Thread lanczos
On Sun, 2009-07-26 at 13:17 +0200, Poersching wrote: stvienna wiener schrieb: Hi all, I am plotting a financial time series, but I need a more detailed X-Axis. Example: x - zoo(rnorm(1:6000), as.Date(1992-11-11)+c(1:6000)) plot(x) The X-Axis is labeled 1995, 2000 and 2005. I

Re: [R] zoo plot: yearly marks on X-Axis

2009-09-12 Thread Gabor Grothendieck
Try this: library(zoo) x - zoo(rnorm(1:6000), as.Date(1992-11-11)+c(1:6000)) plot(x, xaxt = n) # cut time into years, remove duplicate years and convert back to Date yy - as.Date(unique(cut(time(x), year))) axis(1, yy, format(yy, %y)) There are a number of examples of custom X axes in the

Re: [R] Manage an unknown and variable number of data frames

2009-09-12 Thread David Winsemius
On Sep 12, 2009, at 10:13 PM, Mark Knecht wrote: Hi, In the code below I create a small data.frame (dat) and then cut it into different groups using CutList. The lists in CutList allow to me choose whatever columns I want from dat and allow me to cut it into any number of groups by changing

Re: [R] Re : stack overflow when loading workspace

2009-09-12 Thread Prof Brian Ripley
There is a command-line flag for this: tystie% R --help ... --max-ppsize=NSet max size of protect stack to N so you do not need to re-compile. It is not uncommon to need more space to load objects than to save them, and the need to raise this limit to re-load a worskpace has come up