This is probably an easy one.
In R
, can I replace an if
condition character (such as >
) with a character
and execute the if
statement
with it?
For example, if the if
statement
is:
ifelse(1 < 2, "T", "F")
But I'm getting the >
condition character through a variable:
cc <- ">"
How would I write:
ifelse(1 < 2, "T", "F")
replacing <
with cc
?
Aucun commentaire:
Enregistrer un commentaire