I have a data file in JSON format. The following is a sample:
{"ts":"2018-01-04T02:19:05.144-06:00","ct":"{\"Antenna\":3,\"OlioId\":1,\"TagId\":\"30742C40A426936D4B681B3E\",\"TimeStamp\":\"2018-01-04T02:19:05.144-06:00\"}"}
{"ts":"2018-01-04T02:19:05.167-06:00","ct":"{\"Antenna\":3,\"OlioId\":1,\"TagId\":\"307405B6E8538FED4B68F19F\",\"TimeStamp\":\"2018-01-04T02:19:05.167-06:00\"}"}
{"ts":"2018-01-04T02:19:05.214-06:00","ct":"{\"Antenna\":4,\"OlioId\":1,\"TagId\":\"30742C40A426936D4B691D5D\",\"TimeStamp\":\"2018-01-04T02:19:05.214-06:00\"}"}
{"ts":"2018-01-04T02:19:05.448-06:00","ct":"{\"Antenna\":6,\"OlioId\":1,\"TagId\":\"30742C40A42692ED4B67CD2E\",\"TimeStamp\":\"2018-01-04T02:19:05.448-06:00\"}"}
Using the rjson
library I tried creating a dataframe but I can't get it to work out. I'm ending up with a list of two items ts
and ct
.
What I'd like to do is create a dataframe of the ct
item with variable names Antenna
, OlioId
, TagID
, and TimeStamp
.
Can anyone give me their recommendations on how to do this?