x_mat <- as.matrix(pbc_orsf[, c('bili', 'age', 'protime')])
head(x_mat)
x_scaled <- orsf_scale_cph(x_mat)
head(x_scaled)
attributes(x_scaled) # note the transforms attribute
x_unscaled <- orsf_unscale_cph(x_scaled)
head(x_unscaled)
# numeric difference in x_mat and x_unscaled should be practically 0
max(abs(x_mat - x_unscaled))
Run the code above in your browser using DataLab