Learn R Programming

valueprhr (version 0.1.0)

prepare_log_matrices: Prepare Log-Transformed Matrices

Description

Extracts numeric columns from price data frames and applies log transform.

Usage

prepare_log_matrices(
  direct_prices,
  production_prices,
  exclude_cols = c("Year")
)

Value

A list containing:

X_log

Log-transformed matrix of direct prices

Y_log

Log-transformed matrix of production prices

complete_cases

Logical vector indicating complete cases

X_clean

Subset of X_log with complete cases

Y_clean

Subset of Y_log with complete cases

Arguments

direct_prices

Data frame with direct prices.

production_prices

Data frame with prices of production.

exclude_cols

Character vector of columns to exclude. Default c("Year").

Examples

Run this code
set.seed(123)
direct <- data.frame(
  Year = 2000:2005,
  A = runif(6, 100, 200),
  B = runif(6, 100, 200)
)
production <- data.frame(
  Year = 2000:2005,
  A = runif(6, 100, 200),
  B = runif(6, 100, 200)
)
matrices <- prepare_log_matrices(direct, production)
str(matrices)

Run the code above in your browser using DataLab