From 46dae1bc376fb191600abfa2638407091e204724 Mon Sep 17 00:00:00 2001 From: Julia Silge Date: Fri, 19 Feb 2021 11:05:45 -0700 Subject: [PATCH 1/2] Create apparent() via new_rset() --- NEWS.md | 2 ++ R/apparent.R | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 56ae3aa2..5e568256 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # rsample (development version) +* Fixed problem with creation of `apparent()` samples. + # rsample 0.0.9 * New `rset_reconstruct()`, a developer tool to ease creation of new rset subclasses (#210). diff --git a/R/apparent.R b/R/apparent.R index 192a5178..49db121e 100644 --- a/R/apparent.R +++ b/R/apparent.R @@ -22,11 +22,10 @@ apparent <- function(data, ...) { class(splits) <- c("rsplit", "apparent_split") split_objs <- tibble::tibble(splits = list(splits), id = "Apparent") - split_objs <- - add_class(split_objs, - cls = c("apparent", "rset")) - - split_objs + new_rset(splits = split_objs$splits, + ids = split_objs$id, + attrib = NULL, + subclass = c("apparent", "rset")) } #' @export From c302dfb6706a1d5ca077508b73d275e3072f0917 Mon Sep 17 00:00:00 2001 From: Julia Silge Date: Fri, 19 Feb 2021 11:07:50 -0700 Subject: [PATCH 2/2] Update NEWS --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 5e568256..589e033f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # rsample (development version) -* Fixed problem with creation of `apparent()` samples. +* Fixed problem with creation of `apparent()` samples (#223). # rsample 0.0.9