Extract the mapping between IXGDF and BIN of a VPC plot

Extract the mapping between IXGDF and BIN of a VPC plot

extractBins_VPCplot(plotVPC)

Arguments

plotVPC

output object of plotVPC_IQRdataVPC.

Value

data.frame with columns IXGDF and BIN

Author

Miriam Stuke (miriam.stuke@intiquan.com)

Examples

if (FALSE) { # \dontrun{

# Example of how the binoutput_helper function can be used to manually alter bins:

# 7.0 Load and subset data
dataVPC <- readRDS(system.file("examples/VPC/Output/Webinar/vpcdata_00_FinalPKmodel_modified.rds", package = "IQRtools"))
dataVPC <- filterMutateDataVPC(dataVPC, TIME < 450)

# 7.1 Calculate bins automatically: Run plotVPC to invoke the binning algorithm
pl <- plotVPC_IQRdataVPC(dataVPC, FLAGplotBins = TRUE)

# 7.2 Collect the resulting BIN column and add it to the VPC data
bins <- extractBins_VPCplot(pl)
dataVPC$obs <- merge(dataVPC$obs, bins, by = "IXGDF", all.x = TRUE)

# 7.3 Apply the manual fix: We want to merge bins 6 and 7. We do this by simply assigning BIN = 6 when BIN is 7.
dataVPC$obs$BIN <- case_when(dataVPC$obs$BIN == 7 ~ 6,
                             TRUE                 ~ dataVPC$obs$BIN)

# 7.4 Plot, but now use BIN.column instead of the automatic binning algorithm
pl <- plotVPC_IQRdataVPC(dataVPC, FLAGplotBins = TRUE, BIN.column = "BIN")

} # }