Comments in-line below
On 26/11/2014 06:27, Frederic Ntirenganya wrote:
Hi PIKAL,
Actually I am Michael, Petr is one of the other respondents.
The error seems to be starnge to me because i access the indices of NAs.
Indices can't be non-applicable.
But you are not testing the indexes, see
heers
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
> Frederic Ntirenganya
> Sent: Wednesday, November 26, 2014 7:27 AM
> To: Michael Dewey
> Cc: r-help@r-project.org
> Subject: Re: [R] Error Missing values where true/fal
On Nov 26, 2014, at 1:27 AM, Frederic Ntirenganya wrote:
> The error seems to be starnge to me because i access the indices of NAs.
No you don't. You access the contents of the cell via an index for which you
have previously determined that the contents is NA. Then you compare that
contents w
Hi PIKAL,
The error seems to be starnge to me because i access the indices of NAs.
Indices can't be non-applicable.
This is the output of indecs having the NA in my dataset. my dataset is
very big that's why I did not provide it.
> indicNAs <- which(data$Rain %in% NA)
> indicNAs
[1] 426 792
You do not tell us what you are trying to do but I think there is
something wrong in the logic of your thinking as on the one hand you are
selecting just precisely those elements of data$Rain which are NA and
then testing whether any of them equals 60.
On 25/11/2014 12:19, Frederic Ntirengany
Hi
Error message seems to be clear
> Error in if (data$Rain[i_NA] == 60) { :
> missing value where TRUE/FALSE needed
data$Rain[i_NA] produces probably NA
> x<-NA
> if(x==60) print(1+1) else print("Errrorrr")
Error in if (x == 60) 1 + 1 : missing value where TRUE/FALSE needed
> x<-10
> if(x==6
Hi Abraham,
mylist <- list(roots = "car", prefix = "cheap")
myfoo <- function(x) {
print(mylist$x)
}
myfoo(roots) ## fails, but in a "sneaky" way
## you actually extract variable x from mylist
## but there is no variable x (it is just NULL)
## so while no error is thrown, you get nothing
myfoo
7 matches
Mail list logo