See ?colSums
On Mon, May 10, 2010 at 12:44 AM, vincent.deluard
wrote:
>
> Hi R users,
>
> I have a matrix "m" of the type:
>
> m
> X4.20.2010 X4.19.2010 X4.16.2010
> [1,] 0.008319468 0. -0.008250825
> [2,] 0.005574136 0.01816118 0.073081608
> [3,] -0.047830688 0.01612903 -0.030
It is exactly the same
tmp <- matrix(1:24,6,4)
tmp[4,] <- NA
tmp
apply(tmp, 2, sum, na.rm=TRUE)
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting gu
Hi R users,
I have a matrix "m" of the type:
m
X4.20.2010 X4.19.2010 X4.16.2010
[1,] 0.008319468 0. -0.008250825
[2,] 0.005574136 0.01816118 0.073081608
[3,] -0.047830688 0.01612903 -0.030239833
[4,] NA NA NA
[5,] 0.008746356 0.02848576 -0.0255661
you must have missing values in "data". Try
tapply(data, group, mean, na.rm = TRUE)
If that's not the case, read the bottom of this email about the posting guide.
HTH,
--sundar
On Tue, Nov 3, 2009 at 5:28 AM, FMH wrote:
> Hi,
>
> I tried to use tapply function to find the mean of the data in
Hi,
I tried to use tapply function to find the mean of the data in each group as
the following command, but the result are NA, as there are several missing
values in each group.
tapply(data,group,mean)
Could someone please advice me the way to ignore the missing data in order for
the fucntio
5 matches
Mail list logo