After
I am creating a set of plot coordinates on GGMAP with the code given below.
coords & lt; - rbind (as.matrix (RTE [7: 8]), as.matrix (RTE), 9: 10])%)% as.data.frame ()
< / Pre>This data generates below I have the problem with the last point (end point / line)
I am getting an error because there is a duplicate value (9.3) - I have previously It needs to change the name of this +0.1 to the value I 9.4.
structure (list (startLon = c (-2.8812933, -2.88,36,377, -2.88,46, 959, -2.883,528, -2.88,67,415, -2.88,78,325, -2.888080, 8, -2.88, 9, 5, 748, -2.89, 35,501, -2.89, 71,835, -2.8 9, 87,187, -2.8 9, 98, 82, -2.89, 86408, -2.8 9, 89, 038, -2.8, 9 7,305, - 2.8 9, 39, 165, -2.8 9, 32,886, -2.8 9, 32,332, -2.89, 32,886, -2.8, 9, 2303, -2.89, 04 , 392, -2.88, 966841, -2.89, 00, 9 02, -2.88, 9, 6,841, -2.89, 16,631, -2.89, 08, 963, -2 .8,8 9, 9 08, -2.8,8 9, 9 08, -2.88, 9, 7, 9, 9, -2.88, 77,8, 2, -2.88,7, 832), startLat = c (53.1935042, 53.1934807 , 53.1962441, 53.1968895, 53.1943495, 53.1938296, 53.1936907, 53.1943944, 53.1942666, 53.1939625, 53.1931411, 53.1930795, 53.1928816, 53.1926769, 53.1893671, 53.1898796, 53.1899857, 53.1899088, 53.1899857, 53.1903599, 53.1905145, 53.1906626, 53.1912708, 53.1906626, 53.1902482, 53.1884563, 53.1868239 , "1.3", "2.1", "2.2", 53.1868239, 53.1866933, , "3.5", "4.1", "4.2", "2.5", "2.6", "2.7", "3.1", "3.2", "3.3", "3.4", " 5.1 "," 5.2 "," 5.3 "," 6.1 "," 6.2 "," 7.1 "," 7.2 "," 7.3 "," 7.4 "," 8 "," 9.1 "," 9.2 "," 9.3 " , "9.3"), class = "data.frame")
Is that the best way to do this?
Here's a general solution:
mx1 & lt; - Matrix (1:10, 5, dimnames = list (C ("1", "1", "1", "2", "2"), NULL) mx1% & gt;% ` Lt; (`.names (.))) Produces% & Gt;% as.data.frame
:
V1 V2 1 1 6 1.1 2 7 1.2 3 8 2 4 9 2.1 5 10
No comments:
Post a Comment