Import One-Hot Data and Create a Co-Occurrence Network Model
Arguments
- data
A
data.frame
in wide format.- cols
An
expression
giving a tidy selection of column names to be transformed into long format (actions). This can be a vector of column names (e.g.,c(feature1, feature2)
) or a range specified asfeature1:feature6
(without quotes) to include all columns from 'feature1' to 'feature6' in the order they appear in the data frame. For more information on tidy selections, seedplyr::select()
.- window
An
integer
specifying the size of the window for sequence grouping. Default is 1 (each row is a separate window). Can also be acharacter
string giving a name of the column indata
whose levels define the windows.
See also
Other data:
import_data()
,
prepare_data()
,
print.tna_data()
,
simulate.tna()
Examples
d <- data.frame(
window = gl(100, 5),
feature1 = rbinom(500, 1, prob = 0.33),
feature2 = rbinom(500, 1, prob = 0.25),
feature3 = rbinom(500, 1, prob = 0.50)
)
model <- import_onehot(d, feature1:feature3, window = "window")