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))
heterogeneity_cost <- function(X) sum((X - mean(X))^2) + 1
x <- segment(data, cost = heterogeneity_cost, algorithm = "hieralg")
print(x)

thalesmello/segmentr documentation built on March 4, 2020, 1 a.m.