The timestamp data is in chr as follows:
posted_at: chr "2012-01-29 19:48:33" "2012-02-02 15:53:13" "2012-10-24 17:11:40" "2014-07-12 17:00:00" ...
[1] "2012-01-29 19:48:33" "2012-02-02 15:53:13" "2012-10-24 17:11:40" "2014-07-12 17:00:00" "2014-07-31 08:08:31"
[6] "2014-07-31 10:48:25" "2014-08-06 09:24:38" "2015-06-16 15:55:28" "2015-06-16 19:56:28" "2015-06-25 17:20:29"
[11] "2015-06-26 18:28:31"
I tried converting it using strptime() :
tweet_text$posted_at <- strptime(trump_text$posted_at, "%Y-%m-%d %H:%M:%S")
It gets converted as follows:
posted_at: POSIXlt, format: "2012-01-29 19:48:33" "2012-02-02 15:53:13" "2012-10-24 17:11:40" "2014-07-12 17:00:00" ...
[1] "2012-01-29 19:48:33 AEDT" "2012-02-02 15:53:13 AEDT" "2012-10-24 17:11:40 AEDT" "2014-07-12 17:00:00 AEST"
[5] "2014-07-31 08:08:31 AEST" "2014-07-31 10:48:25 AEST" "2014-08-06 09:24:38 AEST" "2015-06-16 15:55:28 AEST"
[9] "2015-06-16 19:56:28 AEST" "2015-06-25 17:20:29 AEST" "2015-06-26 18:28:31 AEST" "2015-07-01 15:58:41 AEST"
[13] "2015-07-01 18:05:15 AEST
How do I use hist() to plot this timestamp data based on years and count and other different combinations .



barplot(table(format(trump_text$posted_at, '%Y')))