[R] Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Wed Jan 26 16:03:56 CET 2022


Your error and your code don't match. Please spend some time to make a small reproducible example [1][2] when posting a question... you may even figure out your own answer before you send it out.

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

On January 26, 2022 5:47:16 AM PST, javed khan <javedbtk111 using gmail.com> wrote:
>I get this error:
>
>Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed
>
>I used this:
>
>var <- ifelse(test$operator == 'T14', 1, 0)
>
>operator has several values like T1, T3, T7, T15, T31, T37
>
>For some values like T3, T7 it works fine but for majority of values it
>gives error.
>
>When I use: is.na(ts$operator), it shows all false values so no NAs.
>
>Where could be the problem?
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list