# NOT RUN {
# Examples for linnet method
if (require(spatstat)) {
plot(simplenet, main = "spatstat input")
simplenet_as_sfnetwork = as_sfnetwork(simplenet)
plot(simplenet_as_sfnetwork, main = "sfnetworks output")
}
# Examples for psp method
if (require(spatstat)) {
set.seed(42)
test_psp = psp(runif(10), runif(10), runif(10), runif(10), window=owin())
plot(test_psp, main = "spatstat input")
test_psp_as_sfnetwork = as_sfnetwork(test_psp)
plot(test_psp_as_sfnetwork, main = "sfnetworks output")
}
# }
Run the code above in your browser using DataLab