Counter operation to @seealso mmb::sampleToBayesFeatures(). Takes a Bayes-feature data.frame and transforms it back to a row.

bayesFeaturesToSample(dfOrg, features)

Arguments

dfOrg

data.frame containing at least one row of the original format, so that we can rebuild the sample matching exactly the original column names.

features

data.frame of Bayes-features, as for example previously created using mmb::sampleToBayesFeatures().

Value

data.frame the sample as 1-row data.frame.

Examples

samp <- mmb::sampleToBayesFeatures(dfRow = iris[15,], targetCol = "Species") # Convert the sample (as features) back to a sample that can be, e.g., # appended to the data again: row <- mmb::bayesFeaturesToSample(dfOrg = iris, features = samp)