【发布时间】:2019-04-11 17:39:17
【问题描述】:
我有一个名为坐标的列,它是每个地址的纬度和经度坐标的数据框。我想将列拆分为两列,称为 lat 和 long,而不是一列称为坐标
我有以下数据:
vsn address coordinates
53 079 Ashland Ave & Elston Ave Chicago IL -87.66826, 41.91873
76 097 Pulaski Rd & 71st St Chicago IL -87.72242, 41.76412
84 0A3 Long Ave & Lawrence Ave Chicago IL -87.76257, 41.96759
坐标列包含一个列表 我需要将数据转换为以下内容:
vsn address Lat Lon
53 079 Ashland Ave & Elston Ave Chicago IL -87.66826 41.91873
76 097 Pulaski Rd & 71st St Chicago IL -87.72242 41.76412
84 0A3 Long Ave & Lawrence Ave Chicago IL -87.76257 41.96759
我不知道如何提取数据,因为它是一个数据框,具体如下所示
列坐标的类型如下所示:
dput 的输出(数据$坐标)
structure(list(coordinates = list(c(-87.668257, 41.918733), c(-87.72242,
41.764122), c(-87.76257, 41.96759))), row.names = c(53L, 76L,
84L), class = "data.frame")
【问题讨论】:
-
请在问题中显示 dput(DF) 的输出,其中 DF 是具有 3 列的输入数据框。
-
我已经重新打开了这个。所谓的重复是为了分割一个字符串,但这个问题是关于分割一个列表。
标签: r