I converted a excel file to a JSON object in R using jsonlite package.I want the whole array as a value to a key and add other some more key value pairs to that object.
The JSON array I got after converting the excel file looks like this -
[{
"Sno": xxx,
"Token": xxx,
"Name": "xxx",
"Location": "xxxx",
"COE": "xxx",
"Grade": "xxx",
}, {
"Sno": xxx,
"Token": xxx,
"Name": "xxxx",
"Location": "xxxx",
"COE": "xxxx",
"Grade": "xxx",
}, {
and so on..
The output i require is -:
{
"key1": "value1",
"key2": "value2",
"key3": "value3",
"key4": [{
"Sno": xxx,
"Token": xxx,
"Name": "xxx",
"Location": "xxxx",
"COE": "xxx",
"Grade": "xxx",
}, {
"Sno": xxx,
"Token": xxx,
"Name": "xxxx",
"Location": "xxxx",
"COE": "xxxx",
"Grade": "xxx",
}, {
Please suggest how to do it or atleast point me in the right direction.