dts <- function (df = ds, x = "Train_Index", df_train = ds1, df_test = ds2) {
#-- Dataframe
df <- as.data.frame(df)
#-- Train and Test
train <- df[df[, x] == 1, ]
test <- df[df[, x] == 0, ]
#-- Assign
assign(deparse(substitute(df_train)), train, envir = .GlobalEnv)
assign(deparse(substitute(df_test)), test, envir = .GlobalEnv)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.