convertToSeconds {petersenlab} | R Documentation |
Convert Time to Seconds.
Description
Convert times to seconds.
Usage
convertToSeconds(hours, minutes, seconds, HHMMSS, HHMM, MMSS)
Arguments
hours |
Character vector of the number of hours. |
minutes |
Character vector of the number of minutes. |
seconds |
Character vector of the number of seconds. |
HHMMSS |
Times in HH:MM:SS format. |
HHMM |
Character vector of times in HH:MM format. |
MMSS |
Character vector of times in MM:SS format. |
Details
Converts times to seconds. To convert times to hours or minutes, see convertToHours or convertToMinutes.
Value
Vector of times in seconds.
See Also
Other times:
convertHoursAMPM()
,
convertToHours()
,
convertToMinutes()
Other conversion:
convert.magic()
,
convertHoursAMPM()
,
convertToHours()
,
convertToMinutes()
,
percentileToTScore()
,
pom()
Examples
# Prepare Data
df <- data.frame(hours = c(0,1), minutes = c(15,27), seconds = c(30,13),
HHMMSS = c("00:15:30","01:27:13"), HHMM = c("00:15","01:27"),
MMSS = c("15:30","87:13"))
# Convert to Minutes
convertToSeconds(hours = df$hours, minutes = df$minutes,
seconds = df$seconds)
convertToSeconds(HHMMSS = df$HHMMSS)
convertToSeconds(HHMM = df$HHMM)
convertToSeconds(MMSS = df$MMSS)
[Package petersenlab version 1.0.0 Index]