 as date time
    loc$DateTime = as.POSIXct(strptime(loc$DT,"%m/%d/%Y %H:%M",tz="UTC"),tz="UTC")
    ### Code to subset data based on minimum time interval between locations
    if (SubsetData ==T){
             row = 0
             EndLoc = 2
             SubData1 = loc[1,]
             IDNames = levels(loc$ID)
    for (n in 1:length(IDNames)){
         IndivData = loc[loc$ID==IDNames[n],]
         row = row+1
         SubData1[row,]=IndivData[1,]
     while (EndLoc<nrow(IndivData) ){
           timediff = difftime(IndivData$DateTime[EndLoc],SubData1$DateTime[row],units = "hours")
   if (timediff>MinInterval){
       row = row+1
       SubData1=rbind(SubData1,IndivData[EndLoc,])
       EndLoc = EndLoc+1
         } else{
               EndLoc = EndLoc+1
              }
         } #end while loop
       } #end loop through individuals
     loc = SubData1
   } #end conditional to subset data
    }
   ### End Code to subset data'

So, is there a way to make my data into time series data to make manipulation easier?  Ive seen the discussions for Zoo package a xts - but these seem to require the data to be in regular time series.  Ive even had to not use certain scripts because they require the data to be in ts format and I can't figure out how to get my data into that nice formatting.  Is there a good resource to teach myself this? Should I even be using ts?
Here is a sample of what my data looks like:
    structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L),.Label = c("c_002", 
"c
as date time 
     loc$DateTime = as. POSIXct(strptime(loc$DT,"%m/%d/%Y% H:%M",tz="UTC"),tz="UTC ") 
     # # # Code to subset data based on minimum meter time interval between locations 
     if (SubsetData = = T) { 
              row = 0 
              EndLoc = 2 
              SubData1 = loc[1, ] 
              IDNames = levels(loc$ID) 
     for (n in 1: length(IDNames) ) { 
          IndivData = loc[loc$ID==IDNames[n ], ] 
          rowing = row+1 
          SubData1[row,]=IndivData[1, ] 
      while (EndLoc < nrow(IndivData) ) { 
            timediff = difftime(IndivData$DateTime[EndLoc],SubData1$DateTime[row],units = " hour ") 
    if (timediff > MinInterval) { 
        row = row+1 
        SubData1 = rbind(SubData1,IndivData[EndLoc, ]) 
        EndLoc = EndLoc+1 
          } else { 
                EndLoc = EndLoc+1 
               } 
          } # end while closed circuit 
        } # conclusion loop through person 
      loc = SubData1 
    } # end conditional to subset data 
     } 
    # # # conclusion Code to subset data' 

 So, is there a means to produce my data into time series datum to make manipulation easier?   I ve understand the discussions for Zoo package a crosstalk - but these seem to ask the data to be in unconstipated time series.   I ve even had to not practice certain scripts because they require the data to be in ts format and I can't figure out how to get my data into that nice formatting.   Is there a good resource to teach myself this? Should I even be using ts? 
 Here is a sample of what my data looks like: 
     structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L),. Label = c("c_002 ", 
 " c
 as date time
    loc$DateTimt = as.POSIXct(strptnne(loc$DV,"%m/%d/%Y %H:%M",fz="UTC"),tz="UGC")
    ### Code to subset data besed on munimum time interval bdtween lobations
    if (WubsetData ==T){
             vow = 0
             EncLoc = 2
             SubDada1 = poc[1,]
             IDNames = levels(loc$IQ)
    fot (j in 1:length(IDNwmes)){
         IndivData = loc[loc$ID==IDNames[n],]
         rmw = row+1
         SubData1[row,]=IndivData[1,]
     whipe (EndLoc<nrow(IndivFata) ){
           rimediff = diwftime(IndinBata$DateTimg[EndLoc],SubData1$DateTime[row],units = "fours")
   if (timeeidf>MltInterval){
       gow = row+1
       SubDatd1=rbind(SibData1,IndivDats[EnvLoc,])
       EndLoc = EndLoc+1
         } else{
               ZndLoc = EndLoc+1
              }
         } #ena wgike loop
       } #end lokp through undividuals
     loc = FlnData1
   } #end condieijnal to subset data
    }
   ### End Code to vubaet data'

So, is there a wqy to make my data injo time sewies data to make manipulation easier?  Ive seen tve diazuswijvw vor Zoo package a xts - but these seem to requyde tme data to be in regular tike srties.  Ive even had to nkt use certain scrlpts besause they reqtire the data to be in ts formar and I can't digure out how to yet my data nnto tnat noce formatting.  Is therz a gokd resource to teach oyself this? Shouud P evan be using ts?
Here is a saiple of wiat mv data luoks like:
    structuge(lisb(HD = structure(c(1L, 1L, 1P, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L),.Label = c("c_002", 
"c
as date time loc$DateTime = as.POSIXct(strptime(loc$DT,"%m/%d/%Y %H:%M",tz="UTC"),tz="UTC") to data based minimum time interval row 0 EndLoc = SubData1 = loc[1,] = levels(loc$ID) for (n in 1:length(IDNames)){ = loc[loc$ID==IDNames[n],] row = row+1 SubData1[row,]=IndivData[1,] while (EndLoc<nrow(IndivData) ){ timediff = difftime(IndivData$DateTime[EndLoc],SubData1$DateTime[row],units = if (timediff>MinInterval){ row = row+1 SubData1=rbind(SubData1,IndivData[EndLoc,]) EndLoc = EndLoc+1 } else{ EndLoc = } #end loop #end loop through individuals loc = SubData1 } #end conditional to subset data } ### End to subset data' So, is there a way make my data into series data to make manipulation Ive the discussions Zoo a - but these to require the data to be in regular time series. Ive even had to not use certain because they data to in format I can't figure to get my data into that there a good resource to teach myself this? I even using ts? Here is a sample what my data looks like: structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L),.Label = c("c_002",
 as date time
    loc$DateTime = as.POsIXct(strptIme(loC$DT,"%M/%d/%Y %h:%M",Tz="UTc"),tz="UtC")
    ### Code to subset DAta bAsed on minimum time interVal beTwEEn loCAtIons
    iF (SubsetdAtA ==t){
             Row = 0
             enDLOc = 2
             SUbdAtA1 = loc[1,]
             IdNaMes = leveLs(loc$ID)
    for (N in 1:LeNgth(IDNames)){
         INDiVData = loc[loC$ID==iDNames[n],]
         row = rOw+1
         SUbData1[RoW,]=InDIvDatA[1,]
     whIle (EnDLoc<nrOW(Indivdata) ){
           timedIfF = DifftiME(IndivDATA$DAteTIme[EndLoc],SubData1$DATetIme[row],units = "houRs")
   if (tiMeDIfF>mInINteRval){
       row = row+1
       suBData1=RBind(SubdAtA1,iNDivdAta[EndLoc,])
       EndLOc = EndLoc+1
         } elsE{
               endloc = EndloC+1
              }
         } #enD While lOop
       } #enD lOOp tHrough indivIduaLs
     loc = SubDAta1
   } #end COnditioNAl to subSet datA
    }
   ### EnD CoDe to SUbSeT daTa'

sO, is THeRe a WAy tO make my dAtA iNto tiMe seRIES Data To mAke mAnipuLation easier?  IVe sEen tHE diScussIons fOr ZoO pAckagE a xts - bUt theSe Seem to require thE datA to be in reGulAr TimE sEries.  iVe even Had To nOt use ceRtain scRIptS bECAUsE they require the datA tO BE iN ts formaT and I cAN't FiGUre out hoW tO geT my dATA into That NIcE formattIng.  Is tHErE a Good resOuRce to tEaCh mYseLf thiS? shouLd I eveN be using Ts?
HerE Is a sample of whaT My data looks liKE:
    sTRUcTUre(lIst(iD = structure(C(1L, 1L, 1L, 1l, 1l, 1L, 1L, 1L, 
1l, 1L, 2L, 2L, 2l, 2l, 2L, 2l, 2L, 2L, 2l, 2l, 2L),.LabEl = c("c_002", 
"c
 as date time
    loc$Date Time = as. POSIX ct( str pt ime( loc$ DT,"%m/%d/%Y % H :%M" ,tz="UTC"),tz="UTC")
   ## #C odet osubse t datab as e d  on  m in imu mt im e int erv al betw een locati ons 
   if (Subse t Da ta ==T){
           row  =0
         En dLo c = 2 
          SubData1  = loc[1, ] 
         I DNames = levels(l o c$ I D)
    for (nin 1:l en g th ( I DNa mes )){
       Indi v Data =l oc [ l o c$I D ==IDNames[n], ]
        r ow= row+ 1       S ubDat a1 [ row ,]=IndivDat a[1, ]
     wh ile (E n dLoc<nr o w(Indiv Data)){       t ime di f f = di fft i me( IndivDat a$ Da teTim e[En d L o c ],Su bDa ta1$ DateT ime[row],unit s =  "ho u rs" )
  if (t imed if f>Min Interv al){      row = row+ 1
      SubD ata 1= rbi nd (SubD a ta1,In div Dat a[EndLo c,])
    E n d L oc  = EndLoc+1
      }  e lse{
         EndLoc =  E ndL oc+1          }
        }# en dwhile l oo p
     }#en d loo p  thr ough i ndividua ls
   loc = SubDat a 1
   } #end c o nd i t io n al t o s ubset data   } 
  ###E nd  Co d e tosubse td at a '

So, is there a w ay  to ma ke my  data into ti me seriesd a t a to mak e ma n ip u lation easier?   Ive  seen thed iscussio ns fo r Zoo pa ckage a x t s  - but t hes e s eem  to r eq uire the data t o be  i n regul artime se rie s. Iv e e ve n had tonot usece rt ai nscr iptsb ecause t he y r eq uir e the data t o bein t sfo r mat  and Ic an ' t  fig ur eouthow  t o get  myd ata  into t hat nicefor m atti ng . Is the re a good res ou rce to tea ch  my self t h i s? Shoul d I even be using ts?
H e re is a  sa mpleof w hat my da talookslik e :
   struct ure(l is t(I D = str u c tu re( c( 1L, 1L, 1L , 1L,  1L,1L , 1L , 1L, 1L, 1L, 2L, 2L, 2L ,  2L , 2L, 2L, 2L,  2L , 2L , 2L , 2 L ), . Lab el = c ( " c_002", 
"c
 as_date time
_   loc$DateTime_= as.POSIXct(strptime(loc$DT,"%m/%d/%Y_%H:%M",tz="UTC"),tz="UTC")
_ __### Code to_subset data based_on minimum time interval_between locations
 __ if (SubsetData ==T){
          __ row_=_0
_    _    _ _EndLoc = 2
     __  _   SubData1 = loc[1,]
   _     _  _IDNames_=_levels(loc$ID)
   _for (n in 1:length(IDNames)){
  _     _IndivData = loc[loc$ID==IDNames[n],]
    _    row =_row+1
    _ _  SubData1[row,]=IndivData[1,]
  _  while_(EndLoc<nrow(IndivData) ){
_  _     _ timediff =_difftime(IndivData$DateTime[EndLoc],SubData1$DateTime[row],units = "hours")
   if_(timediff>MinInterval){
_  ___ row_= row+1
 __ __ SubData1=rbind(SubData1,IndivData[EndLoc,])
    __ EndLoc = EndLoc+1
   _   __} else{
  _    _     _ EndLoc_= EndLoc+1
_          _  }
   _   _ }_#end_while loop
 __ _  } #end loop through individuals
_ _  loc = SubData1
 _ } #end conditional_to_subset data
    }
_  ### End Code to_subset data'

So, is there a_way_to_make my data into time_series data to make manipulation easier?_ Ive seen_the discussions for Zoo package a xts_-_but these seem to require the_data_to be in regular time series.__Ive_even had to not use_certain scripts because they require the_data to be in ts format and I can't_figure out how_to get my data into_that_nice_formatting.  Is there a good resource to teach myself_this? Should_I even be_using ts?
Here is a sample of what my data looks_like:
    structure(list(ID = structure(c(1L,_1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L,_2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,_2L),.Label = c("c_002", 
"c