<html>
<head>
</head>
<body>
... uups embarrassingly <br>
Thanks !<br>
C.<br>
<br>
<br>
Peter Dalgaard BSA wrote:<br>
<blockquote type="cite" cite="mid:x2it4es437.fsf@biostat.ku.dk">
<pre wrap="">Christian Schulz <a class="moz-txt-link-rfc2396E" href="mailto:c.schulz@metrinomics.de"><c.schulz@metrinomics.de></a> writes:<br><br></pre>
<blockquote type="cite">
<pre wrap="">Hi,<br>i have some problems to get means, but the data have got<br>NA's which should not be replaced or delete !<br><br>tapply(data,var,mean) # makes me problem,because when one value is<br>NA mean is NA,too.<br><br>Another attempt is this, because the summary does what i want , but<br>is not subsetable to summary[4] if i use tapply,table and the the<br>function below gives me<br>again all means as NA ?<br><br> xmean <- function (var) {<br> summary(var)[4] }<br> apply(data,2,xmean) Thanks for any suggestion & regards,Christian<br></pre>
</blockquote>
<pre wrap=""><!----><br>tapply(data,var,mean, na.rm=TRUE)<br><br></pre>
</blockquote>
<br>
</body>
</html>