slice_show: Show the slicing result

Description Usage Arguments Value See Also Examples

View source: R/slice_show.R

Description

Showing slicing result and plotting counts of observations in each slice.

Usage

1
  slice_show(slices_obj, main="Counts in each slice", xlab="Slices", ylab="Percentage")

Arguments

slices_obj

A matrix stores slicing strategy. It is a component of object returned by function dslice_k or dslice_eqp_k.

main

An overall title for the plo

xlab

A title for the x axis

ylab

A title for the y axis

Value

A “ggplot” object which illustrates details of slicing.

See Also

ds_k, ds_eqp_k.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n <- 100
mu <- 0.5
y <- c(rnorm(n, -mu, 1), rnorm(n, mu, 1))
x <- c(rep(0, n), rep(1, n))
x <- x[order(y)]
xdim <- max(x) + 1
lambda <- 1.0
dsres <- ds_k(x, xdim, lambda, slice = TRUE)

ds_show <- slice_show(dsres$slices)

dslice documentation built on May 2, 2019, 9:39 a.m.