Skip to content
Back to formatted view

Raw Message

Message-ID: <CAGuGQczGh8d-8cfB1doDtfsrwTPDNscoAK_NUycBefF8bkjWWw@mail.gmail.com>
Date: 2017-06-07T07:29:16Z
From: Shige Song
Subject: Errors running spdplyr example

Dear All,

When I tried to run the following code (taken from the *spdplyr* package
vignettes):

library(spdplyr)
library(maptools)
data(wrld_simpl)

worldcorner <- wrld_simpl %>%
  mutate(lon = coordinates(wrld_simpl)[,1], lat =
coordinates(wrld_simpl)[,2]) %>%
  filter(lat < -20, lon > 60) %>%
  dplyr::select(NAME)


I got the following error messages:

Error in (function (cl, name, valueClass)  :
  c("assignment of an object of class ?tbl_df? is not valid for @?data? in
an object of class ?SpatialPolygonsDataFrame?; is(value, \"data.frame\") is
not TRUE", "assignment of an object of class ?tbl? is not valid for @?data?
in an object of class ?SpatialPolygonsDataFrame?; is(value, \"data.frame\")
is not TRUE", "assignment of an object of class ?data.frame? is not valid
for @?data? in an object of class ?SpatialPolygonsDataFrame?; is(value,
\"data.frame\") is not TRUE")

I am running R 3.3.3 with the latest CRAN version of *spdplyr* (0.1.3) on
Windows 10.

Thanks.

Best,
Shige

	[[alternative HTML version deleted]]