import_data | R Documentation |
This function transforms wide format data where features are in separate columns into a long format suitable for sequence analysis. It creates windows of data based on row order and generates sequence order within these windows.
import_data(data, cols, id_cols, window_size = 1, replace_zeros = TRUE)
data |
A |
cols |
An |
id_cols |
A |
window_size |
An |
replace_zeros |
A |
A data.frame
in long format with added columns for window and
sequence order.
Basic functions
build_model()
,
hist.group_tna()
,
hist.tna()
,
plot.group_tna()
,
plot.tna()
,
plot_frequencies()
,
plot_frequencies.group_tna()
,
plot_mosaic()
,
plot_mosaic.group_tna()
,
plot_mosaic.tna_data()
,
prepare_data()
,
print.group_tna()
,
print.summary.group_tna()
,
print.summary.tna()
,
print.tna()
,
print.tna_data()
,
simulate.tna()
,
summary.group_tna()
,
summary.tna()
,
tna-package
data <- data.frame(
ID = c("A", "A", "B", "B"),
Time = c(1, 2, 1, 2),
feature1 = c(10, 0, 15, 20),
feature2 = c(5, 8, 0, 12),
feature3 = c(2, 4, 6, 8),
other_col = c("X", "Y", "Z", "W")
)
# Using a vector
long_data1 <- import_data(
data = data,
cols = c(feature1, feature2),
id_cols = c("ID", "Time"),
window_size = 2,
replace_zeros = TRUE
)
# Using a column range
long_data2 <- import_data(
data = data,
cols = feature1:feature3,
id_cols = c("ID", "Time"),
window_size = 2,
replace_zeros = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.