john brzustowski
unread,Jun 16, 2016, 9:21:03 PM6/16/16Sign in to reply to author
Sign in to forward
Sign in to report message as abuse
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Howell, Jessica, Motus Wildlife Tracking System
Hi Jessica,
On Thu, Jun 16, 2016, at 16:23, Howell, Jessica wrote:
> I used a test tag (#401) at each of the towers when we visited on
> Monday, to look at how signal strength and detection on different
> antennae changed as I walked a short distance from the tower at each
> of the cardinal and primary intercardinal directions. Now I have
> the all tags RDS file from Reed W in R, subsetted just the data from
> the test tag 401, and I am trying to subset antenna 1 so I can plot
> time and signal strength of all observations of 401 on this antenna.
> R says column antenna is a factor, but when I try to subset it as a
> factor it gives a data frame with all variables but 0 observations
> (See R code I used below). Would this be something you could help
> me with? No worries if not.
>
>
> x401<-subset(x, id == 401) #subsetting Reed W data (x) to only observations of tag 401
>
> ant1<-subset(x401, ant == 1) #subsetting antenna 1, have tried both with and without parentheses
[I'm taking the liberty of replying to the motus-wts google group]
Factors have 'levels' (i.e. values) that work like strings, rather than numbers.
So this:
ant1 <- subset(x401, ant == "1 ")
is probably what you want. And yes, for no reason that I can remember,
there's a space character after the 1; we'll probably change that at some point.
You can get the possible values of a factor by doing, e.g.:
levels(x401$ant)
from which you would see the "1 " as one possible value.
We provide the antenna as a factor to allow for the occasional non-numeric
antenna name in data from Lotek receivers (e.g. "AH0").
J.