-
Notifications
You must be signed in to change notification settings - Fork 0
/
executable_google_mapper.R
42 lines (31 loc) · 1.08 KB
/
executable_google_mapper.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
37
38
39
40
41
42
#!/usr/bin/env Rscript
suppressWarnings(library(argparser))
suppressWarnings(suppressMessages(library(tidyverse)))
# Load main script
# The following file following should be in the same directory as this script
source("google_mapper.R")
parser <- arg_parser("google_mapper", hide.opts = TRUE)
parser <- parser %>%
add_argument("--ratings",
help = "Ratings/reviews json file",
default = "Takeout/Maps (your places)/Reviews.json"
) %>%
add_argument("--locations",
help = "Location history json file",
default = "Takeout/Location History/Location History.json"
) %>%
add_argument("--labels",
short = "-b",
help = "Labeled places json file",
default = "Takeout/Maps/My labeled places/Labeled places.json"
) %>%
add_argument("--outfile",
help = "Output file name",
default = "map.html"
)
argv <- parse_args(parser)
# Put file names into a list
files <- c(argv$ratings, argv$locations, argv$labels, argv$outfile)
names(files) <- c("ratings", "location", "labels", "outfile")
# Call the main script, pass files as argument
map_data(files = files)