Learn R Programming

dbnR (version 0.7.5)

as_named_vector: Converts a single row data.table into a named vector

Description

Given a single row data.table, convert it into a named vector. Used in the mvn_inference, to obtain an evidence named vector. For this case, the data.table should contain only the evidence that we want to provide. If a named vector is provided instead of a data.table, nothing will be done and the named vector will be returned.

Usage

as_named_vector(dt)

Arguments

dt

a 1 row data.table or a named vector

Value

a vector with the values and the variable names