How to load data from Google Spreadsheets into R

How to load data from Google Spreadsheets into R

The googlesheets package from statistics professor Jennifer Bryan at the University of British Columbia is by far the most convenient way.

    library(dplyr)
    library(googlesheets)

    # load all sheets in google drive by authentication (new browser tabs with 
    all_my_sheets_in_drive <- gs_ls()

    # show all sheets in R
    my_sheets

    # get a specific sheet
    d <- gs_title("Name of Googlesheet")

    # get worksheet 
    d <-  d %>% gs_read(ws="worksheet 1")