vendredi 26 mars 2021

compare function value with a numerical value in R

I want to use ifelse to return 0 if the function gives out a value 0, Otherwise gives out 1. Code is as following:

ifelse((function() get_attribute(exp.sim, "Tx1.Event"))==0, 0, 1))

But I got this error message: comparison (1) is possible only for atomic and list types Anyone knows how to solve the problem?

Aucun commentaire:

Enregistrer un commentaire