1\name{DF2SpatialPointsDataFrame}
2
3\alias{DF2SpatialPointsDataFrame}
4
5\title{change data.frame to SpatialPointsDataFrame}
6
7\description{This function modifies an object of class data.frame to one of class SpatialPointsDataFrame}
8
9\usage{DF2SpatialPointsDataFrame(x, coords = c("x", "y"),
10
11    crs = sp::CRS("+init=epsg:28992"))}
12
13\arguments{
14
15  \item{x}{data frame to be converted}
16
17  \item{coords}{which columns are coordinates}
18
19  \item{crs}{projection scheme}
20
21}
22
23
24
25\value{the new object of class SpatialPointsDataFrame}
26
27
28
29\author{Markus Loecher}
30
31
32
33
34
35
36
37
38
39\examples{
40
41if (requireNamespace("sp", quietly = TRUE)) {
42
43  data("meuse", package = "sp", envir = environment())
44
45  meuseSP = DF2SpatialPointsDataFrame(meuse)
46
47
48
49  sp::plot(meuseSP, asp = 1, cex = 4 * meuse$zinc/max(meuse$zinc),
50
51       pch = 1, col = as.numeric(meuse$ffreq)+1 )
52
53  data("meuse.riv", package = "sp", envir = environment())
54
55  lines(meuse.riv)
56
57} else {
58
59  print("package sp must be installed for this example")
60
61}
62
63
64
65
66
67}
68
69