Df2SpLines: Data Frame to Spatial Lines

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

Description

This function converts an object of type data.frame, calculated by the function ProcTraj, into an object of type SpatialLines-class.

Usage

1

Arguments

df

data.frame Object created by the function ProcTraj.

crs

String: Valid projection string. An example would be crs="+proj=longlat +datum=NAD27"

Details

An individual line consists of a set of lines in the data frame that contains the same ID. This function identifies individual trajectories based on their length. It is assumed that all trajectories calculated by HySplit using the ProcTraj function have the same length. Thus, once known the length of the trajectories, this function splits the data frame in X different data frames where each data frame contains R rows, R being the trajectory's length and X being the number of rows in the initial data frame divided by the trajectory's length. Each of the X different data frames will be transformed into a different line.

Value

Returns an object of class SpatialLines-class.

Author(s)

Thalles Santos Silva

See Also

data.frame, ProcTraj, SpatialLines-class.

Examples

1
2
3
4
  ## load data frame of HYSPLIT trajectory calculations calculated by function ProcTraj
  crs <- "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
  air.traj.lines <- Df2SpLines(air.traj, crs)
  PlotTraj(air.traj.lines)

opentraj documentation built on May 1, 2019, 8:47 p.m.