Search code examples
rgoogle-sheetsintegrationmodeling

How can I use an R model to power a cell in a google sheet?


I want to use a stats::loess model object created in R to generate a cell's value in google sheets automatically. The input to the function being two other cells in the sheet.

  1. I created a model object using loess() and created a model that intakes two features.

    • predict(df, tibble(x,y)) = prediction
  2. I want to use this model to power a cell in a google sheet so that non-technical teammates can change the inputs to see what outputs they'd get in different scenarios.

  3. I can read and write to a google sheet with R, but I want someone shared on the google sheet to have the output value live-updated if they change the input values.

Is there a way to do that?


Solution

  • I dont think that's possible. You can only interact with googlesheets when a manual trigger is fired like when you run to edit cells in googlesheets or download values from a sheet. To have a dynamic platform I recommend using shinny.