Hi, I have a dataset and calculated the time difference between two time variables. The output is somewhat like *"1/29/2324 1:57:39 AM".* I want to plot a histogram for this variable. When I gave *hist()* command it returned an error saying *"Error in hist.default(num) : 'x' must be numeric"* Can anybody guide me on this as to how should I plot the histogram for this? Thanks, Shreyasee [[alternative HTML version deleted]]
On 18/06/09 06:38, Shreyasee wrote:> Hi, > > I have a dataset and calculated the time difference between two time > variables. > The output is somewhat like *"1/29/2324 1:57:39 AM".* >That is not a time difference you have calculated. (x<-difftime("2009-12-31 12:00","2009-01-01 08:45")) # Time difference of 364.1354 days Change your calculation to be a time difference and you should be fine. See help("strftime") if needed. Always post self-contained code examples. Allan