I'm working with a .shp file with LINESTRING geometry and for each line there are several attributes.
Simple feature collection with 5979 features and 39 fields
Geometry type: LINESTRING
Dimension:     XY
Bounding box:  xmin: 334297 ymin: 6277095 xmax: 360375.2 ymax: 6312683
Projected CRS: WGS 84 / UTM zone 19S
  Id A1 A2 ... geometry
1  1  1  1 ... LINESTRING (348339.3 628293...
2  2  2  2 ... LINESTRING (343785.3 629153...
3  3  3  3 ... LINESTRING (343926.6 629186...
4  4  4  4 ... LINESTRING (343988.3 629201...
5  5  5  5 ... LINESTRING (344032.6 629212...
I use the next code to find lines intersect and generate new nodes. but doing this with sfnetwork I get a graph without attributes.
shp.file = st_read("myfile.shp")
graph = st_sf(shp.file) %>%
  # Combine LINESTRINGS into a MULTILINESTRING geometry
  st_combine() %>%
  # Create a node where the MULTILINESTRINGs cross
  st_node() %>%
  # Cast back to LINESTRINGs
  st_cast('LINESTRING') %>%
  # Create sfnetwork
  as_sfnetwork(directed = F) 
A sfnetwork with 6308 nodes and 6085 edges
#
# CRS:  WGS 84 / UTM zone 19S 
#
# An undirected multigraph with 282 components with spatially explicit edges
#
# Node Data:     6,308 x 1 (active)
# Geometry type: POINT
# Dimension:     XY
# Bounding box:  xmin: 334297 ymin: 6277096 xmax: 360375.2 ymax: 6312683
                   x
         <POINT [m]>
1 (348339.3 6282939)
2 (348346.9 6282938)
3 (343785.3 6291533)
4 (343791.5 6291546)
5 (343926.6 6291865)
6 (343931.5 6291875)
# ... with 6,302 more rows
#
# Edge Data:     6,085 x 3
# Geometry type: LINESTRING
# Dimension:     XY
# Bounding box:  xmin: 334297 ymin: 6277095 xmax: 360375.2 ymax: 6312683
   from    to                                    x
  <int> <int>                     <LINESTRING [m]>
1     1     2 (348339.3 6282939, 348346.9 6282938)
2     3     4 (343785.3 6291533, 343791.5 6291546)
3     5     6 (343926.6 6291865, 343931.5 6291875)
# ... with 6,082 more rows
How can I add a dataframe with attributes to this type of graph (like a SpatialLineDataframe)?