[GRASS-user] Natural breaks classification
Salvatore Mellino
salvatore.mellino at gmail.com
Thu May 17 11:15:54 EDT 2012
Hi,
thanks a lot. Now the process started, but the operation DTM_class <- classIntervals(DTM.df$varOfInterest, n=5, style="fisher" takes too long; it was started by hours but does not end. Is it normal?
Salvatore
Il giorno 16/mag/2012, alle ore 22:04, Luigi Ponti ha scritto:
> On 16/05/2012 21:10, Luigi Ponti wrote:
>> On 16/05/2012 20:55, Salvatore Mellino wrote:
>>> I'm trying but I receive an error.
>>>
>>> 1. In R I started the libraries spgarass6 and classInt
>>> 2. I imported the DTM in R using DTM<- readRAST6("DTM a mapset", ignore.stderr=TRUE)
>>> 3. I used the command DTM_class<- classIntervals(DTM, n=5, style="fisher") and I received the error
>>>
>>> Error in classIntervals(DTM, n = 5, style = "fisher") :
>>> var is not numeric
>>
>> I do not recall exactly, but it may be that classIntervals does not have a method for spatial data frames (i.e. the output of readRAST6). One thing I would try to get the breaks anyway, is a regular R data.frame, for example:
>>
>> DTM.df <- as.data.frame(DTM)
>> DTM_class <- classIntervals(DTM.df, n=5, style="fisher")
>>
>
> I am replying to myself as I may have omitted part of the answer -- my apologies. Start the same way:
>
> DTM.df <- as.data.frame(DTM)
>
> then get variable names:
>
> names(deltaYieldVector.df)
>
> then use the variable of interest (altitude, I guess):
>
> DTM_class <- classIntervals(DTM.df$varOfInterest, n=5, style="fisher")
>
> This should work; we were feeding a data.frame as input to classIntervals, whereas a variable is needed (e.g. one of the variables in the data.frame).
>
> Let me know how it goes.
>
> Kind regards,
>
> Luigi
-------------- parte successiva --------------
Un allegato HTML ? stato rimosso...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20120517/30f6ec24/attachment.html
More information about the grass-user
mailing list