I'm trying to make a Custom factor that retrieves the past four quarters of data for a given factor. The problem is I don't understand how to test the values of arrays inside custom factors. Below is my non-working function. How do I make the if statements work with the arrays?