mp2sp: Create a SpatialPointsDataFrame describing Metapop population...

Description Usage Arguments Value See Also Examples

View source: R/mp2sp.R

Description

Create a SpatialPointsDataFrame representing the centroid of each population, with attributes: pop (population name), time (the time step), and N (the mean population size).

Usage

1
mp2sp(mp, coords, start, s_p4s, t_p4s)

Arguments

mp

A RAMAS Metapop .mp file containing simulation results.

coords

An object containing population coordinates. This object can be created by using mp2xy

start

The value of the first timestep. If timesteps are not in increments of 1, it may be best to use start=1, in which case 'time' in the resulting shapefile's attribute table will refer to the timestep number.

s_p4s

(Optional) The coordinate reference system of the source cordinates given in coords. These can be supplied as a CRS object or as a proj4 string.

t_p4s

(Optional) The target coordinate reference system to which coordinates will be projected, if supplied. These can be supplied as a CRS object or as a proj4 string.

Value

A SpatialPointsDataFrame.

See Also

mp2xy

Examples

1
2
3
4
5
mp <- system.file('example.mp', package='mptools')
r <- system.file('example_001.tif', package='mptools')
coords <- mp2xy(mp, r, 9.975)
spdf <- mp2sp(mp, coords, start=2000)
spdf

mptools documentation built on May 2, 2019, 6:54 a.m.