[問題] ployly動圖問題
[問題類型]:
程式諮詢
[軟體熟悉度]:
使用者(已經有用R 做過不少作品)
[問題敘述]:
已經有一份經緯度的資料並在地圖上表示,我想讓動圖每過一個frame,就將兩點連在一起
http://i.imgur.com/pVTkxwv.jpg

下面是我的程式
plot_ly(
data = d,
type = 'scattermapbox',
mode = "markers+lines",
lon = ~longitude,
lat = ~latitude,
frame = ~frame,#month
text= ~text,
line = list(simplyfy = F),
marker = list(size = 7,color = "red"))%>%
layout(
mapbox = list(
style = "open-street-map",
center = list(lon = median(d$longitude), lat= median(d$latitude)),
zoom = 2.5),
margin =list(l=0,t=0,b=0,r=0))
[環境敘述]:
http://i.imgur.com/Q0rqWpC.jpg

另外想問,由於我的時間格式長這樣
http://i.imgur.com/0xGWil3.jpg

目前設定frame是從1,2,3...到最後一筆
如果指定frame為datatime這個變數會有問題(因為該變數格式是字串)
所以目前是將datatime切割成以日為單位,有辦法讓他變成根據datatime的時間軸跑嗎?謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.143.8.110 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1584804751.A.D9F.html
→
03/21 23:34,
5年前
, 1F
03/21 23:34, 1F
→
03/21 23:34,
5年前
, 2F
03/21 23:34, 2F
推
03/22 00:44,
5年前
, 3F
03/22 00:44, 3F
→
03/22 00:44,
5年前
, 4F
03/22 00:44, 4F
測試檔案
https://drive.google.com/file/d/1SczOXS9KrJ4o14L6L9rT-ZhmR5y8N87w/view?usp=sharing
如果出現亂碼或開不起來再跟我說
※ 編輯: xiangying (220.143.8.110 臺灣), 03/22/2020 02:03:03
→
03/22 02:04,
5年前
, 5F
03/22 02:04, 5F
推
03/22 09:02,
5年前
, 6F
03/22 09:02, 6F
推
03/24 08:29,
5年前
, 7F
03/24 08:29, 7F
推
03/24 08:30,
5年前
, 8F
03/24 08:30, 8F
推
03/24 08:36,
5年前
, 9F
03/24 08:36, 9F
→
03/24 08:36,
5年前
, 10F
03/24 08:36, 10F
→
03/24 11:16,
5年前
, 11F
03/24 11:16, 11F
→
03/24 11:18,
5年前
, 12F
03/24 11:18, 12F
→
03/24 11:18,
5年前
, 13F
03/24 11:18, 13F

R_Language 近期熱門文章
PTT數位生活區 即時熱門文章