Removing dates put up automatically by data.table setDT in a data.frame

I am looking at having the average time that each species is spending in front of my camera.
So I created a data frame with my species name and corresponding time spent in front of camera (named duration)

species duration
wood pigeon 00:02:33
wood pigeon 00:04:12
pheasant 00:01:53
pheasant 00:01:23
pheasant 00:00:59
chaffinch 00:00:46
chaffinch 00:00:47

I am currently using this code:

df3 <- setDT(df)[,.(duration = mean(as.POSIXct(duration, format = "%H:%M:%S"))) , species]

The average time calculation for each species work BUT It adds the date of the day I'm running the code.
For example if today is 03/12/2020

species duration
wood pigeon 2020-12-03 00:03:23
pheasant 2020-12-03 00:01:25
chaffinch 2020-12-03 00:00:47

I wish to remove this 2020-12-03 date but have no idea how

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.