Re: [R] problem with NA and if

2008-07-04 Thread Albert Greinoecker
try is.na() regards, Albert Am Freitag, den 04.07.2008, 08:29 +0200 schrieb Keld Jørn Simonsen: > Hi > > I would like to sum a number of time series, some of them having NA's > > Standard action is here that if I sum a value with a NA, then the result > is NA. I would like it to just keep the

Re: [R] Cumulative average

2008-05-22 Thread Albert Greinoecker
does e.g. x <- c(8,5,4,2) cumsum(x) / 1:length(x) do what you need? Albert Am Mittwoch, den 21.05.2008, 20:36 -0500 schrieb Jacques Wagnor: > Dear List, > > Does there exist a function that calculates a cumulative average? > Neither running() from library(gregmisc) nor running.mean() from > libra

[R] margin between plot region and axes

2007-12-17 Thread Albert Greinoecker
Hi useRs, in the following graphic... http://www.survey4all.org/tmp/with_margin.png I drawed a function and added two axes afterwards with "axis". I could not find a way to erase the margin between the axes and the plotting region, so I solved the problem with "text" and "segments", which looks li

Re: [R] margin between plot region and axes

2007-12-17 Thread Albert Greinoecker
Am Montag, den 17.12.2007, 21:22 +0100 schrieb Scionforbai: > > My question: is there a way to add axes the usual way (as tried for the > > first graphic), but to erase the margin, so that the axes start at point > > (0/0) in my case. > > Not really sure if this is what you ask, but maybe you shou

Re: [R] margin between plot region and axes

2007-12-17 Thread Albert Greinoecker
yes, that's it, thank's a lot to all respondents! Am Montag, den 17.12.2007, 18:12 -0500 schrieb Duncan Murdoch: > On 17/12/2007 4:19 PM, Albert Greinoecker wrote: > > Am Montag, den 17.12.2007, 21:22 +0100 schrieb Scionforbai: > >>> My question: is there a way to a

Re: [R] Orientation of labels on axes

2008-01-07 Thread Albert Greinoecker
Hi Michael, a solution would be not to draw axes directly, but afterwards with the axis-command: plot(length, col=color, axes=F) axis(2,at=, labels=, cex.axis=0.6, las=1); # left axis axis(1,at=, labels=, cex.axis=0.6, las=1); # bottom axis cex.axis...relativefont size las...text orientation se

Re: [R] vector generation

2008-01-24 Thread Albert Greinoecker
z[z > 1] regards, Albert Am Donnerstag, den 24.01.2008, 10:54 -0300 schrieb Juan Pablo Fededa: > Dear Contributors: > > I have the next vector: > > "Z" > > z = (526, 0.1, 110, 0.2, 34, 0.4, 614, 0.5, 1, 14, 15) > > > I want to generate a vector containing the values higher than 1 > correspo

Re: [R] grouped colSums without for loops?

2008-03-18 Thread Albert Greinoecker
try: aggregate(d[,2:3], by=list(d$foo), FUN=sum) cheers, Albert Am Dienstag, den 18.03.2008, 11:41 +0100 schrieb Hans Ekbrand: > Consider the following data.frame, d. > > d <- data.frame(c("a","b","c","d","b","a"), c(1,4,85,3,4,1), c(7,6,2,4,15,33)) > names(d) <- c("foo", "bar", "baz") > > To

Re: [R] Re move a number from a vector

2008-03-18 Thread Albert Greinoecker
does > x[!x == remove.value] do what you need? [1] 2 6 9 10 regards, Albert Am Dienstag, den 18.03.2008, 05:21 -0700 schrieb Josh Roofchop: > This should be an easy one, but I haven't been able to figure it out, > > x<-c(2, 4, 6, 9, 10) > #how do I remove a single value > x<-x[-2] # will r