0
リーフレットと組み合わせて、Rの配列のオブジェクトの緯度と経度を呼び出そうとしています。配列(R、リーフレット、json)のネストされたオブジェクトを繰り返します。
dMVStations <- fromJSON(file = "stations.json")
# "stations.json" is an array of 88 objects with 36 attributes each.
# two of those attributes are latitude and longitude.
...
# setting up the leaflet map
...
leafletProxy("map", data = dMVStations) %>%
addCircles(
lng =~ dMVStations$[[1]...[88]]$longitude,
lat =~ dMVStations$[[1]...[88]]$latitude,
...
)
dMVStations内の各オブジェクトの緯度と経度をどのように指していますか?
STR(dMVStations)を返します。
name: dMVStations
type: list[88]
value: 'List of length 88'
これら88個の各オブジェクトあなたがstr
dMVStationsから見ることができるように
named by the index [[1]...[88]]
has type: list[36]
has value: 'List of length 36'
おかげで、歓声、
、あなたの質問に編集できる場所のためにそれらにアクセスするには私はあなたがこのような構文を使用します 'str(dMVStations)'の結果を含めてください – Phil
良いアイデア、完了! Philに感謝します。 –