get_juiced_data: Get the Juiced Data

View source: R/get-juiced-data.R

get_juiced_dataR Documentation

Get the Juiced Data

Description

This is a simple function that will get the juiced data from a recipe.

Usage

get_juiced_data(.recipe_object)

Arguments

.recipe_object

The recipe object you want to pass.

Details

Instead of typing out something like: recipe_object %>% prep() %>% juice() %>% glimpse()

Value

A tibble of the prepped and juiced data from the given recipe

Author(s)

Steven P. Sanderson II, MPH

See Also

Other Data Wrangling: pca_your_recipe()

Examples

suppressPackageStartupMessages(library(timetk))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(purrr))
suppressPackageStartupMessages(library(healthyR.data))
suppressPackageStartupMessages(library(rsample))
suppressPackageStartupMessages(library(recipes))

data_tbl <- healthyR_data %>%
  select(visit_end_date_time) %>%
  summarise_by_time(
    .date_var = visit_end_date_time,
    .by       = "month",
    value     = n()
  ) %>%
  set_names("date_col", "value") %>%
  filter_by_time(
    .date_var = date_col,
    .start_date = "2013",
    .end_date = "2020"
  )

splits <- initial_split(data = data_tbl, prop = 0.8)

rec_obj <- recipe(value ~ ., training(splits))

get_juiced_data(rec_obj)


healthyR.ai documentation built on April 3, 2023, 5:24 p.m.