print.segmentr: Print a segmentr object

Description Usage Arguments Details Examples

View source: R/print_segmentr.R

Description

Prints a short description of the segments found in the segmentr object

Usage

1
2
## S3 method for class 'segmentr'
print(x, ...)

Arguments

x

an object of type segmentr, containing change point information

...

further arguments to be passed down to other methods

Details

A short representation of the segments is printed on the screen, using the start:end range notation.

Examples

1
2
3
4
5
make_segment <- function(n, p) matrix(rbinom(100 * n, 1, p), nrow = 100)
data <- cbind(make_segment(5, 0.1), make_segment(10, 0.9), make_segment(2, 0.1))
mean_lik <- function(X) abs(mean(X) - 0.5) * ncol(X)^2
x <- segment(data, likelihood = mean_lik, algorithm = "hieralg")
print(x)

segmentr documentation built on Aug. 29, 2019, 1:03 a.m.