logGen: Generate a state summarization

Description Usage Arguments Value Author(s) Examples

Description

turn a time series of state data into a time standardized summary log file. Creates a matrix where each row is a time step and each column represents the number of a state occured within that time period

Usage

1
logGen(state_rec, times, Time_Step, start, end, states = NULL)

Arguments

state_rec

vector of states

times

POSIX vector representing the time that each state was recorded

Time_Step

the number of seconds that the data will be binned over

start

POSIX item refering to when the log file will start

end

POSIX item refering to when the log file will end

states

a vector listing all the states to be included in the log file

Value

A matrix with each column representing a single state. The number of columns will default to to the number of unique states, unless the states argument is supplied. Each row represents a time step, with the number of rows being dependent on the start and end argument. Each cell represents the number of times that that state occured between t and t+1.

Originally designed to determine the number of detections on acoustic receivers over time.

Author(s)

Connor F. White

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
station<-sample(c("A","B","C"),size=200,replace=TRUE)
start<-as.POSIXct("2016-04-26")
end<-start<-as.POSIXct("2016-04-28")
time<-seq(start,end,length.out=50)
time<-rep(time,4)
time<-time+rnorm(200,mean=3600)


#Generate a log file every hour
logGen(state_rec=station,times=time,Time_Step=3600,start=start,end=end)

#generate a log file ever 5 mins
logGen(state_rec=station,times=time,Time_Step=300,start=start,end=end)

#supply a list of states to possibly standardize, even if the state never offccured in this example

logGen(state_rec=station,times=time,Time_Step=3600,start=start,end=end,states=c("A","B","C","D"))

ConnorFWhite/AssFunc documentation built on May 20, 2019, 4:07 p.m.