Hi, The dataset has four time variables. Each variable has data in "1/6/2006 12:58:55 PM" format. I applied the subtraction function (=E2-D2) for calculating difference between variable1 and variable2 for each record. I copied those values and pasted in another column using "Paste special -> values" option. Then I imported the dataset into R and tried to plot histogram for this new column. At that time it gave an error *"Error in hist.default(third_var) : x should be numeric"*
Kindly provide your suggestions on the same. Thanks, Shreyasee On Thu, Jun 18, 2009 at 2:25 PM, Allan Engelhardt <all...@cybaea.com> wrote: > 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 > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.