# Better way to display indicator function.

#### trinker

##### ggplot2orBust
I have an indicator function I am displaying in an R manual. I am trying to make it as one line (and more readable) so it looks good in the HTML version of the R documentation.

I'm looking to make the current function more streamlined. Dason did this for me previously using max, but I don't think I can make that work in this case.

So here was what Dason did before...

became...

How can I streamline this indicator function (maybe it already is but I thought I'd throw this out in case there's a better way):

#### Dason

##### Ambassador to the humans
Is it (sum of x_i^N) mod 2 or sum (x_i^N mod 2)?

#### Dason

##### Ambassador to the humans
Well then that quantity can only take on a value of either 0 or 1 - you don't need the indicator at all. $$(\sum x_i^N) mod 2$$ gives you the same exact thing as what you have.

#### trinker

##### ggplot2orBust
Gotcha Dason. In R coding my thought was this (x %% 2 > 0) evaluates to logical TRUE/FALSE. Hence why I thought the need to convert to 1/0. So you're saying no need to convert. Is this correct?

#### trinker

##### ggplot2orBust
Ah no need for the > at all. Gotcha. Smart.