Skip to content

Commit 4dd54a8

Browse files
Added gcf
1 parent df81477 commit 4dd54a8

File tree

5 files changed

+57
-3
lines changed

5 files changed

+57
-3
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export(cf_highdim)
99
export(cm.colors.strong)
1010
export(csa)
1111
export(eval_over_grid_with_batch)
12+
export(gcf)
1213
export(gcf_data)
1314
export(gcf_func)
1415
export(gcf_grid)

R/cf.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#' Make contour plot from data or function
2+
#'
13
#' Simpler function for making contours with cf package.
24
#' Won't give argument completion, so all must be specified
35
#'
@@ -31,4 +33,4 @@ cf <- function(..., gg=FALSE) {
3133
stop("Data not recognized. Use cf_func for function or
3234
cf_data for data or cf_grid for full grid of data.")
3335
}
34-
}
36+
}

R/gcf.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#' Make contour plot from data or function using ggplot2
2+
#'
3+
#' Simpler function for making contours with cf package.
4+
#' Won't give argument completion, so all must be specified
5+
#'
6+
#' @param ... Arguments to be passed to cf_func or cf_data based on
7+
#' data type of first argument. If D is given as argument, then it
8+
#' is passed to cf_highdim.
9+
#'
10+
#' @return Whatever is returned from other function, probably nothing.
11+
#' Will be a ggplot2 object if using gg=TRUE.
12+
#' @export
13+
#'
14+
#' @examples
15+
#' gcf(function(x){x[1]^2 - x[2]})
16+
#' x <- runif(20)
17+
#' y <- runif(20)
18+
#' z <- exp(-(x-.5)^2-5*(y-.5)^2)# + rnorm(20,0,.05)
19+
#' gcf(x,y,z)
20+
#' gcf(function(x){x[1]^2 - x[2]}, D=3)
21+
gcf <- function(...) {
22+
cf(..., gg=TRUE)
23+
}

man/cf.Rd

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/gcf.Rd

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)