as.SpatialLines | R Documentation |
Converts SpatialStreamNetwork
objects to sp
objects.
## S3 method for class 'SpatialStreamNetwork' as.SpatialLines(x, ...) ## S3 method for class 'SpatialStreamNetwork' as.SpatialPoints(x, data = "Obs", ...) ## S3 method for class 'SpatialStreamNetwork' as.SpatialLinesDataFrame(x, ...) ## S3 method for class 'SpatialStreamNetwork' as.SpatialPointsDataFrame(x, data = "Obs", ...)
x |
an |
data |
the data set in the |
... |
optional arguments for specific methods written for these generics |
as.SpatialLines.SpatialStreamNetwork
converts an object of class SpatialStreamNetwork
to an object of class SpatialLines
from the sp
package, as.SpatialPoints.SpatialStreamNetwork
converts an object of class SpatialStreamNetwork
to an object of class SpatialPoints
from the sp
package, and as.SpatialPointsDataFrame.SpatialStreamNetwork
converts an object of class SpatialStreamNetwork
to an object of class SpatialPointsDataFrame
from the sp
package,
Jay Ver Hoef support@SpatialStreamNetworks.com
spplot
library(SSN) #for examples, copy MiddleFork04.ssn directory to R's temporary directory copyLSN2temp() # NOT RUN # Create a SpatialStreamNetork object that also contains prediction sites #mf04p <- importSSN(paste0(tempdir(),'/MiddleFork04.ssn'), # predpts = "pred1km", o.write = TRUE) #use mf04p SpatialStreamNetwork object, already created data(mf04p) #for examples only, make sure mf04p has the correct path #if you use importSSN(), path will be correct mf04p <- updatePath(mf04p, paste0(tempdir(),'/MiddleFork04.ssn')) names(mf04p) #--------- # make plots using sp methods #--------- #plot the stream lines plot(as.SpatialLines(mf04p), col = "blue") # add the observed locations with size proportional # to mean summer temperature plot(as.SpatialPoints(mf04p), pch = 19, cex = as.SpatialPointsDataFrame(mf04p)$Summer_mn/9 , add = TRUE) # add the prediction locations on the 1 km spacing plot(as.SpatialPoints(mf04p, data = "pred1km"), cex = 1.5, add = TRUE) # add the dense set of points for block prediction on Knapp segment plot(as.SpatialPoints(mf04p, data = "Knapp"), pch = 19, cex = 0.3, col = "red", add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.