I assume that there will already be some answers to this, so I apologize in advance, but I tried to look without luck, so .....
.... What is the smart way to deal with form numbers x + 0.0i in R?
For example, suppose that
y <- 1 + 0.0i
So of course:
y == 1
truly. So what is the best way to make y be 1.
Edit:
I do not want to discard the imaginary part, unless round(Im(y)) == 0 , but I was hoping that you would not have to explicitly check this.
source share