我这里有一个名单:
df.list <- list(structure(list(time = c("2023-02-14 14:33:13", "2023-02-14 14:33:13"
), lat = c(50.085588, 50.0855878333333), lon = c(4.55540016666667,
4.5554), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:29:21", "2023-02-14 13:29:22"
), lat = c(50.0855996666667, 50.0855998333333), lon = c(4.55512916666667,
4.555129), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:39:30", "2023-02-14 13:39:31"
), lat = c(50.0856193333333, 50.0856195), lon = c(4.55519116666667,
4.5551915), alt = c(196.1, 196.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:38:54", "2023-02-14 13:38:55"
), lat = c(50.0856118333333, 50.0856118333333), lon = c(4.555187,
4.55518716666667), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:14:30", "2023-02-14 14:14:31"
), lat = c(50.0856361666667, 50.0856361666667), lon = c(4.55524916666667,
4.55524966666667), alt = c(195.6, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:36:21", "2023-02-14 14:36:21"
), lat = c(50.0855886666667, 50.0855886666667), lon = c(4.55543483333333,
4.55543466666667), alt = c(196.9, 196.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:28:20", "2023-02-14 13:28:21"
), lat = c(50.0856001666667, 50.0856003333333), lon = c(4.55512016666667,
4.55511983333333), alt = c(196.2, 196.2)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:34:59", "2023-02-14 13:35:00"
), lat = c(50.085614, 50.0856141666667), lon = c(4.555184,
4.55518416666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:24:10", "2023-02-14 14:24:11"
), lat = c(50.0856, 50.0856001666667), lon = c(4.55531633333333,
4.55531583333333), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:26:25", "2023-02-14 13:26:26"
), lat = c(50.0855585, 50.0855583333333), lon = c(4.55509816666667,
4.55509816666667), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:32:33", "2023-02-14 13:32:34"
), lat = c(50.0856156666667, 50.0856155), lon = c(4.55516366666667,
4.55516366666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:30:04", "2023-02-14 13:30:05"
), lat = c(50.0855856666667, 50.0855855), lon = c(4.55513816666667,
4.55513866666667), alt = c(196.3, 196.3)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:30:52", "2023-02-14 13:30:53"
), lat = c(50.0856061666667, 50.0856061666667), lon = c(4.55516116666667,
4.555161), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:24:23", "2023-02-14 13:24:24"
), lat = c(50.0855631666667, 50.0855631666667), lon = c(4.55508666666667,
4.55508683333333), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:29:07", "2023-02-14 14:29:07"
), lat = c(50.0855993333333, 50.0855993333333), lon = c(4.5553505,
4.55535083333333), alt = c(194.4, 194.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:34:33", "2023-02-14 14:34:33"
), lat = c(50.085565, 50.085565), lon = c(4.55539216666667,
4.55539216666667), alt = c(196.1, 196.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:31:46", "2023-02-14 13:31:47"
), lat = c(50.0855913333333, 50.0855913333333), lon = c(4.55516316666667,
4.55516316666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:38:58", "2023-02-14 14:38:58"
), lat = c(50.0855555, 50.0855555), lon = c(4.55541816666667,
4.55541833333333), alt = c(196.1, 196.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:17:03", "2023-02-14 14:17:03"
), lat = c(50.0856198333333, 50.0856196666667), lon = c(4.55523316666667,
4.55523316666667), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:33:52", "2023-02-14 13:33:53"
), lat = c(50.0855915, 50.0855913333333), lon = c(4.55516533333333,
4.55516566666667), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:20:15", "2023-02-14 14:20:16"
), lat = c(50.0856486666667, 50.0856485), lon = c(4.55524616666667,
4.555246), alt = c(196.1, 196.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:25:46", "2023-02-14 13:25:47"
), lat = c(50.085564, 50.0855641666667), lon = c(4.555103,
4.55510283333333), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:15:11", "2023-02-14 14:15:11"
), lat = c(50.0856263333333, 50.0856263333333), lon = c(4.55524366666667,
4.555244), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:37:21", "2023-02-14 15:37:22"
), lat = c(50.0855968333333, 50.0855968333333), lon = c(4.55584216666667,
4.55584216666667), alt = c(195.8, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:21:50", "2023-02-14 13:21:51"
), lat = c(50.0855355, 50.0855353333333), lon = c(4.55500733333333,
4.55500716666667), alt = c(195.8, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:22:14", "2023-02-14 14:22:14"
), lat = c(50.0856335, 50.0856335), lon = c(4.55530833333333,
4.55530833333333), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:17:40", "2023-02-14 14:17:40"
), lat = c(50.0856283333333, 50.0856283333333), lon = c(4.55523816666667,
4.5552385), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:11:32", "2023-02-14 14:11:32"
), lat = c(50.0856538333333, 50.0856531666667), lon = c(4.55523933333333,
4.55523966666667), alt = c(194.7, 194.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:15:59", "2023-02-14 14:16:00"
), lat = c(50.085632, 50.085632), lon = c(4.5552615, 4.55526183333333
), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:59:04", "2023-02-14 14:59:04"
), lat = c(50.0855613333333, 50.0855613333333), lon = c(4.5554735,
4.55547283333333), alt = c(197, 197)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:13:12", "2023-02-14 14:13:13"
), lat = c(50.0856505, 50.0856506666667), lon = c(4.55523633333333,
4.55523633333333), alt = c(194.6, 194.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:32:37", "2023-02-14 14:32:37"
), lat = c(50.085606, 50.0856061666667), lon = c(4.55541633333333,
4.55541633333333), alt = c(196.3, 196.3)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:25:28", "2023-02-14 14:25:28"
), lat = c(50.085589, 50.085589), lon = c(4.55532783333333,
4.55532783333333), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:10:13", "2023-02-14 14:10:13"
), lat = c(50.0856455, 50.0856455), lon = c(4.55524866666667,
4.55524866666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:11:51", "2023-02-14 14:11:51"
), lat = c(50.0856356666667, 50.0856358333333), lon = c(4.55522716666667,
4.55522716666667), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:00:10", "2023-02-14 13:00:11"
), lat = c(50.085519, 50.085519), lon = c(4.55486433333333,
4.55486433333333), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:15:03", "2023-02-14 13:15:04"
), lat = c(50.085515, 50.085515), lon = c(4.5548905, 4.5548905
), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:12:39", "2023-02-14 13:12:40"
), lat = c(50.0855135, 50.0855135), lon = c(4.5548845, 4.55488433333333
), alt = c(195.8, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:09:51", "2023-02-14 13:09:52"
), lat = c(50.0855061666667, 50.085506), lon = c(4.554888,
4.55488816666667), alt = c(195.1, 195)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:02:16", "2023-02-14 13:02:17"
), lat = c(50.0855231666667, 50.0855231666667), lon = c(4.55488,
4.55487983333333), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:26:28", "2023-02-14 14:26:28"
), lat = c(50.085593, 50.0855931666667), lon = c(4.55534183333333,
4.55534183333333), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:08:12", "2023-02-14 13:08:13"
), lat = c(50.0855063333333, 50.0855063333333), lon = c(4.5548845,
4.5548845), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:01:28", "2023-02-14 13:01:29"
), lat = c(50.0855268333333, 50.0855268333333), lon = c(4.55487533333333,
4.55487583333333), alt = c(195.9, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:30:59", "2023-02-14 14:31:00"
), lat = c(50.0855911666667, 50.0855911666667), lon = c(4.55538766666667,
4.55538733333333), alt = c(196.6, 196.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:20:18", "2023-02-14 13:20:19"
), lat = c(50.0855385, 50.0855386666667), lon = c(4.5549915,
4.55499116666667), alt = c(196.1, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:07:05", "2023-02-14 13:07:06"
), lat = c(50.0855238333333, 50.085524), lon = c(4.55489133333333,
4.55489116666667), alt = c(197, 197)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 12:46:35", "2023-02-14 12:46:36"
), lat = c(50.08553, 50.0855301666667), lon = c(4.55487016666667,
4.55487016666667), alt = c(196.8, 196.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:13:52", "2023-02-14 13:13:53"
), lat = c(50.0855223333333, 50.0855225), lon = c(4.55489,
4.55489016666667), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:35:42", "2023-02-14 13:35:43"
), lat = c(50.085597, 50.085597), lon = c(4.55519583333333,
4.55519583333333), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:36:59", "2023-02-14 14:37:00"
), lat = c(50.0855678333333, 50.0855676666667), lon = c(4.5554255,
4.55542533333333), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:37:19", "2023-02-14 13:37:20"
), lat = c(50.0856065, 50.0856065), lon = c(4.55519516666667,
4.55519533333333), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:57:13", "2023-02-14 14:57:13"
), lat = c(50.0855648333333, 50.0855668333333), lon = c(4.55544983333333,
4.5554505), alt = c(194.8, 194.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:21:27", "2023-02-14 14:21:27"
), lat = c(50.0856253333333, 50.0856261666667), lon = c(4.55531183333333,
4.55531333333333), alt = c(195, 195)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:24:47", "2023-02-14 14:24:47"
), lat = c(50.085599, 50.085599), lon = c(4.555322, 4.55532216666667
), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:32:02", "2023-02-14 14:32:02"
), lat = c(50.0856021666667, 50.0856021666667), lon = c(4.5553805,
4.5553805), alt = c(195.6, 195.5)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:38:11", "2023-02-14 13:38:12"
), lat = c(50.0856053333333, 50.0856053333333), lon = c(4.5551895,
4.55518966666667), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:39:38", "2023-02-14 14:39:39"
), lat = c(50.0855733333333, 50.0855731666667), lon = c(4.55541783333333,
4.55541783333333), alt = c(196.6, 196.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 13:36:34", "2023-02-14 13:36:35"
), lat = c(50.0856043333333, 50.0856043333333), lon = c(4.555195,
4.555195), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:23:15", "2023-02-14 14:23:15"
), lat = c(50.0855998333333, 50.0855998333333), lon = c(4.55529116666667,
4.55529116666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:27:51", "2023-02-14 14:27:51"
), lat = c(50.0856001666667, 50.0856), lon = c(4.5553565,
4.5553565), alt = c(196.7, 196.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:28:31", "2023-02-14 14:28:32"
), lat = c(50.0855761666667, 50.0855761666667), lon = c(4.55535483333333,
4.55535483333333), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:51:31", "2023-02-14 14:51:31"
), lat = c(50.085597, 50.0855971666667), lon = c(4.555469,
4.55546916666667), alt = c(197.5, 197.5)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:14:10", "2023-02-14 15:14:10"
), lat = c(50.085603, 50.085601), lon = c(4.5555135, 4.55551683333333
), alt = c(195.1, 195.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:38:16", "2023-02-14 14:38:16"
), lat = c(50.085572, 50.0855718333333), lon = c(4.5554355,
4.5554355), alt = c(196.1, 196.2)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:18:52", "2023-02-14 15:18:52"
), lat = c(50.0856136666667, 50.0856136666667), lon = c(4.5556125,
4.55561266666667), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:26:24", "2023-02-14 15:26:24"
), lat = c(50.0856231666667, 50.0856235), lon = c(4.5556855,
4.555686), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:32:37", "2023-02-14 15:32:37"
), lat = c(50.0855908333333, 50.085591), lon = c(4.555776,
4.555776), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:29:45", "2023-02-14 15:29:45"
), lat = c(50.0855873333333, 50.0855871666667), lon = c(4.55573133333333,
4.5557305), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:27:14", "2023-02-14 15:27:15"
), lat = c(50.0856126666667, 50.0856123333333), lon = c(4.55569433333333,
4.55569466666667), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:06:59", "2023-02-14 15:06:59"
), lat = c(50.0855725, 50.085573), lon = c(4.55551, 4.55551
), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:47:27", "2023-02-14 15:47:28"
), lat = c(50.0856143333333, 50.085615), lon = c(4.55612283333333,
4.55612266666667), alt = c(197, 197.2)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:56:02", "2023-02-14 14:56:02"
), lat = c(50.0855743333333, 50.0855738333333), lon = c(4.55546416666667,
4.55546416666667), alt = c(196.8, 196.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:02:53", "2023-02-14 15:02:54"
), lat = c(50.08558, 50.0855801666667), lon = c(4.55546933333333,
4.55546916666667), alt = c(196.4, 196.4)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:31:27", "2023-02-14 15:31:28"
), lat = c(50.0856178333333, 50.085618), lon = c(4.55578316666667,
4.55578316666667), alt = c(196.6, 196.5)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:08:36", "2023-02-14 16:08:36"
), lat = c(50.0856126666667, 50.0856121666667), lon = c(4.55632333333333,
4.556323), alt = c(196.9, 196.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:14:05", "2023-02-14 16:14:06"
), lat = c(50.0856433333333, 50.0856431666667), lon = c(4.55659083333333,
4.55659083333333), alt = c(197.2, 197.2)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:07:59", "2023-02-14 15:07:59"
), lat = c(50.0855476666667, 50.0855476666667), lon = c(4.55550666666667,
4.55550683333333), alt = c(195.6, 195.5)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:01:22", "2023-02-14 15:01:23"
), lat = c(50.0855551666667, 50.0855553333333), lon = c(4.55547383333333,
4.55547366666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:22:51", "2023-02-14 16:22:51"
), lat = c(50.0858058333333, 50.085806), lon = c(4.55701266666667,
4.557013), alt = c(197, 196.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:24:31", "2023-02-14 15:24:31"
), lat = c(50.0856235, 50.0856235), lon = c(4.5556625, 4.5556625
), alt = c(195.9, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:56:58", "2023-02-14 14:56:58"
), lat = c(50.0855568333333, 50.0855568333333), lon = c(4.55544083333333,
4.55544066666667), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:27:12", "2023-02-14 16:27:13"
), lat = c(50.0858683333333, 50.0858683333333), lon = c(4.55712366666667,
4.55712283333333), alt = c(196.9, 196.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:08:46", "2023-02-14 15:08:47"
), lat = c(50.0855598333333, 50.08556), lon = c(4.55551833333333,
4.55551833333333), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:23:59", "2023-02-14 16:23:59"
), lat = c(50.0858056666667, 50.0858058333333), lon = c(4.55700616666667,
4.55700616666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:00:58", "2023-02-14 15:00:59"
), lat = c(50.0855675, 50.0855676666667), lon = c(4.5554855,
4.55548566666667), alt = c(196.5, 196.5)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:41:33", "2023-02-14 15:41:33"
), lat = c(50.0856088333333, 50.0856093333333), lon = c(4.55588816666667,
4.55588816666667), alt = c(194.8, 194.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:49:17", "2023-02-14 15:49:17"
), lat = c(50.0856085, 50.0856086666667), lon = c(4.55617033333333,
4.55617083333333), alt = c(197, 197)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:12:49", "2023-02-14 15:12:49"
), lat = c(50.0855995, 50.0855993333333), lon = c(4.55548366666667,
4.55548383333333), alt = c(195.5, 195.5)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:00:04", "2023-02-14 15:00:04"
), lat = c(50.0855471666667, 50.085547), lon = c(4.55546633333333,
4.55546633333333), alt = c(195.9, 195.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:19:51", "2023-02-14 15:19:51"
), lat = c(50.0856081666667, 50.085608), lon = c(4.55562966666667,
4.5556295), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:52:49", "2023-02-14 14:52:49"
), lat = c(50.0855915, 50.0855915), lon = c(4.5554585, 4.55545916666667
), alt = c(195, 195.2)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:35:50", "2023-02-14 15:35:50"
), lat = c(50.0855946666667, 50.0855946666667), lon = c(4.55583466666667,
4.55583466666667), alt = c(196.1, 196.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:42:33", "2023-02-14 15:42:33"
), lat = c(50.0856031666667, 50.0856033333333), lon = c(4.55590166666667,
4.55590166666667), alt = c(195.7, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:11:28", "2023-02-14 15:11:28"
), lat = c(50.0855835, 50.0855833333333), lon = c(4.55551433333333,
4.55551416666667), alt = c(196.5, 196.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:16:57", "2023-02-14 15:16:57"
), lat = c(50.0856133333333, 50.0856135), lon = c(4.55559883333333,
4.55559833333333), alt = c(196.2, 196.2)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:39:07", "2023-02-14 15:39:07"
), lat = c(50.0856143333333, 50.085614), lon = c(4.555848,
4.55584816666667), alt = c(195.7, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 14:54:20", "2023-02-14 14:54:21"
), lat = c(50.085583, 50.085583), lon = c(4.555483, 4.555483
), alt = c(196.1, 196.1)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:51:51", "2023-02-14 15:51:51"
), lat = c(50.0855886666667, 50.0855881666667), lon = c(4.55624983333333,
4.55625066666667), alt = c(196.3, 196.3)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:04:17", "2023-02-14 15:04:18"
), lat = c(50.0855578333333, 50.0855578333333), lon = c(4.55549733333333,
4.55549766666667), alt = c(195.8, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:35:09", "2023-02-14 15:35:09"
), lat = c(50.0855715, 50.0855715), lon = c(4.5558175, 4.5558175
), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:40:20", "2023-02-14 15:40:21"
), lat = c(50.0856128333333, 50.0856131666667), lon = c(4.55587233333333,
4.5558725), alt = c(194.4, 194.4)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:38:24", "2023-02-14 15:38:24"
), lat = c(50.0856028333333, 50.0856028333333), lon = c(4.5558445,
4.55584466666667), alt = c(195.6, 195.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:25:23", "2023-02-14 16:25:24"
), lat = c(50.0858448333333, 50.0858445), lon = c(4.55710433333333,
4.55710416666667), alt = c(196.5, 196.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:34:09", "2023-02-14 15:34:09"
), lat = c(50.0855921666667, 50.0855921666667), lon = c(4.55580083333333,
4.55580083333333), alt = c(195.9, 195.8)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:03:49", "2023-02-14 15:03:49"
), lat = c(50.0855466666667, 50.0855466666667), lon = c(4.55548433333333,
4.55548383333333), alt = c(196, 196)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 15:28:39", "2023-02-14 15:28:39"
), lat = c(50.0856093333333, 50.08561), lon = c(4.555721,
4.5557215), alt = c(195.6, 195.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:40:30", "2023-02-14 16:40:30"
), lat = c(50.0847675, 50.0847673333333), lon = c(4.5522415,
4.5522415), alt = c(202.7, 202.7)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 12:36:46", "2023-02-14 12:36:47"
), lat = c(50.0855291666667, 50.0855291666667), lon = c(4.55525866666667,
4.55525866666667), alt = c(197.4, 197.4)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 12:38:04", "2023-02-14 12:38:05"
), lat = c(50.085533, 50.0855333333333), lon = c(4.55529516666667,
4.55529566666667), alt = c(196.8, 196.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 12:31:58", "2023-02-14 12:31:59"
), lat = c(50.0853416666667, 50.0853415), lon = c(4.55401133333333,
4.554011), alt = c(197.9, 197.9)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 12:33:13", "2023-02-14 12:33:14"
), lat = c(50.0853436666667, 50.0853445), lon = c(4.55403066666667,
4.55403083333333), alt = c(197.2, 197.4)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 12:29:48", "2023-02-14 12:29:49"
), lat = c(50.0852323333333, 50.0852321666667), lon = c(4.55357316666667,
4.55357366666667), alt = c(198.6, 198.6)), row.names = 1:2, class = "data.frame"),
structure(list(time = c("2023-02-14 16:45:13", "2023-02-14 16:45:13"
), lat = c(50.085568, 50.0855681666667), lon = c(4.55523516666667,
4.555235), alt = c(198.4, 198.3)), row.names = 1:2, class = "data.frame"))
从不同的.csv文件导入,代码为:
filenames <- list.files(pattern='*.csv', full.names=TRUE)
df.list <- lapply(filenames, read.csv)
dput(filenames)
c("./12112.csv", "./12201.csv", "./12202.csv", "./12203.csv",
"./12208.csv", "./12209.csv", "./12210.csv", "./12215.csv", "./12216.csv",
"./12220.csv", "./12223.csv", "./12225.csv", "./12226.csv", "./12230.csv",
"./12232.csv", "./12234.csv", "./12246.csv", "./12248.csv", "./12249.csv",
"./12251.csv", "./12253.csv", "./12261.csv", "./12262.csv", "./12267.csv",
"./12268.csv", "./12269.csv", "./12271.csv", "./12276.csv", "./12277.csv",
"./12279.csv", "./12282.csv", "./12283.csv", "./12290.csv", "./12294.csv",
"./12299.csv", "./13102.csv", "./13104.csv", "./13106.csv", "./13107.csv",
"./13108.csv", "./13114.csv", "./13117.csv", "./13119.csv", "./13121.csv",
"./13124.csv", "./13125.csv", "./13126.csv", "./13130.csv", "./13137.csv",
"./13140.csv", "./13142.csv", "./13147.csv", "./13148.csv", "./13150.csv",
"./13151.csv", "./13152.csv", "./13154.csv", "./13157.csv", "./13158.csv",
"./13162.csv", "./13163.csv", "./13180.csv", "./13193.csv", "./13197.csv",
"./13200.csv", "./2206.csv", "./2207.csv", "./2211.csv", "./2213.csv",
"./2219.csv", "./2229.csv", "./2235.csv", "./2236.csv", "./2239.csv",
"./2244.csv", "./2257.csv", "./2260.csv", "./2264.csv", "./2265.csv",
"./2266.csv", "./2274.csv", "./2286.csv", "./2288.csv", "./2289.csv",
"./2291.csv", "./2298.csv", "./3103.csv", "./3135.csv", "./3136.csv",
"./3138.csv", "./3144.csv", "./3149.csv", "./3159.csv", "./3161.csv",
"./3165.csv", "./3173.csv", "./3176.csv", "./3177.csv", "./3178.csv",
"./3181.csv", "./3183.csv", "./3184.csv", "./3185.csv", "./3188.csv",
"./3191.csv", "./3199.csv", "./BorneSNCB.csv", "./Panneau1droit.csv",
"./Panneau1gauche.csv", "./Panneau3droite.csv", "./Panneau3gauche.csv",
"./Piquet0uhab.csv", "./Piquetrisberme.csv")
然而,df.list并不保存CSV. hese名称的名称,这些名称包含在向量“文件名”中。
因此,我正在寻找一种方法,使用“filenames”中的值来命名列表“df.list”中的每个data.frame(或者在导入.csv文件期间保留名称的方法)
1条答案
按热度按时间b4wnujal1#
lapply
的默认操作是保留名称(原始list.files(.)
向量/列表的名称),但如果名称不存在,则不提供名称。与sapply
相反,sapply
在名称不适用时适用名称(使用其默认值USE.NAMES=TRUE
)。有三种方法:
1.读取后手动应用名称:
当您已经读入所有数据并且不想花时间再次读取所有数据时,这是最简单的。
1.使用
setNames
指定名称,如下所示这是我从头开始时的首选。
1.使用
sapply
,加上simplify=FALSE
: