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
r 25, 2014 1:20 PM
> To: r-help@r-project.org
> Subject: [R] Error Missing values where true/false needed
>
> Dear All,
>
> I am getting this error and don't know why it comes. can you please
> help ?
>
> Error in if (data$Rain[i_NA] == 60) { :
> missing value w
Dear All,
I am getting this error and don't know why it comes. can you please help ?
Error in if (data$Rain[i_NA] == 60) { :
missing value where TRUE/FALSE needed
The loop is :
indicNAs <- which(data$Rain %in% NA)
ind_nonleap = c() # NAs due to non leap years
ind_nonrecord = c() # NAs due
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
I'm writing a function and keep getting the following error message.
myfunc <- function(lst) {
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
prefix2 = c("low cost"), suffix = c("quote", "quotes"),
suffix2 = c("rate", "rates"), suf
9 matches
Mail list logo