I am trying to understand how hot_to_r()
convert the list object obtained with rhandsontable()
. My goal is to see the object that you get after hot_to_r()
processes in order to debug a shiny app.
However, it seems that you can not do this outside the shiny app i.e inside a .R script.
[EDIT] searching further leads me to this post.
Are we sure that the object that you get from fromJSON()
is the same as the one from hot_to_r()
Here is a .R script I was trying to use to see the output of hot_to_r()
:
library(rhandsontable)
library(tidyverse)
library(jsonlite)
# dummy dataframe
df = data.frame(id = c("a", "b"),
val = c(0.75, 0.25))
# convert it to a "rhansontable" object
test = rhandsontable(df)
# try to convert it back to a dataframe but it doesn't work
test_hot = hot_to_r(test)
# however, this works but I am not sure if test_json is the same as test_hot
test_json = fromJSON(test$x$data)
test_hot = hot_to_r(test)
leads to this error:
test_df = hot_to_r(test)
Error in (function (data, changes, params, ...) : argument "params" is missing, with no default
I am very new to shiny ; am I missing something?
Is it normal that you can not get hot_to_r()
work inside a .R script?
If yes, how do you check the "aspect" of your data inside the shiny app? The overall goal is to make calculations with a rhandsontable filled by users. I want to transform this object into a dataframe in order to make the correct modifications to get a "tidy" dataset.