knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(gcalendr)

Quickstart

This is a short document on getting up to speed with gcalendr quickly.

External Setup

In order to use gcalendr you will need to create a google project for it. The easiest way to do this is via the Python Quickstart.

Only very heavy usage of the Gmail API requires payment, so use of the API for most people should be free.

If you use usethis::edit_r_environ() to set both gcalendr_EMAIL and gcalendr_APP, then once you have an oauth token you can simply run calendar_auth_configure() with no arguments at the top of the script to setup your application.

Example

library(gcalendr)

## Set up google oauth permissions
## This will prompt you to specify an account
calendar_auth()
## To specify a specific account, provide your account id, typically an email address
calendar_auth("apdevries@gmail.com")

## Retrieve tibble of available calenders
calendar_ids <- calendar_list()
calendar_ids

## Retrieve tibble of events from a specific calendar

my_cal_id <- "apdevries@gmail.com"
events <- calendar_events(my_cal_id, days_in_past = 90, days_in_future = 90)
events


andrie/gcalendr documentation built on March 8, 2020, 2:36 a.m.