Learn R Programming

mmb (version 0.13.3)

bayesFeaturesToSample: Transform a collection of Bayesian features back to a sample.

Description

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

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab