Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread Dominik Schneider
(d, row.names = row.names, optional = optional, > > ...) > > } > > .local(x, row.names, optional, ...) > > } > > > > > > > > Signatures: > > x > > target "SpatialPointsDataFrame" > > defined &quo

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread Robert J. Hijmans
> > > Signatures: > x > target "SpatialPointsDataFrame" > defined "SpatialPoints" >> > > > > Yours sincerely / Med venlig hilsen > > > Frede Aakmann Tøgersen > Specialist, M.Sc., Ph.D. > Plant Performance & Modeling &

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread Frede Aakmann Tøgersen
Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 fr...@vestas.com http://www.vestas.com Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice If you

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread dschneiderch
I just went through my packages, iteratively unloading each one with: detach('package:raster') and found that if I unload the raster package then the expected behavior of keeping the existing coordnames is achieved. now why that differs in my script I have no idea. > coordnames(snotellocs) [1] "L

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread MacQueen, Don
Thanks, Edzer, this is helpful. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/20/15, 9:28 AM, "Edzer Pebesma" wrote: >There is some logic: sp tries to track coordinate names when it can, but >if coordinates are se

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread dschneiderch
Edzer - Look like we posted at the same time. In my example my coordinates are named, no? I tried your example in my R environment and can replicate the behavior I mentioned. > df = data.frame(x=1:2, y=2:1, z = 3:4) > df1 = df > library(sp) > coordinates(df1) = ~x+y > as.data.frame(df1) x y z 1

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread dschneiderch
Hi - Thanks for your replies. I should have mentioned, I made sure to test this with a clean workspace before posting and confirmed the behavior this morning. it sounds like the names of the coordinates should never change? another example of the names being converted at the prompt from Longitude,

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread Edzer Pebesma
There is some logic: sp tries to track coordinate names when it can, but if coordinates are set as a nameless matrix, as in the last example below, it will choose names itself. coordnames() helps you discover how the coordinates of a SpatialPointsDataFrame are called: > df = data.frame(x=1:2, y=2:

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-20 Thread MacQueen, Don
In my experience, relying on column names to extract the coordinates is not at all a good idea. I would strongly recommend that you take the time to update all of your scripts to use the coordinates() function. I think it will be worth it in the long run. It's not a good idea because the column na

Re: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-19 Thread Frede Aakmann Tøgersen
un...@r-project.org] On Behalf Of > dschneiderch > Sent: 20. marts 2015 00:03 > To: r-sig-geo@r-project.org > Subject: [R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF) > > I have a spatial points dF that is causing me trouble. I've figured out what > is happening

[R-sig-Geo] inconsistent as.data.frame(SpatialPointsDF)

2015-03-19 Thread dschneiderch
I have a spatial points dF that is causing me trouble. I've figured out what is happening but without a clue why. at the prompt, I do > locs class : SpatialPointsDataFrame features: 10 extent : -112.0623, -109.0571, 33.65387, 36.32678 (xmin, xmax, ymin, ymax) coord. ref. : +proj=lo