condvis: Creates Condvis Shiny app

View source: R/helper.R

condvisR Documentation

Creates Condvis Shiny app

Description

Creates Condvis Shiny app

Usage

condvis(
  data,
  model = NULL,
  response = NULL,
  sectionvars = NULL,
  conditionvars = NULL,
  predsInit = NULL,
  pointColor = c("steelblue", "grey0"),
  cPlotPCP = FALSE,
  cPlotn = 1000,
  orderConditionVars = "default",
  threshold = 1,
  thresholdmax = NULL,
  linecols = NULL,
  showsim = NULL,
  theta3d = 45,
  phi3d = 20,
  dataplot = "pcp",
  tours = NULL,
  predictArgs = NULL,
  xlim = NULL,
  ylim = NULL,
  zlim = NULL,
  density = FALSE,
  showdata = density == FALSE,
  displayHeight = 950
)

Arguments

data

the dataset used for the fit. Should not have NAs for response, sectionvars or conditionvars.

model

A fitted model or list of models. May be NULL.

response

name of response variable. If null, tries to extract from model.

sectionvars

names of sectionvars. If null, extracts from data.

conditionvars

names of condition vars. If null, extracts from data.

predsInit

Optionally provide starting value for some predictors. Defaults to medoid.

pointColor

a color, or the name of variable to be used for coloring. If the named variable is numeric, it is first converted to a factor with 3 levels.

cPlotPCP

if TRUE, conditionplots are drawn as a single PCP (for more than two conditionvars)

cPlotn

Defaults to 1000. Shows a sample of this number of points in conditionplots. Non-numeric values are ignored.

orderConditionVars

If supplied, a function to order the Condition Vars

threshold

used for similarity weights, defaults to 1.

thresholdmax

maximum value allowed of threshold.

linecols

vector of colors to be used for fits

showsim

if TRUE, shows sim in conditionplots with points/lines. Defaults to TRUE with 150 or fewer cases.

theta3d, phi3d

Angles defining the viewing direction for 3d surface. theta3d gives the azimuthal direction and phi3d the colatitude. See persp.

dataplot

"pcp" or "pairs". Used when there is no response, or more than two sectionvars.

tours

A list of pre-calculated tours

predictArgs

a list with one entry per fit, giving arguments for CVpredict

xlim

passed on to sectionplot

ylim

passed on to sectionplot

zlim

passed on to sectionplot

density

default FALSE. Use TRUE if model is a density function.

showdata

defaults to density==TRUE. If FALSE, data on section not shown.

displayHeight

supply a value for the display height

Examples

fit <- lm(mpg ~ wt+hp+am, data=mtcars)
if(interactive()){
condvis(mtcars,fit, response="mpg",sectionvars="wt", conditionvars=c("am", "hp"), pointColor ="red")
}

condvis2 documentation built on Sept. 14, 2022, 5:06 p.m.