Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

combining lists inside a function returns zero results when using lapply and map

$
0
0

I have some data which looks like the following:

# A tibble: 41 x 5
   time       ID         Value  var1  out2
   <date>     <chr>      <dbl> <dbl> <dbl>
 1 2016-12-01 CAT1   0             0     0
 2 2016-12-02 CAT1   0.00345       1     0
 3 2016-12-05 CAT1   0.0160        1     1
 4 2016-12-06 CAT1  -0.00447       0     1

I can access this data using;

map(cv_rolling$inner_resamples$`1`$splits, ~ analysis(.x))

map(cv_rolling$inner_resamples$`2`$splits, ~ analysis(.x))

However I am having trouble when I wrap these into a function. I cannot seem to "access" the $1$ or "$2$" part. What I am trying to do is use bind_cols to combine two lists.

Code:

library(rsample)
some_vector <- c("CAT1", "CAT2")

bind_function <- function(input){
  bind_me = bind_cols(
    map(cv_rolling$inner_resamples$input$splits, ~ assessment(.x)) %>%
      bind_rows(),
    map(cv_rolling$inner_resamples$input$splits, ~ analysis(.x)) %>%
      bind_rows()
  )
  return(bind_me)
}

out <- lapply(some_vector, bind_function)

Which creates a list of empty results.

Data:

structure(list(splits = list(`1` = structure(list(data = structure(list(
    time = structure(c(17136, 17137, 17140, 17141, 17142, 17143, 
    17144, 17147, 17148, 17149, 17150, 17151, 17154, 17155, 17156, 
    17157, 17158, 17162, 17163, 17164, 17165, 17137, 17140, 17141, 
    17142, 17143, 17144, 17147, 17148, 17149, 17150, 17151, 17154, 
    17155, 17156, 17157, 17158, 17162, 17163, 17164, 17165), class = "Date"), 
    ID = c("CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795, 
    0.000844498434983576, 0.0163715155887711, -0.00448365366405012, 
    0.0236864382387592, -0.0058661923026857, 0.0157352972234206, 
    0.00322725497183018, 0.0130287099246646, -0.00476327598886361, 
    -0.00159542491592102, -0.00447440889621653, 0.021187832686216, 
    -0.00125732977379223, 0, 0.000157293726832375, -0.0048779372015425, 
    0.000632242753807466, -0.00458255501211047, -0.00142875570611845, 
    -0.0120827957988262), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 
    1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0), out2 = c(0, 0, 1, 
    1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 
    1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1)), class = c("tbl_df", 
"tbl", "data.frame"), row.names = c(NA, -41L)), in_id = 1:21, 
    out_id = NA, id = structure(list(id = "Resample1"), row.names = c(NA, 
    -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
"group_vfold_split")), `2` = structure(list(data = structure(list(
    time = structure(c(17136, 17137, 17140, 17141, 17142, 17143, 
    17144, 17147, 17148, 17149, 17150, 17151, 17154, 17155, 17156, 
    17157, 17158, 17162, 17163, 17164, 17165, 17137, 17140, 17141, 
    17142, 17143, 17144, 17147, 17148, 17149, 17150, 17151, 17154, 
    17155, 17156, 17157, 17158, 17162, 17163, 17164, 17165), class = "Date"), 
    ID = c("CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795, 
    0.000844498434983576, 0.0163715155887711, -0.00448365366405012, 
    0.0236864382387592, -0.0058661923026857, 0.0157352972234206, 
    0.00322725497183018, 0.0130287099246646, -0.00476327598886361, 
    -0.00159542491592102, -0.00447440889621653, 0.021187832686216, 
    -0.00125732977379223, 0, 0.000157293726832375, -0.0048779372015425, 
    0.000632242753807466, -0.00458255501211047, -0.00142875570611845, 
    -0.0120827957988262), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 
    1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0), out2 = c(0, 0, 1, 
    1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 
    1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1)), class = c("tbl_df", 
"tbl", "data.frame"), row.names = c(NA, -41L)), in_id = 22:41, 
    out_id = NA, id = structure(list(id = "Resample2"), row.names = c(NA, 
    -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
"group_vfold_split"))), id = c("Resample1", "Resample2"), inner_resamples = list(
    `1` = structure(list(splits = list(structure(list(data = structure(list(
        time = structure(c(17136, 17137, 17140, 17141, 17142, 
        17143, 17144, 17147, 17148, 17149, 17150, 17151, 17154, 
        17155, 17156, 17157, 17158, 17162, 17163, 17164, 17165
        ), class = "Date"), ID = c("CAT1", "CAT1", "CAT1", "CAT1", 
        "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
        "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
        "CAT1", "CAT1", "CAT1"), Value = c(0, 0.00344958960669994, 
        0.0160160159893405, -0.00447205963195563, 0.0159133949476373, 
        0.00678170228664343, 0.0165760738798502, -0.0000252860172512692, 
        0.00865350998635406, 0.00121847887105075, 0.000978545163097477, 
        -0.00883623264030775, 0.00429947401567232, 0.00279522911918573, 
        -0.00233543235943645, -0.00415322695366804, -0.00170618631415476, 
        0.00207620495506755, -0.00821173659091756, -0.00287881031086645, 
        -0.0140139389980795), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 
        1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0), out2 = c(0, 0, 
        1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 
        0)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, 
    -21L)), in_id = 1:15, out_id = 16L, id = structure(list(id = "Slice1"), row.names = c(NA, 
    -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17136, 
    17137, 17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 
    17150, 17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 
    17164, 17165), class = "Date"), ID = c("CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795
    ), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 
    0, 0, 1, 0, 0, 0), out2 = c(0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0)), class = c("tbl_df", "tbl", 
    "data.frame"), row.names = c(NA, -21L)), in_id = 2:16, out_id = 17L, 
        id = structure(list(id = "Slice2"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17136, 
    17137, 17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 
    17150, 17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 
    17164, 17165), class = "Date"), ID = c("CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795
    ), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 
    0, 0, 1, 0, 0, 0), out2 = c(0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0)), class = c("tbl_df", "tbl", 
    "data.frame"), row.names = c(NA, -21L)), in_id = 3:17, out_id = 18L, 
        id = structure(list(id = "Slice3"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17136, 
    17137, 17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 
    17150, 17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 
    17164, 17165), class = "Date"), ID = c("CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795
    ), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 
    0, 0, 1, 0, 0, 0), out2 = c(0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0)), class = c("tbl_df", "tbl", 
    "data.frame"), row.names = c(NA, -21L)), in_id = 4:18, out_id = 19L, 
        id = structure(list(id = "Slice4"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17136, 
    17137, 17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 
    17150, 17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 
    17164, 17165), class = "Date"), ID = c("CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795
    ), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 
    0, 0, 1, 0, 0, 0), out2 = c(0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0)), class = c("tbl_df", "tbl", 
    "data.frame"), row.names = c(NA, -21L)), in_id = 5:19, out_id = 20L, 
        id = structure(list(id = "Slice5"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17136, 
    17137, 17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 
    17150, 17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 
    17164, 17165), class = "Date"), ID = c("CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", "CAT1", 
    "CAT1", "CAT1"), Value = c(0, 0.00344958960669994, 0.0160160159893405, 
    -0.00447205963195563, 0.0159133949476373, 0.00678170228664343, 
    0.0165760738798502, -0.0000252860172512692, 0.00865350998635406, 
    0.00121847887105075, 0.000978545163097477, -0.00883623264030775, 
    0.00429947401567232, 0.00279522911918573, -0.00233543235943645, 
    -0.00415322695366804, -0.00170618631415476, 0.00207620495506755, 
    -0.00821173659091756, -0.00287881031086645, -0.0140139389980795
    ), var1 = c(0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 
    0, 0, 1, 0, 0, 0), out2 = c(0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
    0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0)), class = c("tbl_df", "tbl", 
    "data.frame"), row.names = c(NA, -21L)), in_id = 6:20, out_id = 21L, 
        id = structure(list(id = "Slice6"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split"))), id = c("Slice1", "Slice2", "Slice3", "Slice4", 
    "Slice5", "Slice6")), row.names = c(NA, -6L), class = c("rolling_origin", 
    "rset", "tbl_df", "tbl", "data.frame"), initial = 15, assess = 1, cumulative = FALSE, skip = 0), 
    `2` = structure(list(splits = list(structure(list(data = structure(list(
        time = structure(c(17137, 17140, 17141, 17142, 17143, 
        17144, 17147, 17148, 17149, 17150, 17151, 17154, 17155, 
        17156, 17157, 17158, 17162, 17163, 17164, 17165), class = "Date"), 
        ID = c("CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
        "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
        "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2"
        ), Value = c(0.000844498434983576, 0.0163715155887711, 
        -0.00448365366405012, 0.0236864382387592, -0.0058661923026857, 
        0.0157352972234206, 0.00322725497183018, 0.0130287099246646, 
        -0.00476327598886361, -0.00159542491592102, -0.00447440889621653, 
        0.021187832686216, -0.00125732977379223, 0, 0.000157293726832375, 
        -0.0048779372015425, 0.000632242753807466, -0.00458255501211047, 
        -0.00142875570611845, -0.0120827957988262), var1 = c(1, 
        1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 
        0), out2 = c(0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 
        1, 0, 0, 1, 0, 1)), class = c("tbl_df", "tbl", "data.frame"
    ), row.names = c(NA, -20L)), in_id = 1:15, out_id = 16L, 
        id = structure(list(id = "Slice1"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17137, 
    17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 17150, 
    17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 17164, 
    17165), class = "Date"), ID = c("CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2"
    ), Value = c(0.000844498434983576, 0.0163715155887711, -0.00448365366405012, 
    0.0236864382387592, -0.0058661923026857, 0.0157352972234206, 
    0.00322725497183018, 0.0130287099246646, -0.00476327598886361, 
    -0.00159542491592102, -0.00447440889621653, 0.021187832686216, 
    -0.00125732977379223, 0, 0.000157293726832375, -0.0048779372015425, 
    0.000632242753807466, -0.00458255501211047, -0.00142875570611845, 
    -0.0120827957988262), var1 = c(1, 1, 0, 1, 0, 1, 1, 1, 0, 
    0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0), out2 = c(0, 1, 1, 0, 1, 
    0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1)), class = c("tbl_df", 
    "tbl", "data.frame"), row.names = c(NA, -20L)), in_id = 2:16, 
        out_id = 17L, id = structure(list(id = "Slice2"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17137, 
    17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 17150, 
    17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 17164, 
    17165), class = "Date"), ID = c("CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2"
    ), Value = c(0.000844498434983576, 0.0163715155887711, -0.00448365366405012, 
    0.0236864382387592, -0.0058661923026857, 0.0157352972234206, 
    0.00322725497183018, 0.0130287099246646, -0.00476327598886361, 
    -0.00159542491592102, -0.00447440889621653, 0.021187832686216, 
    -0.00125732977379223, 0, 0.000157293726832375, -0.0048779372015425, 
    0.000632242753807466, -0.00458255501211047, -0.00142875570611845, 
    -0.0120827957988262), var1 = c(1, 1, 0, 1, 0, 1, 1, 1, 0, 
    0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0), out2 = c(0, 1, 1, 0, 1, 
    0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1)), class = c("tbl_df", 
    "tbl", "data.frame"), row.names = c(NA, -20L)), in_id = 3:17, 
        out_id = 18L, id = structure(list(id = "Slice3"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17137, 
    17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 17150, 
    17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 17164, 
    17165), class = "Date"), ID = c("CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2"
    ), Value = c(0.000844498434983576, 0.0163715155887711, -0.00448365366405012, 
    0.0236864382387592, -0.0058661923026857, 0.0157352972234206, 
    0.00322725497183018, 0.0130287099246646, -0.00476327598886361, 
    -0.00159542491592102, -0.00447440889621653, 0.021187832686216, 
    -0.00125732977379223, 0, 0.000157293726832375, -0.0048779372015425, 
    0.000632242753807466, -0.00458255501211047, -0.00142875570611845, 
    -0.0120827957988262), var1 = c(1, 1, 0, 1, 0, 1, 1, 1, 0, 
    0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0), out2 = c(0, 1, 1, 0, 1, 
    0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1)), class = c("tbl_df", 
    "tbl", "data.frame"), row.names = c(NA, -20L)), in_id = 4:18, 
        out_id = 19L, id = structure(list(id = "Slice4"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split")), structure(list(data = structure(list(time = structure(c(17137, 
    17140, 17141, 17142, 17143, 17144, 17147, 17148, 17149, 17150, 
    17151, 17154, 17155, 17156, 17157, 17158, 17162, 17163, 17164, 
    17165), class = "Date"), ID = c("CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", 
    "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2", "CAT2"
    ), Value = c(0.000844498434983576, 0.0163715155887711, -0.00448365366405012, 
    0.0236864382387592, -0.0058661923026857, 0.0157352972234206, 
    0.00322725497183018, 0.0130287099246646, -0.00476327598886361, 
    -0.00159542491592102, -0.00447440889621653, 0.021187832686216, 
    -0.00125732977379223, 0, 0.000157293726832375, -0.0048779372015425, 
    0.000632242753807466, -0.00458255501211047, -0.00142875570611845, 
    -0.0120827957988262), var1 = c(1, 1, 0, 1, 0, 1, 1, 1, 0, 
    0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0), out2 = c(0, 1, 1, 0, 1, 
    0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1)), class = c("tbl_df", 
    "tbl", "data.frame"), row.names = c(NA, -20L)), in_id = 5:19, 
        out_id = 20L, id = structure(list(id = "Slice5"), row.names = c(NA, 
        -1L), class = c("tbl_df", "tbl", "data.frame"))), class = c("rsplit", 
    "rof_split"))), id = c("Slice1", "Slice2", "Slice3", "Slice4", 
    "Slice5")), row.names = c(NA, -5L), class = c("rolling_origin", 
    "rset", "tbl_df", "tbl", "data.frame"), initial = 15, assess = 1, cumulative = FALSE, skip = 0))), row.names = c(NA, 
-2L), class = c("nested_cv", "group_vfold_cv", "rset", "tbl_df", 
"tbl", "data.frame"), group = c(ID = "ID"), outside = group_vfold_cv(group = "ID"), inside = rolling_origin(initial = period_analysis, 
    assess = period_assessment, cumulative = FALSE, skip = skip_span))

Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>