I have a SpatialLinesDataFrame file named "Sldf" which lacks attributes for each line (see table of sample data below). I have a separate data.frame (from a .csv) named "fsub" with attributes that I would like to merge to the SpatialLinesDataFrame file.
The "DataID" column in the fsub data.frame and the Slot "Id" number in the SpatialLinesDataFrame link the two. See screenshot below for where the unique identifier appears in the SpatialLinesDataFrame file.
How would I complete this operation? I tried the basic merge function but I don't think that works with spatial files.
Sample data "fsub" data.frame
DataID source target value
30 Dis1 France 5
35 Dis1 USA 10
52 Dis1 Albania 15
80 Dis1 Austria 20
121 Dis2 Mexico 506