[R] newb question: chron and hist()

kensuguro magronbass at gmail.com
Tue Jan 26 18:11:38 CET 2010


Hi all, I'm just getting started in R so bear with my newbness.
I am trying to create a very simple histogram of logins by time, with data
coming in from a MYSQL query.

the raw data looks like this:
"id" "user_id" "experience_given" "created_at" "ip_aton"
"1" XXXXXXX 2445626 0 "2010-01-21 00:00:01" 1123632036
"2" XXXXXXX 2444945 0 "2010-01-21 00:00:01" 1123632036

After searching around for how to deal with the timestamp, I settled with
converting to POSIXct, and creating a chron object with as.numeric().  So I
managed to replace the timestamps with chron objects.
command:
bt$created_at = chron(as.numeric(as.POSIXct(bt$created_at)))

Seems very roundabout, but gets the job done.  I also see that I could just
use the numerical value instead, if readability wasn't an issue.

The problem is, when I try to hist(bt$created_at), I get errors:
Error in axis(2, adj = adj, cex = cex, font = font, las = las, lab = lab,  : 
  'labels' is supplied and not 'at'
In addition: Warning messages:
1: In plot.window(xlim, ylim, log = log, ...) :
  "histo" is not a graphical parameter
2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
  "histo" is not a graphical parameter

and the histogram looks busted like this:
http://n4.nabble.com/file/n1294762/picture236.png 

Any ideas?  I'm quite lost here, and having trouble finding date-time
specific info.  I do get the gist that chron is supposed to be the key, but
I'm having a hard time understanding an overview of all the different time
related classes.  thnx for any advice in advance.
-- 
View this message in context: http://n4.nabble.com/newb-question-chron-and-hist-tp1294762p1294762.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list