What data format is required for space usage analysis in the adehabitatHR package in R?

Asked

Viewed 42 times

2

I am working with location data (latitude and longitude coordinates obtained from GPS) to delimit living areas with kernel and MCP in the Adehabitathr package. I have already prepared the excel file containing individuals' names, information such as gender and reproductive condition, and X and Y coordinates.

What I have is something similar to the one below, but including at least 50 individuals and several locations of each:

Ind Sex  X        Y
A    1   19.10991 -48.23536
B     2  19.11009 -48.23545

I follow the commands of the package and ask to transform the file in sp format:

coordinates(track) <- c("X", "Y")

And I keep getting the same mistake:

Error in `[.data.frame`(object, , value) : undefined columns selected

I’ve tried to do it another way too:

tracksp<- SpatialPoints(track)

And then I get the mistake below:

Error in .checkNumericCoerce2double(obj) : 
  cannot retrieve coordinates from non-numeric elements

I am stuck. I believe it is the format that my coordinates are showing in excel, so that R can understand them. You can help me?

Thank you

  • 1

    What is track? It is the dataset that has the columns Ind, Sex, X and Y? It would be interesting if you could release the output of the command dput when applied in your database. So it would be easier for users here to help you with your problem.

  • As Marcus said, it would be good if you put the result of the dput. It seems to me that you are doing it right... it is possible that the problem is in the name of the columns: when you imported they did not get spaces?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.