forked from tidyverse/ggplot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload.r
41 lines (34 loc) · 1.18 KB
/
load.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
# Load installed package
suppressMessages(library(ggplot2, warn.conflicts = FALSE))
# Find path of this file and source in R files
frame_files <- compact(llply(sys.frames(), function(x) x$ofile))
PATH <- dirname(frame_files[[length(frame_files)]])
paths <- dir(file.path(PATH, "R"), full.name=T)
paths <- paths[basename(paths) != "xxx.r"]
# Reorder paths so they're ordered in the same locale as me
loc <- Sys.setlocale("LC_COLLATE", "C")
paths <- paths[order(paths)]
Sys.setlocale("LC_COLLATE", loc)
l_ply(paths, source)
# Regenerate and load accessors for geoms etc.
accessors_print(file.path(PATH, "R", "xxx.r"))
source(file.path(PATH, "R", "xxx.r"))
source(file.path(PATH, "R", "zxx.r"))
# # Find out whether digest is changing between versions
# if (!exists("curr")) curr <- NULL
#
# prev <- curr
# curr <- qplot(mpg, wt, data=mtcars)
#
# curr_d <- digest.ggplot(curr)
# prev_d <- digest.ggplot(prev)
#
# if (!is.null(prev) & !identical(curr_d, prev_d)) {
# curr_b <- bolus(curr)
# prev_b <- bolus(prev)
# diff <- sapply(seq_along(curr_b), function(i) !identical(curr_b[[i]], prev_b[[i]]))
#
#
# stop("Digest has changed from ", prev_d, " to ", curr_d, call. = FALSE)
# }
#