I need to build a list of coordinates from two variables, but I can't figure out how to do this in R
This data contains 2 variables lat and long
data_table <- structure(list(lat = c(1.2, 1.54),
long = c(4.23, 4.29)),
row.names = c(NA,-2L), class = c("data.table", "data.frame"))
lat long
---------
1.2 4.23
1.54 4.29
and I would like to constitute a couple of data in a list of vectors, to obtain the following structure:
list(
c(1.2, 4.23),
c(1.54, 4.29)
)
Expected output:
[[1]]
[1] 1.2 4.23
[[2]]
[1] 1.54 4.29