You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I ran into the same problem of needing to accesses previously initialized R objects as the user here posted in the groups page. Given that I needed to store an entire dataframe, however, the suggested answer (storing the result of the calculation) didn't seem as apt to my situation.
What somewhat works is to store the dataframe as a JSON file, via jsonlite::toJSON(dataframe) in a calculate label, and then continually read in the dataframe for each page, via jsonlite::fromJSON(json_df), then resave it for the next page. At best though, this is a bit hacky, and at worst, it doesn't meet all edge cases.
My guess is that the difficulties are due to each page in the survey creating a new R session? (although this is just my assumption, I couldn't find any description of how the backend R works in the documentation) Yet, if formr is able to store the result of the calculations to persist via survey_name$variable_name, I'm curious if my assumption is wrong, and maybe there is a better way? Thank you!
The text was updated successfully, but these errors were encountered:
Hi! I ran into the same problem of needing to accesses previously initialized R objects as the user here posted in the groups page. Given that I needed to store an entire dataframe, however, the suggested answer (storing the result of the calculation) didn't seem as apt to my situation.
What somewhat works is to store the dataframe as a JSON file, via
jsonlite::toJSON(dataframe)
in a calculate label, and then continually read in the dataframe for each page, viajsonlite::fromJSON(json_df)
, then resave it for the next page. At best though, this is a bit hacky, and at worst, it doesn't meet all edge cases.My guess is that the difficulties are due to each page in the survey creating a new R session? (although this is just my assumption, I couldn't find any description of how the backend R works in the documentation) Yet, if formr is able to store the result of the calculations to persist via
survey_name$variable_name
, I'm curious if my assumption is wrong, and maybe there is a better way? Thank you!The text was updated successfully, but these errors were encountered: