我正在尝试使用表数据制作对象
var cond = [
{
"locality": "Dwarka",
"Created ->OFP": "4.73",
"OFP -> Picked": "2.16",
"Picked - > Delivery": "14.91",
"Over_All_TAT": "22.65",
"Total_Order": "159"
},
{
"locality": "IIT & AIIMS",
"Created ->OFP": "2.56",
"OFP -> Picked": "9.74",
"Picked - > Delivery": "19.41",
"Over_All_TAT": "32.61",
"Total_Order": "54"
},
{
"locality": "Gk1 & Nehru Place",
"Created ->OFP": "2.39",
"OFP -> Picked": "6.87",
"Picked - > Delivery": "14.06",
"Over_All_TAT": "24.13",
"Total_Order": "31"
},
{
"locality": "Mayur Vihar",
"Created ->OFP": "3.52",
"OFP -> Picked": "1.24",
"Picked - > Delivery": "15.3",
"Over_All_TAT": "21.03",
"Total_Order": "33"
},
{
"locality": "Snapdeal_Mundhka",
"Created ->OFP": "17.32",
"OFP -> Picked": "4.65",
"Picked - > Delivery": "100.32",
"Over_All_TAT": "123.16",
"Total_Order": "31"
}
]
我知道键名不符合规则,但那些是列名。我可以使用索引(例如cond[0][1]
)访问第二列,例如 Created -> OFP。
我只能访问cond[i]
如何访问内部块元素。
当我使用 R 时,json 对象是使用 jsonlite 包创建的,所以,我有限制。