# Get temporary directory, where the example LSN will be stored
# locally.
temp_dir <- tempdir()
# Build the LSN. When working with your own data, lsn_path will be
# a local folder of your choice rather than a temporary directory.
edges<- lines_to_lsn(
streams = MF_streams,
lsn_path = temp_dir,
snap_tolerance = 1,
check_topology = FALSE,
overwrite = TRUE,
verbose = FALSE
)
# # Incorporate observed sites, MF_obs, into LSN
obs<- sites_to_lsn(
sites = MF_obs,
edges = edges,
save_local = FALSE,
snap_tolerance = 100,
overwrite = TRUE,
verbose = FALSE
)
# Notice that 3 new columns have been added to obs
names(obs)
# Incorporate prediction dataset, MF_preds, into LSN
preds<- sites_to_lsn(sites = MF_preds,
edges = edges,
save_local = FALSE,
snap_tolerance = 1,
overwrite = TRUE,
verbose = FALSE
)
Run the code above in your browser using DataLab