forked from jpflores-13/cv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gather_data.R
37 lines (28 loc) · 1.49 KB
/
gather_data.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# =================================================================================
# This code uses google sheets to store the position info
if(using_googlesheets){
library(googlesheets4)
if(sheet_is_publicly_readable){
# This tells google sheets to not try and authenticate. Note that this will only
# work if your sheet has sharing set to "anyone with link can view"
gs4_deauth()
} else {
# My info is in a public sheet so there's no need to do authentication but if you want
# to use a private sheet, then this is the way you need to do it.
# designate project-specific cache so we can render Rmd without problems
options(gargle_oauth_cache = ".secrets")
# Need to run this once before knitting to cache an authentication token
# googlesheets4::sheets_auth()
}
position_data <- read_sheet(positions_sheet_loc, sheet = "entries", skip = 1)
skills <- read_sheet(positions_sheet_loc, sheet = "language_skills", skip = 1)
text_blocks <- read_sheet(positions_sheet_loc, sheet = "text_blocks", skip = 1)
contact_info <- read_sheet(positions_sheet_loc, sheet = "contact_info", skip = 1)
resume_awards <- read_sheet(positions_sheet_loc, sheet = "resume_awards")
} else {
# Want to go oldschool with just a csv?
position_data <- read_csv("csvs/positions.csv")
skills <- read_csv("csvs/language_skills.csv")
text_blocks <- read_csv("csvs/text_blocks.csv")
contact_info <- read_csv("csvs/contact_info.csv", skip = 1)
}