Define
mean0na <- function(x) {
x[ 0 == x ] <- NA
mean( x, na.rm = TRUE )
}
and then use that instead of mean.
On August 10, 2023 7:25:08 PM PDT, ani jaya wrote:
>Hello,
>
>I try to calculate the mean of an array with a condition. My array is
>B=c(181,101,420) in dimensions. And I want to f
Hello,
I try to calculate the mean of an array with a condition. My array is
B=c(181,101,420) in dimensions. And I want to find a specific member
in 3rd dimension (time monthly) based on a condition of another data
frame, A =c(420). My final array would be C=c(181,101,12) which 12 is
a monthly mea
2 matches
Mail list logo