How to remove date from strptime and plot

I have a variable, time, that is in Hour-Second-Minute format.

time <- "01:01:52"

I want to have a new time-format variable, time2.

I try:

strptime(db[1,10], format = "%H:%M:%S")

This returns

"2014-01-30 01:01:52"

How do I get rid of the Year-Month-Date portion of this?

I have absolutely no attachment to the "POSIXlt" or "POSIXt" classes. I am trying to plot a bunch of times on a histogram. Can I use ggplot2 to do so? If not, what is the best way to plot times?

Answers


Have a look at the ggplot2 scale_x_datetime example:

http://docs.ggplot2.org/0.9.3.1/scale_datetime.html

the examples will show you ways to format as time only.


Need Your Help

Script is re-reading arguments

linux bash shell scripting

When I supply the script with the argument: hi[123].txt it will do exactly what I want.

How can I check whether a word is reserved by PHP?

php reserved-words

Is there some function for checking whether a word is reserved in PHP or I can use it myself? I can check it manually: just use it and see the error or warning, but I need to automate this check. Is