How to pull data into R from BigQuery table connected to Google Sheet

Viewed 78

I have successfully pulled in data from a BigQuery table that is sourced from CSV. However, when I try the same steps to pull in data from BigQuery that is sourced from Google Sheets I get the following error:

Error: Error while reading table: testprojectanintroductiontogcp.Demo.SheetsDemo, error message: Failed to read the spreadsheet. Error code: PERMISSION_DENIED [invalid] 

Here is my code:

project_id <- "testprojectanintroductiontogcp"
sql_string <- "SELECT * FROM testprojectanintroductiontogcp.Demo.SheetsDemo LIMIT 5"
query_results <- query_exec(sql_string, project = project_id, useLegacySql = FALSE)

readr and bigrquery packages are installed.

How do I access a datatable that is being sourced from Google Sheets?

0 Answers
Related