heatmapplot: heatmap

Description Usage Arguments Value Examples

View source: R/heatmapplot.R

Description

heatmap

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
heatmapplot(
  formula,
  data,
  xbreaks = NULL,
  ybreaks = NULL,
  addvals = FALSE,
  addN = FALSE,
  digits = 1,
  ...
)

Arguments

formula

formula for plot

data

data set for plot (typically a data frame)

xbreaks

numeric, the breakpoints for the horizontal axis

ybreaks

numeric, the breakpoints for the vertical axis

addvals

add the response values to the plot

addN

add the sample size to the plot

digits

numeric: if response variable is plotted, round to this many digits (default is 1)

...

other parameters passed on to plot() or text()

Value

a plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
xdata <- expand.grid(a = seq(0, 1, 0.1), b = seq(10, 20, 1))
xdata$resp <- rnorm(nrow(xdata))
heatmapplot(resp ~ a + b, data = xdata)

set.seed(123)
xdata <- expand.grid(k = seq(8, 200, length.out = 31), shape = seq(0, 1, length.out = 31))
idata <- randomsequence(10, 50, reversals = 0.3)
allids <- colnames(idata$pres)[2:ncol(idata$pres)]
winner <- as.character(idata$seqdat$winner)
loser <- as.character(idata$seqdat$loser)

myranks <- 1:length(allids)
names(myranks) <- allids

for(i in 1:nrow(xdata)) {
  kv <- rep(xdata$k[i], length(winner))
  sv <- createstartvalues(ranks = myranks, shape = xdata$shape[i])$res
  res <- fastelo(WINNER = winner, LOSER = loser, ALLIDS = allids, KVALS = kv, STARTVALUES = sv,
                 ROUND = FALSE)
  xdata$ll[i] <- likelo(res)
}

heatmapplot(ll ~ k + shape, data = xdata)

EloRating documentation built on March 26, 2020, 7:29 p.m.