Learn R Programming

LIHNPSD (version 0.2.1)

MergeTailHistogram: Utility function to merge tails in the histogram

Description

Utility function to merge data points in the tails of the histogram.

Usage

MergeTailHistogram(q, merge_tails)

Arguments

q
In the form of list( qhx = h$mids, qhy = h$counts ) where h is a histogram
merge_tails
Number of data points to merge on each side, in the form of c(left, right)

Value

Modified q after the merge

Examples

Run this code
  # Load the daily log-return data of DJIA 
  data(dji_logr)
  h <- hist(dji_logr, breaks = 60, plot = FALSE)
  # Merge two data points from the left tail, and one data points from the right tail
  q2 <- MergeTailHistogram( list(qhx=h$mids, qhy=h$counts), c(2,1) )

Run the code above in your browser using DataLab