I'm designing a database in SQL that will have tables that store collected data and a table that stores calculated indexes of that data for later display on a dashboard. I want to calculate these indexes with the language R. I would like to know two things:
1 - How do I pull data from my SQL data tables to R so I can do the calculations?
2 - How do I store the results of my calculations in the R in my SQL index table?