I have an observeEvent where i do some preprocessing to my reactive data:
observeEvent(input$preprocess_btn,{
req(input$imputation_numeric, input$imputation_categorical)
object_recipe <- recipe(as.formula(paste(input$variables, "~ .")), train_data())
**
preprocessing steps here
**
trained_recipe <- prep(object_recipe, training = train_data())
print(trained_recipe) #This shows the desired output, but on console
train_data_prep(bake(trained_recipe, new_data = train_data()))
test_data_prep(bake(trained_recipe, new_data = test_data()))
})
The desired output as displayed on the code fragment would be:
── Recipe ────────────
── Inputs Number of variables by role outcome: 1 predictor: 7
── Training information Training data contained 713 data points and 148 incomplete rows.
── Operations • Bagged tree imputation for: Age, SibSp, Parch, Fare | Trained • Mode imputation for: Pclass, Sex, Embarked | Trained • Sparse, unbalanced variable filter removed: | Trained • Centering for: Age, SibSp, Parch, Fare | Trained • Scaling for: Age, SibSp, Parch, Fare | Trained • Dummy variables from: Pclass, Sex, Embarked | Trained
Thing is I don't know how to pass it to a renderPrint because the variables can only be called inside the observeEvent, and tried storing It inside a reactiveVal but couldn't find success
Store the output of the
observeEvent()in areactiveValues()then print that. You would need a UI element too of course.