Is there a way to replace only the assessment split in an rset
object?
I tried the following:
library(rsample)
library(dplyr)
splits <- vfold_cv(mtcars)
assessment(splits$splits[[1]])
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
#> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3
#> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3
#> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
assessment(splits$splits[[1]]) <- assessment(splits$splits[[1]]) %>% slice(1)
#> Error in assessment(splits$splits[[1]]) <- assessment(splits$splits[[1]]) %>% : could not find function "assessment<-"
Created on 2020-02-14 by the reprex package (v0.3.0)
I know I can extract the assessment and analysis splits and then work with them, but I want to update the rset
object instead.