ContourFunctions

Travis-CI Build Status

This is an R package that provides simple functions for creating contour plots.

Overview

The main functions are:

Installation

# It can be installed like any other package
install.packages("ContourFunctions")

# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("CollinErickson/contour")

Usage


library(ContourFunctions)
a <- b <- seq(-4*pi, 4*pi, len = 27)
r <- sqrt(outer(a^2, b^2, "+"))
cf_grid(a, b, cos(r^2)*exp(-r/(2*pi)))
f1 <- function(r) cos(r[1]^2 + r[2]^2)*exp(-sqrt(r[1]^2 + r[2]^2)/(2*pi))
cf_func(f1, xlim = c(-4*pi, 4*pi), ylim = c(-4*pi, 4*pi))
set.seed(0)
x <- runif(20)
y <- runif(20)
z <- exp(-(x-.5)^2-5*(y-.5)^2)
cf_data(x,y,z)