0

How can I read a sheet from google sheets and use it in RMarkdown, without having to answer the authorization question?

url <- "https://docs.google.com/spreadsheets/d/1tAeMng_wLlZfDfeeLzgV8h7vGqWmFhqQv1AAXf60HtU/edit?usp=sharing"

df <- googlesheets4::read_sheet(url, sheet="sensib-fungic")

The googlesheets4 package is requesting access to your Google account. Select a pre-authorised account or enter '0' to obtain a new token. Press Esc/Ctrl + C to abort.

zx8754
  • 52,746
  • 12
  • 114
  • 209
Juanchi
  • 1,147
  • 2
  • 18
  • 36
  • The file would need to be public—otherwise, how would you get access to it if not by logging in? Alternatively, if you have access to the file, download it in a separate script and write it to a file your markdown file will have access to – camille Feb 19 '20 at 17:57
  • Thanks! by the way do you know how to import a sheet with token? – Juanchi Feb 20 '20 at 11:17
  • 1
    It will give you options to log in & authenticate. Outlined in the [docs](https://googlesheets4.tidyverse.org/) – camille Feb 20 '20 at 15:00
  • 1
    The new `googlesheets4` should only ask for authorisation the first time, then give you the option to cache the credentials in $HOME/.R/gargle. – neilfws May 27 '20 at 12:01

0 Answers0