Currently I have this:
datatable(SignalDataFrame,selection = 'single', options=list(dom='ft')) %>%
#datatable(ResultDF, options=list(dom='ft')) %>%
formatStyle(
'200d MA',
backgroundColor = styleInterval(0, c('#e6b8b7', '#d8e4bc'))
) %>%
formatStyle(
'50v200d MA',
backgroundColor = styleInterval(0, c('#e6b8b7', '#d8e4bc'))
) %>%
formatDate(c(3,5,6), "toLocaleDateString")
})
As you see, style interval only formats values <0 in red and values >0 in green. I however want only to format cells in red respective in green for which their respective date is "younger" than 10 days.
For example column 200dMA (being column 2) should be only red if the value in this cell is <0 and the date in column 3 is younger than 10 days. And it should be green if the value is >0 and the date in column 3 is younger than 10 days.
How can I achieve that?