I have two objects of type Large SpatialPointsDataFrame named st2 and st10 . They come from one source. They both build without problems:
plot(st2)
or
plot(st10)
But I want to build them using ggmap and ggplot. I can do this for st2 with simple code:
map <- get_map(location = 'PoznaΕ', zoom = 12) ggmap(map) + geom_point(aes(x =st2@coords [,1], y = st2@coords [,2]))
But when it comes to st10 , I get an error:
Error in data.frame(x = c(16.910848618, 16.910863876, 16.910913467, 16.910936356, : arguments imply differing number of rows: 53885, 4
I check the values ββwith the length ():
> length( st10@coords [,1]) [1] 53885 > length( st10@coords [,2]) [1] 53885
I check them with summary ()
> summary( st10@coords [,1]) Min. 1st Qu. Median Mean 3rd Qu. Max. 16.84 16.88 16.91 16.91 16.91 16.99 > summary( st10@coords [,2]) Min. 1st Qu. Median Mean 3rd Qu. Max. 52.35 52.41 52.46 52.44 52.46 52.46
What's wrong? I have more than 20 of these SP data frames, and some of the plots, well others, give the error mentioned above ... this is not related to the number of points
What could be wrong? Or maybe someone can give me some advice on how I can debug this?