Running examples in ‘SSN-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: createDistMat
> ### Title: Calculate Hydrologic Distances for a SpatialStreamNetwork Object
> ### Aliases: createDistMat
> 
> ### ** Examples
> 
> 
> library(SSN)
> # NOT RUN
> # mf04 <- importSSN(system.file("lsndata/MiddleFork04.ssn",
> #	        package = "SSN"), o.write = TRUE)
> # use SpatialStreamNetwork object mf04 that was already created
> data(mf04)
> # for examples, copy MiddleFork04.ssn directory to R's temporary directory
> copyLSN2temp()
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.dbf to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.dbf: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.prj to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.prj: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.sbn to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.sbn: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.sbx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.sbx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.shp to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.shp: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.shp.xml to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.shp.xml: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./CapeHorn.shx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/CapeHorn.shx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.dbf to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.dbf: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.prj to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.prj: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.sbn to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.sbn: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.sbx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.sbx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.shp to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.shp: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.shp.xml to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.shp.xml: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./Knapp.shx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/Knapp.shx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./binaryID.db to /tmp/RtmpVuLGRM/MiddleFork04.ssn/binaryID.db: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/Knapp/dist.net2.a.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/Knapp/dist.net2.a.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/Knapp/dist.net2.b.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/Knapp/dist.net2.b.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/obs/dist.net1.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/obs/dist.net1.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/obs/dist.net2.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/obs/dist.net2.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/pred1km/dist.net2.a.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net2.a.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/pred1km/dist.net1.a.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net1.a.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/pred1km/dist.net2.b.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net2.b.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/pred1km/dist.net1.b.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net1.b.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/CapeHorn/dist.net2.a.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/CapeHorn/dist.net2.a.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./distance/CapeHorn/dist.net2.b.RData to /tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/CapeHorn/dist.net2.b.RData: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.dbf to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.dbf: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.prj to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.prj: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.sbn to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.sbn: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.sbx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.sbx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.shp to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.shp: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.shp.xml to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.shp.xml: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./edges.shx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/edges.shx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./netID1.dat to /tmp/RtmpVuLGRM/MiddleFork04.ssn/netID1.dat: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./netID2.dat to /tmp/RtmpVuLGRM/MiddleFork04.ssn/netID2.dat: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.dbf to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.dbf: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.prj to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.prj: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.sbn to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.sbn: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.sbx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.sbx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.shp to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.shp: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.shp.xml to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.shp.xml: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./pred1km.shx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/pred1km.shx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.dbf to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.dbf: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.prj to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.prj: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.sbn to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.sbn: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.sbx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.sbx: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.shp to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.shp: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.shp.xml to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.shp.xml: Permission denied
Warning in file.copy(file.list, paste0(tempdir(), "/MiddleFork04.ssn"),  :
  problem copying ./sites.shx to /tmp/RtmpVuLGRM/MiddleFork04.ssn/sites.shx: Permission denied
> #make sure mf04p has the correct path, will vary for each users installation
> mf04 <- updatePath(mf04, paste0(tempdir(),'/MiddleFork04.ssn'))
[1] "SSN path updated to /tmp/RtmpVuLGRM/MiddleFork04.ssn"
> 
> # create distance matrix among observed data points
> createDistMat(mf04, o.write = TRUE)
Warning in file(file.path(ssn@path, "distance", "obs", workspace.name),  :
  cannot open file '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/obs/dist.net1.RData': Permission denied
Error in file(file.path(ssn@path, "distance", "obs", workspace.name),  : 
  cannot open the connection
Calls: createDistMat -> file
Execution halted
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/CapeHorn/dist.net2.a.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/CapeHorn/dist.net2.b.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/Knapp/dist.net2.a.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/Knapp/dist.net2.b.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net2.a.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net1.a.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net1.b.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/pred1km/dist.net2.b.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/obs/dist.net1.RData': Permission denied
rm: cannot remove '/tmp/RtmpVuLGRM/MiddleFork04.ssn/distance/obs/dist.net2.RData': Permission denied