Re: [R] Alignment of lines within barplot bars

2010-09-09 Thread John Kane
Like this? x - 4:7 barplot(x, density=10, angle=180) --- On Thu, 9/9/10, Steve Murray smurray...@hotmail.com wrote: From: Steve Murray smurray...@hotmail.com Subject: [R] Alignment of lines within barplot bars To: r-help@r-project.org Received: Thursday, September 9, 2010, 11:35 AM

Re: [R] problem with outer

2010-09-09 Thread tuggi
hello, i don not really understand what you me, sorry. can you describe what you mean. tuggi -- View this message in context: http://r.789695.n4.nabble.com/problem-with-outer-tp2532074p2533259.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread David Winsemius
On Sep 9, 2010, at 11:20 AM, David Winsemius wrote: On Sep 8, 2010, at 7:32 PM, Jonathan Finlay wrote: Thanks David, gmodels::Crosstable partially work because can show only 1 x 1 tablen CrossTable(x,y,...) I need something how can process at less 1 variable in X an 10 in Y. A further

Re: [R] Failure to aggregate

2010-09-09 Thread Dimitri Shvorob
Thanks a lot, Jim. I am not sure what difference the various POSIXes make - in the end, you are replacing a datetime hour with a numeric value, e.g., 1 or 9. That does not work for me, unfortunately. g = head(x) dput(g) structure(list(price = c(500L, 500L, 501L, 501L, 500L, 501L), size =

Re: [R] Failure to aggregate

2010-09-09 Thread Dimitri Shvorob
Update: What did make a difference for me - and something that was present in Jim's example, but not reproduced by myself initially - was dropping columns other than the two involved. When I dropped all columns except for h and src, the sqldf call worked. ... Is it an R bug or what? (I am saying

[R] executing loop in circular way

2010-09-09 Thread cassie jones
Dear all, I am writing a program using for loop. The loop contains i which runs from 1:n. There is a feature I need to include here. That is, when i=n, i+1 would be 1, not n+1. Basically the loop should run in a circular fashion. That also means, if i=1, i-1=n. Can anyone help me with this? How

Re: [R] executing loop in circular way

2010-09-09 Thread jim holtman
try this: i - 0 n - 10 repeat{ cat(i + 1) # use the value; add 1 since we start at zero i - (i + 1) %% n } On Thu, Sep 9, 2010 at 12:53 PM, cassie jones cassiejone...@gmail.com wrote: Dear all, I am writing a program using for loop. The loop contains i which runs from 1:n. There

Re: [R] Failure to aggregate

2010-09-09 Thread Gabor Grothendieck
On Thu, Sep 9, 2010 at 12:39 PM, Dimitri Shvorob dimitri.shvo...@gmail.com wrote: Update: What did make a difference for me - and something that was present in Jim's example, but not reproduced by myself initially - was dropping columns other than the two involved. When I dropped all columns

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread Marc Schwartz
On Sep 9, 2010, at 12:16 PM, David Winsemius wrote: On Sep 9, 2010, at 11:20 AM, David Winsemius wrote: On Sep 8, 2010, at 7:32 PM, Jonathan Finlay wrote: Thanks David, gmodels::Crosstable partially work because can show only 1 x 1 tablen CrossTable(x,y,...) I need something how can

Re: [R] Bug on chron

2010-09-09 Thread skan
I've tried with other zoo series and I have always the same problem. -- View this message in context: http://r.789695.n4.nabble.com/Bug-on-chron-with-zoo-tp2533135p2533287.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Reproducible research

2010-09-09 Thread Max Kuhn
A Reproducible Research CRAN task view was recently created: http://cran.r-project.org/web/views/ReproducibleResearch.html I will be updating it with some of the information in this thread. thanks, Max On Thu, Sep 9, 2010 at 11:41 AM, Matt Shotwell shotw...@musc.edu wrote: Well, the

Re: [R] Correlation question

2010-09-09 Thread Stephane Vaucher
Hi Josh, Initially, I was expecting R to simply ignore non-numeric data. I guess I was wrong... I copy-pasted what I observe, and I do not get an error when calculating correlations with text data. I can also do cor(test.n$P3, test$P7) without an error. If you have a function to select only

Re: [R] createDataPartition

2010-09-09 Thread Max Kuhn
Trafim, You'll get more answers if you adhere to the posting guide and tell us you version information and other necessary details. For example, this function is in the caret package (but nobody but me probably knows that =]). The first argument should be a vector of outcome values (not the

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread Jonathan Finlay
Ok friends, I tried but I not know! I'm a Linux SysAdmin and Stadistical and i working to migrate all the software in my workplace to free or open software. The OS was easy, ofimatic suite too, multimedia and graphics you know, everything was relatively easy. But i work with SPSS and I produce

Re: [R] problem with outer

2010-09-09 Thread Joshua Wiley
On Wed, Sep 8, 2010 at 3:03 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: snip I got into the habit of starting a new R session and testing the code I was going to email, before hand. It helps to notice missing variables, libraries that need to be loaded, etc. It was rightly pointed out to

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread Marc Schwartz
On Sep 9, 2010, at 12:59 PM, Jonathan Finlay wrote: Ok friends, I tried but I not know! I'm a Linux SysAdmin and Stadistical and i working to migrate all the software in my workplace to free or open software. The OS was easy, ofimatic suite too, multimedia and graphics you know, everything

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread David Winsemius
On Sep 9, 2010, at 2:14 PM, Marc Schwartz wrote: On Sep 9, 2010, at 12:59 PM, Jonathan Finlay wrote: Ok friends, I tried but I not know! I'm a Linux SysAdmin and Stadistical and i working to migrate all the software in my workplace to free or open software. The OS was easy, ofimatic suite

Re: [R] Failure to aggregate

2010-09-09 Thread Dimitri Shvorob
Ok, conversion to POSIXct does the trick - why doesn't tapply work with the other, not-obviously-improper POSIX type? (Incidentally, now it gives me more trouble, with sorting - a reproducible sample coming up in another thread). -- View this message in context:

Re: [R] Alignment of lines within barplot bars

2010-09-09 Thread John Kane
Okay, I misread what you wanted. Try this == x - 4:7 positions - barplot(x) mid - x/2 arrows(positions-.5,mid,positions+.5,mid,angle=0) == --- On Thu, 9/9/10, Steve Murray

[R] TCLTK - ListBox - centralize text

2010-09-09 Thread Joaquim Neto
Hello, how do I centralize the texts inside a RTclTk listbox? The code I am using is: require(tcltk) tt-tktoplevel() tl-tklistbox(tt,height=4,selectmode=single,background=white) tkgrid(tklabel(tt,text=What's your favorite fruit?)) tkgrid(tl) fruits - c(Apple,Orange,Banana,Pear) for

[R] Help on simple problem with optim

2010-09-09 Thread Zhang,Yanwei
Dear all, I ran into problems with the function optim when I tried to do an mle estimation of a simple lognormal regression. Some warning message poped up saying NANs have been produced in the optimization process. But I could not figure out which part of my code has caused this. I wonder if

Re: [R] Correlation question

2010-09-09 Thread Joshua Wiley
Hi Stephane, According to the NEWS file, as of 2.11.0: cor() and cov() now test for misuse with non-numeric arguments, such as the non-bug report PR#14207 so there is no need for a new bug report. Here is a simple way to select only numeric columns: # Sample data dat - data.frame(a = 1:10L, b =

Re: [R] Help request: highlighting R code on WordPress.com blogs

2010-09-09 Thread Yihui Xie
Thanks, Tal. It does not look too difficult to write such a brush, which is actually a JS file. However, I have a concern that R has thousands of functions (in base R only), so it might not worth including all of them in the brush, which is the way that they implemented the highlighting script for

Re: [R] Correlation question

2010-09-09 Thread Peter Ehlers
On 2010-09-09 11:53, Stephane Vaucher wrote: Hi Josh, Initially, I was expecting R to simply ignore non-numeric data. I guess I was wrong... I copy-pasted what I observe, and I do not get an error when The first thing to do when you get results that you don't expect is to check the help page.

Re: [R] Correlation question

2010-09-09 Thread Stephane Vaucher
Hi everyone, Thanks for the help. On Thu, 9 Sep 2010, Peter Ehlers wrote: The first thing to do when you get results that you don't expect is to check the help page. The page for cor clearly states that its input is to a *numeric* vector, matrix or data frame (my emphasis). I would not be

Re: [R] Help request: highlighting R code on WordPress.com blogs

2010-09-09 Thread Tal Galili
Hello Yihui, I'd be glad to have you try and create the R brush - thanks for offering! In case you'll come up against walls, I hope there would be people in the mailing list that would be able to help out. Cheers, Tal Contact

Re: [R] Help on simple problem with optim

2010-09-09 Thread Thomas Stewart
This is only a guess because I don't have your data: sigma is must be positive in the dnorm function. My guess is that optim may attempt an iteration with a negative sigma. You may want to see help(optim) for dealing with this constraint. Specifically see the lower argument. If you specify

Re: [R] Help on simple problem with optim

2010-09-09 Thread Peng, C
Yanwei!!! Have you tried to write the likelihood function using log-normal directly? if you haven't so, you may want to check ?rlnorm -- View this message in context: http://r.789695.n4.nabble.com/Help-on-simple-problem-with-optim-tp2533420p2533487.html Sent from the R help

Re: [R] boxplot knowing Q1, Q3, median, upper and lower whisker value

2010-09-09 Thread Brian Diggs
On 9/6/2010 8:46 AM, David A. wrote: Dear list, I am using a external program that outputs Q1, Q3, median, upper and lower whisker values for various datasets simultaneously in a tab delimited format. After importing this text file into R, I would like to plot a boxplot using these given

[R] estimating treatment effect in blocked experiment

2010-09-09 Thread Mark A. Albins
R-help, I am interested in estimating the effect of a treatment (2 levels) on a response. I've used a randomized blocked experiment (5 blocks). I run the full model, let's say that it is... lm1 - lm(resp ~ treat + block) ...and find that there are no significant block effects. Now with

[R] Is there Stangle/Rtangle functionality available for odfWeave input documents?

2010-09-09 Thread Denne Reed
I'm using odfWeave for reproducible research and would like to extract the R code chunks form an OpenOffice .odt document in a manner similar to the way Stangle is used to extract code chunks from Sweave input files. Is this possible? Thanks in advance, Denné Reed Assistant Professor

Re: [R] Help request: highlighting R code on WordPress.com blogs

2010-09-09 Thread Andrew Redd
The question would be performance issues for having too many functions. We could just limit it to the reserved keywords. Another option for the functions is to highlight anything that looks like a function with the regular expression /[\w._]+(?=\()/ that is any function name with periods and

[R] Plotting dates and grid lines on the X-Axis of xyplot

2010-09-09 Thread demac
I have a plotting function that is plots a multi-panel plot, with the x-axis as a date and various y-axes. I would like to control the frequency of the X-axis labels, ticks and grid lines. However with the following code I get no annotation on the X-axis at all. Here is a minimal data.frame

Re: [R] Help on simple problem with optim

2010-09-09 Thread William Dunlap
You can record all arguments and return values of the calls that optim(par,fn) makes to fn with a function like the following. It takes your function and makes a new function that returns the same thing but also records information it its environment. Thus, after optim is done you can see its

[R] R2WinBugs problem

2010-09-09 Thread Mark Irwin
I'm having difficulty running R2WinBugs on a setup that previously worked for me (Dell Laptop, Windows XP service pack 3, R 2.11.1, WinBugs 1.43) . When I issue the following command smds.sim - bugs (data, inits, parameters, SMDSbrandLoc2.bug, debug = T, n.thin = n.thin, n.chains =

Re: [R] Strange output daply with empty strata

2010-09-09 Thread Jan van der Laan
This is a bug, which I've fixed in the development version (hopefully to be released next week). In the plyr 1.2: OK, thank you both for your answers. I'll wait for the next version. Regards, Jan __ R-help@r-project.org mailing list

[R] sequeeze a data frame

2010-09-09 Thread array chip
Hi, suppose I have a data frame as below: dat-cbind(expand.grid(id=c(1,2,3),time=c(0,3,6),mode=c('R','L'),rep=(1:3)),y=rnorm(54)) I kind of want to squeeze the data frame into a new one with averaged y over rep for the same id, time and mode. taking average is easy with tapply: tapply(dat$y,

Re: [R] sequeeze a data frame

2010-09-09 Thread David Winsemius
On Sep 9, 2010, at 5:47 PM, array chip wrote: Hi, suppose I have a data frame as below: dat- cbind (expand .grid (id=c(1,2,3),time=c(0,3,6),mode=c('R','L'),rep=(1:3)),y=rnorm(54)) I kind of want to squeeze the data frame into a new one with averaged y over rep for the same id, time

Re: [R] plot symbol +, but with variable bar lenghts

2010-09-09 Thread Jan van der Laan
You can also plot the +'s yourself using for example matlines: # Some data x - 1:10 y - 1:10 # Height and width of the crosses dx1 - 0.1 # width in negative x-direction dx2 - 0.2 # width in positive x-direction dy1 - 0.2 # height in negative y-direction dy2 - 0.3 # height in positive

Re: [R] Calculating with tolerances

2010-09-09 Thread Carl Witthoft
That won't do much good. Tolerances don't add (except in rare circumstances), and certainly not when they're in different units. There's nothing wrong with the first part, i.e. setting up variables whose contents include the mean and the tolerance, but is that peak? or sigma? and so on.

[R] URL error when trying to use help function in R [Sec: UNOFFICIAL]

2010-09-09 Thread Gosse, Michelle
Greetings, I am using R version 2.11.1 on a Dell computer, via a VMware connection to a remote server. My browser version is IE 8.0.6001.18702 and the OS is some corporate version of Microsoft XP. I'm trying to learn more about the tapply function , so I typed ?tapply into the command line.

Re: [R] URL error when trying to use help function in R [Sec: UNOFFICIAL]

2010-09-09 Thread David Winsemius
On Sep 9, 2010, at 6:34 PM, Gosse, Michelle wrote: Greetings, I am using R version 2.11.1 on a Dell computer, via a VMware connection to a remote server. My browser version is IE 8.0.6001.18702 and the OS is some corporate version of Microsoft XP. I'm trying to learn more about the

Re: [R] sequeeze a data frame

2010-09-09 Thread array chip
Thank you David. I probably didn't make my question clear enough. In the end, I want a shorter version of the original data frame, basically with variable rep removed, then just one row per id, time and mode combination. The original data frame has 54 rows, I wish to have a data frame with

Re: [R] Calculating with tolerances

2010-09-09 Thread Kjetil Halvorsen
I tried RSiteSearch(Interval aritmetic) which gives zero hits. There exist a http://www.boost.org/ free software library for interval aritmetic, which it shoub be possible to link to R. Kjetil On Thu, Sep 9, 2010 at 6:28 PM, Carl Witthoft c...@witthoft.com wrote: That won't do much good.  

Re: [R] sequeeze a data frame

2010-09-09 Thread Peter Alspach
Tena koe John ?aggregate maybe? HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of array chip Sent: Friday, 10 September 2010 11:13 a.m. To: David Winsemius Cc: r-help@r-project.org Subject: Re: [R]

Re: [R] sequeeze a data frame

2010-09-09 Thread array chip
Thank you Peter, yes this is what I need! John - Original Message From: Peter Alspach peter.alsp...@plantandfood.co.nz To: array chip arrayprof...@yahoo.com; David Winsemius dwinsem...@comcast.net Cc: r-help@r-project.org r-help@r-project.org Sent: Thu, September 9, 2010 4:26:53 PM

Re: [R] Calculating with tolerances

2010-09-09 Thread Jeff Newmiller
I think the reason this type of computation is not performed more routinely is the correlation issue. If two quantities are negatively correlated, the standard deviation of a result computed with them may actually be smaller (percentage-wise) than the larger off the original two standard

[R] survfit question

2010-09-09 Thread andre bedon
Hi, I am attempting to graph a Kaplan Meier estimate for some claims using the survfit function. However, I was wondering if it is possible to plot a cdf of the kaplan meier rather than the survival function. Here is some of my code: library(survival) Surv(claimj,censorj==0)

Re: [R] survfit question

2010-09-09 Thread David Winsemius
On Sep 9, 2010, at 8:50 PM, andre bedon wrote: I am attempting to graph a Kaplan Meier estimate for some claims using the survfit function. However, I was wondering if it is possible to plot a cdf of the kaplan meier rather than the survival function. Here is some of my code: It's not

Re: [R] Regression using mapply?

2010-09-09 Thread Gray Calhoun
Hi Philipp, I like to use something like lapply(2:10, function(j) lm.fit(cbind(1, DataMatrix[,j]), DataMatrix[,1])) for this sort of thing. I'd be curious to know if there are other approaches that are better. --Gray On Wed, Sep 8, 2010 at 4:34 AM, Philipp Kunze pku...@gwdg.de wrote: Hi,

Re: [R] survfit question

2010-09-09 Thread Kevin E. Thorpe
On 09/09/2010 08:50 PM, andre bedon wrote: Hi, I am attempting to graph a Kaplan Meier estimate for some claims using the survfit function. However, I was wondering if it is possible to plot a cdf of the kaplan meier rather than the survival function. Here is some of my code: Do you

[R] OT: model diagnostics in the published literature

2010-09-09 Thread Christopher W. Ryan
This is a more general statiscal question, not specific to R: As I move through my masters curriculum in statistics, I am becoming more and more attuned to issues of model fit and diagnostics (graphical methods, AIC, BIC, deviance, etc.) As my regression professor always likes to say, only

[R] lmer fixed effects, SE, t . . . and p

2010-09-09 Thread John Sorkin
windows Vista R 2.10.1 (1) How can I get the complete table of for the fixed effects from lmer. As can be seen from the example below, fixef(fit2) only give the estimates and not the SE or t value fit3- lmer(y~time + (1|Subject) + (time|Subject),data=data.frame(data)) summary(fit3) Linear

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-09 Thread Mitchell Maltenfort
Try coef(summary(fit3)) On Thu, Sep 9, 2010 at 11:00 PM, John Sorkin jsor...@grecc.umaryland.edu wrote: windows Vista R 2.10.1 (1) How can I get the complete table of for the fixed effects from lmer. As can be seen from the example below, fixef(fit2) only give the estimates and not the

[R] faster unlist,strsplit,gsub,for

2010-09-09 Thread rajesh j
Hi, I perform the operations unlist,strsplit,gsub and the for loop on a lot of strings and its heavily slowing down the overall system. Is there some way for me to speeden up these operations..maybe like alternate versions that exist which use multiprocessors etc. -- Rajesh.J

[R] gee p values

2010-09-09 Thread John Sorkin
windows Vista R 2.10.1 Is it possible to get p values from gee? Summary(geemodel) does not appear to produce p values.: fit4- gee(y~time, id=Subject, data=data.frame(data)) Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 running glm to get initial regression estimate (Intercept)

Re: [R] Help request: highlighting R code on WordPress.com blogs

2010-09-09 Thread D Kelly O'Day
Tali I am one of your estimated 29 Wordpress bloggers. Thanks for your RBloggers site!! I use Wordpress.com's site for my blog. I use a simple method to highlight my R script in Wordpress, example

Re: [R] lmer fixed effects, SE, t . . . and p

2010-09-09 Thread John Sorkin
Bert, I appreciate you comments, and I have read Doug Bates writing about p values in mixed effects regression. It is precisely because I read Doug's material that I asked how are we to interpret the estimates rather than how can we compute a p value. My question is a simple question whose

Re: [R] faster unlist,strsplit,gsub,for

2010-09-09 Thread jim holtman
First thing to do is to use Rprof to profile your code to see where the time is being spent, then you can make a decision as to what to change. Are you carrying out the operations on a dataframe, if so can you change it to a matrix for some of the operations? You have provided no idea of what

Re: [R] Error in normalizePath(path) : with McAfee

2010-09-09 Thread Erin Hodgess
For what it's worth: I turned off the Real time file scanning and everything worked fine. This is using McAfee anti-virus software. Thanks, Erin On Thu, Sep 9, 2010 at 10:15 AM, peter dalgaard pda...@gmail.com wrote: On Sep 9, 2010, at 13:52 , Duncan Murdoch wrote: On 09/09/2010 12:01 AM,

Re: [R] faster unlist,strsplit,gsub,for

2010-09-09 Thread rajesh j
Ok. These operations are on a string and the result is added to a data.frame. I have strings of the form x,y,z,a,b,c,dda,b,c,d,e,f,gd essentially comma separated values delimited by a d I first do a unlist(strsplit(string,split=d)) and then a strsplit(string,split=,) The list of vectors i end up

Re: [R] Highlighting a few bars in a barplot

2010-09-09 Thread Michael Bibo
Daniel Brewer daniel.brewer at icr.ac.uk writes: Hello, I have a bar plot where I am already using colour to distinguish one set of samples from another. I would also like to highlight a few of these bars as ones that should be looked at in detail. I was thinking of using hatching, but

<    1   2