I found a rather easy solution that circumvents this problem by:
1) creating your own length function using na.omit function
2) calculating variance using tapply
3) calculating length using new length function
4) calculating square root of variance by length
*Code from LeCzar:*
I want to generate a list (called dataList below) where each of its
levels is named. These names are assigned to nameList, which contains
all possible permutations of size two taking letters from a larger
alphabet, e.g., aa,...,Fd,..,Z1,... One of these permutations is
the character string
Cliff Behrens wrote:
I want to generate a list (called dataList below) where each of its
levels is named. These names are assigned to nameList, which contains
all possible permutations of size two taking letters from a larger
alphabet, e.g., aa,...,Fd,..,Z1,... One of these permutations is
Quite irritating to me as the Manager of .NA too, when I
used NA for .NA :-)-O
el
Peter Dalgaard wrote:
Cliff Behrens wrote:
One of these permutations
is the character string NA. It seems that when I try to name one of
the dataList levels NA, using names(dataList)- nameList, the
names()
Peter,
OK...here is reproducible, self-contained code:
library(gregmisc)
columnNames - c(A,B,C,D,N,a,b,c)
namePerms- permutations(length(columnNames),2,columnNames,repeats=TRUE)
nameList - paste(namePerms[,1],namePerms[,2],sep=)
dataList - lapply(1:length(nameList), function(level) {})
Cliff Behrens wrote:
Peter,
OK...here is reproducible, self-contained code:
library(gregmisc)
Relying on a 3rd party package is not kosher either... Whatever did
list(NA=2) or l - list(2); names(l) - NA do to you?
columnNames - c(A,B,C,D,N,a,b,c)
namePerms-
Peter,
I've inserted response inline below:
Cliff
Peter Dalgaard wrote:
Cliff Behrens wrote:
Peter,
OK...here is reproducible, self-contained code:
library(gregmisc)
Relying on a 3rd party package is not kosher either... Whatever did
list(NA=2) or l - list(2); names(l) - NA do to you?
Cliff Behrens wrote:
Peter,
I've inserted response inline below:
Cliff
Peter Dalgaard wrote:
Cliff Behrens wrote:
Peter,
OK...here is reproducible, self-contained code:
library(gregmisc)
Relying on a 3rd party package is not kosher either... Whatever did
list(NA=2) or l - list(2);
Sorry...I didn't realize that there were such distinct lines drawn
around core vs contributed packages. I merely thought that r-help put
those with questions in touch with others who might have used or
authored a package and experienced the same problem. I didn't intend to
make more work for
Cliff Behrens-3 wrote:
For future reference, am
I to assume that no contributed packages should be implicated in
resolving a problem?
It does bring things one step closer to minimal, reproducible.
If you can identify the problem as specifically involving the package,
then it's
Very good...thanks! As you can tell, I really haven't made much (READ
any) previous use of this list.
Cliff
Ben Bolker wrote:
Cliff Behrens-3 wrote:
For future reference, am
I to assume that no contributed packages should be implicated in
resolving a problem?
It does bring
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 value.
I then try to:
a = NA; if (a == NA) { a = 0}
just to try it out, but it says
Error in if (a ==
Hi Keld
you should read ?sum.
sum(c(1,2,NA), na.rm=TRUE)
Cheers
Andrew
On Fri, Jul 04, 2008 at 08:29:34AM +0200, Keld J?rn Simonsen wrote:
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
://www.cmis.csiro.au/bill.venables/
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Keld Jørn
Simonsen
Sent: Friday, 4 July 2008 4:30 PM
To: r-help@r-project.org
Subject: [R] problem with NA and if
Hi
I would like to sum a number of time series, some
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
On Fri, Jul 04, 2008 at 04:44:53PM +1000, Andrew Robinson wrote:
Hi Keld
you should read ?sum.
sum(c(1,2,NA), na.rm=TRUE)
Thanks, that solved my problem.
Best regars
keld
Cheers
Andrew
On Fri, Jul 04, 2008 at 08:29:34AM +0200, Keld J?rn Simonsen wrote:
Hi
I would like to
Hey,
I want to compute means and standard errors as two tables like this:
se-function(x)sqrt(var(x)/length(x))
object1-as.data.frame.table(tapply(Data[Year==1999],na.rm=T,list(Group[Year==1999],Season[Year==1999]),mean))
Hi there,
Perhaps
se-function(x)sqrt(var(x,na.rm=T)/sum(!is.na(x)))
object1-as.data.frame.table(tapply(Data[Year==1999],list(Group[Year==1999],Season[Year==1999]),mean))
object2-as.data.frame.table(tapply(Data[Year==1999],list(Group[Year==1999],Season[Year==1999]),se))
Hope this helps,
Jorge
On Tue, Apr 8, 2008 at 12:44 PM, LeCzar [EMAIL PROTECTED] wrote:
Hey,
I want to compute means and standard errors as two tables like this:
se-function(x)sqrt(var(x)/length(x))
The missings are not your main problem.
The command var computes the variance-covariance matrix. Some
19 matches
Mail list logo