I've got a large data group of Gps navigation collar locations where possess a different quantity of locations every day. I wish to separate out just the days which have just one location collected making a new data frame that contains almost all their information.

month    day    easting    northing    time    ID
  6       1     #######    ########    0:00    ##
  6       2     #######    ########    6:00    ##
  6       2     #######    ########    0:00    ##
  6       3     #######    ########    18:00   ##
  6       3     #######    ########    12:00   ##
  6       4     #######    ########    0:00    ##
  6       5     #######    ########    6:00    ##

Presently I've hashed together something, but can't quite arrive at the next thing.

library(plyr)
dog<-count(data1,vars=c("MONTH","day"))
datasub1<-subset(dog,freq==1)

This provides us a readout that appears like

    MONTH day freq
1       6  29    1
7       7   5    1
8       7   6    1
10      7   8    1
12      7  10    1

I'm attempting to make use of the values from the Month and day to drag the rows which contain them in the primary dataset to ensure that I can produce a data frame that contains just the points having a frequency of just one but that consists of all of the connected data. I have got until now:

sis<-c(datasub1$MONTH)
bro<-c(datasub1$day)
datasub2<-subset(data1,MONTH==sis&day==bro)

... but that does not produce anything, personally it can make intuitive sense (R beginner) it should subset the rows which contain both values of bro and sis.

Any help could be greatly appreciated.

Following this:

library(plyr)
dog<-count(data1,vars=c("MONTH","day"))

do this:

indx = which(dog$freq==1)
data1[indx,]

Modified:

datasub2<-subset(data1, paste(month,day,sep=".") %in% paste(datasub1$MONTH, datasub1$day,sep=".") )

It's not so likely (and potentially impossible) that any particular MONTH item will exactly equal that subset. You're most probably interested in whether a combo of "Month.Day" is within the combo teams of "Month.Day" within the datasub1. You've confused the capital that returns in the count() function when the headers were while you highlighted.

> dog
  month day freq
1     6   1    1
2     6   2    2
3     6   3    2
4     6   4    1
5     6   5    1
> datasub1
  month day freq
1     6   1    1
4     6   4    1
5     6   5    1
> datasub2
  month day easting northing time ID
1     6   1 ####### ######## 0:00 ##
6     6   4 ####### ######## 0:00 ##
7     6   5 ####### ######## 6:00 ##
data1[rownames(datasub1), ]

It is really an extension from the OP's original thinking but might not be what they are after and it is really precisely what Wesley recommended but transporting the OP's original steps yet another forward (without the bro sis part which confused me a little because...well for the similar reason DWin stated :)). You are following the rownames not necessarily the values in individuals posts. You've already got that information. The row names carry that information to the initial data set.

n <- 100
data1 <- data.frame(
    Accuracy = round(runif(n, 0, 5), 1),
    MONTH    = sample(1:5, n, replace=TRUE),
    day      = sample(1:28, n, replace=TRUE),
    Easting  = rnorm(n),
    Northing = rnorm(n),
    Etc      = rnorm(n)
)


library(plyr)
dog<-count(data1,vars=c("MONTH","day"))
datasub1<-subset(dog,freq==1)

data1[rownames(datasub1), ]