PlotTrajFreq: Plot Trajectory Frequency

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PlotTrajFreq.R

Description

This function is designed to display a trajectory frequency map that was output by function RasterizeTraj.

Usage

1
2
PlotTrajFreq(spGridDf, background = T, overlay = NA,
  overlay.color = "white", pdf = F, file.name = "output", ...)

Arguments

spGridDf

SpatialGridDataFrame Object obtained by the convertion of the raster Object output by the RasterizeTraj function.

background

Boolean: Indicates whether or not the Canadian's background map should be displayed.

overlay

[Optional] If defined, it takes a SpatialPolygonsDataFrame as input and plots it over the spGridDf.

overlay.color

String. sets the Polygons' color defined by the overlay argument e.g. "blue"

pdf

Defines whether or not the output map should be saved in a pdf file.

file.name

String: If the argument pdf is True, this argument defined the name of the output file.

...

Further arguments to be passed to the generic function plot.

Details

Since the function RasterizeTraj outputs a RasterLayer object, this Object must be converted to a SpatialGridDataFrame Object using the as(rasterObject, "SpatialGridDataFrame") for example.

Value

Trajectory Frequency Map

Author(s)

Thalles Santos Silva

See Also

RasterizeTraj

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  library(raster)
    
  crs <- "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
  air.traj.lines <- Df2SpLines(air.traj, crs)
  raster.lines <- RasterizeTraj(air.traj.lines, reduce=TRUE, resolution=15000, parallel=FALSE)
    
  r.max.value <- maxValue(raster.lines)
  v <- getValues(raster.lines)
  v <- v / r.max.value
  r <- setValues(raster.lines, v)
    
  ## convert raster object to SparialGridDataFrame Object
  r1 <- as(r, "SpatialGridDataFrame")
    
  PlotTrajFreq(r1, background = TRUE, main="Title", pdf=FALSE)

Example output

Loading required package: sp
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

opentraj documentation built on May 29, 2017, 11:45 a.m.