1

I am trying to subset a spatial point data frame using the function subset as follows:

    data(puechabonsp)
    Chou.subset <- subset(puechabonsp,puechabonsp$relocs$Name=="Chou")

I was expecting to get all rows of the individual named "Chou" but instead, I got an empty list. Obviously I am doing it wrong and would apprentice some help.

Thanks! Idan

Idan
  • 43
  • 6

1 Answers1

1

The puechabonsp variable contains 2 parts, a fixed map in the $map part and some tracks in the $relocs part. If you only want to know the locations where a specific animal is you can do this.

Chou.subset <- puechabonsp$relocs[puechabonsp$relocs$Name=='Chou',]
Andrew Chisholm
  • 6,362
  • 2
  • 22
  • 41