Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Formatting

  • Loading branch information...
commit 4fb6c74939fba87423d1f871a1b6abb3188b19d2 1 parent 36c6752
Hadley Wickham authored
Showing with 13 additions and 8 deletions.
  1. +12 −6 R/output.r
  2. +1 −1  R/parse.r
  3. +0 −1  R/profile.r
18 R/output.r
View
@@ -43,12 +43,18 @@ plot.profr <- function(x, ..., minlabel = 0.1, angle = 0) {
#' ggplot(reshape_prof)
#' }
ggplot.profr <- function(data, ..., minlabel = 0.1, angle=0) {
- if (!require("ggplot2", quiet=TRUE)) stop("Please install ggplot2 to use this plotting method")
+ if (!require("ggplot2", quiet=TRUE))
+ stop("Please install ggplot2 to use this plotting method")
data$range <- diff(range(data$time))
ggplot(as.data.frame(data), aes(x = factor(level))) +
- geom_bar(aes(min = start, y = end), position="identity", stat = "identity", width = 1, fill="grey95", colour="black", size=0.5) +
- geom_text(aes(label=f, y=start + range/60), data=subset(data, time > max(time) * minlabel), size=4, angle=angle, hjust = 0) +
- scale_y_continuous("time") + scale_x_discrete("level") +
- coord_flip()
-}
+ geom_bar(aes(min = start, y = end),
+ position = "identity", stat = "identity",
+ width = 1, fill = "grey95", colour = "black", size = 0.5) +
+ geom_text(aes(label = f, y = start + range/60),
+ data = subset(data, time > max(time) * minlabel),
+ size = 4, angle = angle, hjust = 0) +
+ scale_y_continuous("time") +
+ scale_x_discrete("level") +
+ coord_flip()
+}
2  R/parse.r
View
@@ -85,4 +85,4 @@ parse_rprof <- function(path, interval=0.02) {
fs[-packaged] <- NA
fs[packaged] <- names
unname(fs[as.character(df$f)])
-}
+}
1  R/profile.r
View
@@ -52,4 +52,3 @@ profr <- function(expr, interval = 0.02, quiet = TRUE) {
df$level <- df$level - 7
df
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.