plot.hpiindex: Plot method for 'hpiindex' object

View source: R/plotFunctions.R

plot.hpiindexR Documentation

Plot method for 'hpiindex' object

Description

Specific plotting method for hpiindex objects

Usage

## S3 method for class 'hpiindex'
plot(x, show_imputed = FALSE, smooth = FALSE, ...)

Arguments

x

Object to plot of class 'hpiindex“

show_imputed

default = FALSE; highlight the imputed points

smooth

default = FALSE; plot the smoothed index

...

Additional Arguments

Value

'plotindex' object inheriting from a ggplot object

Examples


 # Load data
 data(ex_sales)

 # With a raw transaction data.frame
 rt_data <- rtCreateTrans(trans_df = ex_sales,
                          prop_id = 'pinx',
                          trans_id = 'sale_id',
                          price = 'sale_price',
                          periodicity = 'monthly',
                          date = 'sale_date')

 # Create model object
 hpi_model <- hpiModel(model_type = 'rt',
                       hpi_df = rt_data,
                       estimator = 'base',
                       log_dep = TRUE)

 # Create Index
 hpi_index <- modelToIndex(hpi_model,
                           max_period = 84)

 # Make Plot
 plot(hpi_index)


andykrause/hpiR documentation built on Feb. 2, 2024, 8:13 p.m.