Friday 16 August 2019

r - I want to do SpatialLines programatically


This is my dataframe:


df <- data.frame(ID = rep(1:100, each = 2), x =runif(200, 10, 90), y = runif(200, 10, 90))

For each ID I need to create SpatialLines, I haven't had good luck.


I think I have to split the dataframe and then transform to Lines class and after that the SpatialLines using the splited dataframe. All that using inside of a apply function. Am I right? How would you do it?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...