I have a data.frame(read in from jsonlite::fromJSON) which contains some list of data.frame, for example:
# > str(dat)
# 'data.frame': 2 obs. of 3 variables:
# $ id : int 1 2
# $ name : chr "Julie" "Justin"
# $ score :List of 2
# ..$ : NULL
# ..$ :'data.frame': 5 obs. of 2 variables:
# .. ..$ rid : int 1 2 3 4 5
# .. ..$ math : int 5 17 19 12 16
I want to convert the data into the following form:
# id name score.rid score.math
# 1 Julie NA NA
# 2 Justin 1 5
# 2 Justin 2 17
# 2 Justin 3 19
# 2 Justin 4 12
# 2 Justin 5 16