I have a data with a column as json string:
reservation reasons
1592 [{"name"=>"jorge", "value"=>"MX"}, {"name"=>"Billing phone number", "value"=>"1123"}, {"name"=>"BillingCountry", "value"=>"USA"}]
1597 [{"name"=>"BillingAddress_Country", "value"=>"IN"}, {"name"=>"Billing phone number country code", "value"=>"IN"}, {"name"=>"Latest amount", "value"=>"583000000"}]
I want to parse the column as follows:
reservation name value
1592 jorge mx
1592 Billing phone number 1123
1592 BillingCountry USA
1597 BillingAddress_Country IN
1597 Billing phone number country code IN
1597 Latest amount 583000000
I am us ing jsonlite in R. I am getting following error in my code:
data<-read.csv("data.csv")
json<-data$reasons
mydf <- fromJSON(json)
Error: Argument 'txt' must be a JSON string, URL or file.
Can anyone tell me where am I making mistakes? What modifications do I need to do? Many thanks in advance!