Closed mhtess closed 8 years ago
If you have a data frame df that might look like
df
You could convert it into a list of js objects e.g.
[ { participant: 0, condition: "A", response: 0.4 }, { participant: 0, condition: "B", response: 0.8 }, { participant: 1, condition: "A", response: 0.2 }, ... ]
And use jsonlite to serialize it. You could prepend the webppl model with something like "var data = " + jsonlite::toJSON(df)
jsonlite
"var data = " + jsonlite::toJSON(df)
If you have a data frame
df
that might look likeYou could convert it into a list of js objects e.g.
And use
jsonlite
to serialize it. You could prepend the webppl model with something like"var data = " + jsonlite::toJSON(df)