[R] What is best way to calculate % of time?

Neotropical bat risk assessments neotrop|c@|@b@t@ @end|ng |rom gm@||@com
Wed Dec 25 13:28:54 CET 2019


Hi all,

It seems R has gotten better/more packages in dealing with time data.

I want to create "simple" summaries of time for bat activity.
Data is all in an Access relational database and exported as a CSV file 
with 4 columns in this format:
Species = a 6 letter code or "Buzz" to indicated when bats are feeding
Location = a 4 digit number
Date= MMDDYYYY
Time=HH:MM (24 hr format)

Species    Location    Date    Time
Buzz    7716    1/25/2000    0:05
Buzz    7716    1/25/2000    0:05
Buzz    7716    1/25/2000    0:05
Buzz    7716    1/25/2000    0:47
Buzz    7716    1/25/2000    0:47
Buzz    7716    1/25/2000    0:47
Buzz    7716    1/25/2000    0:47
Buzz    7717    7/3/2000    20:17
Buzz    7717    7/3/2000    20:17
Buzz    7717    7/3/2000    20:17
Buzz    7717    7/3/2000    20:17
Buzz    7717    7/3/2000    20:30
Buzz    7717    7/3/2000    20:30
Buzz    7717    7/3/2000    20:30
Buzz    7717    7/3/2000    20:30
Ptedav    7717    7/3/2000    20:14
Ptedav    7717    7/3/2000    20:15
Ptedav    7717    7/3/2000    20:15
Ptedav    7717    7/3/2000    20:15
Ptedav    7717    7/3/2000    20:15
Ptedav    7717    7/3/2000    20:15
Ptedav    7717    7/3/2000    20:17
Ptedav    7717    7/3/2000    20:17
Ptedav    7717    7/3/2000    20:17
Ptedav    7717    7/3/2000    20:18
Ptedav    7717    7/3/2000    20:18
Ptedav    7717    7/3/2000    20:18
Ptedav    7717    7/3/2000    20:18
Ptedav    7717    7/3/2000    20:18
Ptemes    7717    7/3/2000    23:15
Ptemes    7717    7/3/2000    23:21
Ptemes    7717    7/3/2000    23:22
Ptemes    7717    7/3/2000    23:23
Ptemes    7717    7/3/2000    23:25
Ptemes    7717    7/3/2000    23:26
Ptemes    7717    7/3/2000    23:27
Ptemes    7717    7/3/2000    23:28
Ptemes    7717    7/3/2000    23:29
Ptemes    7717    7/3/2000    23:33
Ptemes    7717    7/3/2000    23:35
Ptemes    7717    7/3/2000    23:36
Ptemes    7717    7/3/2000    23:37

The above is clearly not a complete DF but only a format sample. Data 
begins when the first bat was recorded and ends when the last bat was 
recorded.  So all are times from sunset to sunrise.  Dates roll over so 
for example one night of data would begin at 18:00 1/1/2000 and end 
06:00 1/2/2000.

What I need to do is have a summary of Buzz events (feeding) and 
calculate the percentage of total time bats were active and have a 
summary of time feeding buzz was recorded and total bat activity to 
determine what percentage of time was spent with feeding attempts over 
the active period.

This by all bats by survey night and by single species by survey night.
Any suggestions welcomed.

Happy holidays all


-- 
Bruce W. Miller, PhD.
Neotropical bat risk assessments
Conservation Fellow - Wildlife Conservation Society

If we lose the bats, we may lose much of the tropical vegetation and the lungs of the planet

Using acoustic sampling to identify and map species distributions
and pioneering acoustic tools for ecology and conservation of bats for >25 years.

Key projects include providing free interactive identification keys and call fact sheets for the vocal signatures of New World Bats



More information about the R-help mailing list