JSON でグループ化したいデータセットがあります。
address city.x state.x latitude.x longitude.x
1 5601 W. Slauson Ave. #200 Culver City CA 33.99718 -118.40145
2 PO 163005 Austin TX 30.31622 -97.85877
3 10215 W. Jamesburg Street Wichita KS 37.70063 -97.43430
4 14556 Newport Ave Tustin CA 33.74165 -117.82127
5 2496 Falcon Crescent Virginia Beach VA 36.83840 -76.02862
6 1306 Wilshire Boulevard Santa Monica CA 34.03216 -118.49022
住所と緯度/経度をグループ化し、すべて会社のカテゴリに入れたいと思います。
次のようにしたいと思います。
{company: {address: {address: "5601 W. Slauson Ave. #200" ,
city.x: "Culver City" ,
state.x: "CA"}},
{geo: {latitude: "33.99718",
longitude: "-118.40145"}}},
{company: {address: {address: "PO 163005" ,
city.x: "Austin" ,
state.x: "TX"}},
{geo: {latitude: "30.31622",
longitude: "-97.85877"}}},
structure(list(address = c("5601 W. Slauson Ave. #200", "PO 163005",
"10215 W. Jamesburg Street", "14556 Newport Ave", "2496 Falcon Crescent",
"1306 Wilshire Boulevard"), city.x = c("Culver City", "Austin",
"Wichita", "Tustin", "Virginia Beach", "Santa Monica"), state.x = c("CA",
"TX", "KS", "CA", "VA", "CA"), latitude.x = c(33.997179, 30.316223,
37.700632, 33.741651, 36.838398, 34.032159), longitude.x = c(-118.40145,
-97.85877, -97.4343, -117.82127, -76.02862, -118.49022)), .Names = c("address",
"city.x", "state.x", "latitude.x", "longitude.x"), class = "data.frame", row.names = c(NA,
6L))
どんな助けでも大歓迎です!