-
Hi friends. I know that jspsych provides options to either save data in json format or csv format, however, for various reasons the software I'm using jspsych on can only support saving data as a json file. Does anyone have any preprocessing scripts (ideally in r), that can parse the json formatted data into csv? If you could share them with me it would be a huge help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @HuangHam I've had success using the {jsonlite} package to read json files into an R data frame. Then you can use R's built in library(jsonlite)
df <- fromJSON('path/to/file.json')
write.csv(df, 'path/to/file.csv') |
Beta Was this translation helpful? Give feedback.
Hi @HuangHam
I've had success using the {jsonlite} package to read json files into an R data frame. Then you can use R's built in
write.csv
or {readr}'swrite_csv
to export the file to csv format.