Hello, I have a csv file that consists of one column. The column presents the date of posting on a website. I want to plot a histogram to see how the number of posts varies over the years. The file contains the years (2012 to 2016) and consists of 11,000 rows.
You will need to write a format string, starting with “%a %b” to tell the function how to parse the particular date/time format in your file. What format string do you need to use?
It seems like you have already managed to plot the requested histogram, could you explain what your specific problem is? Also please take a look to our homework policy, you are not supposed to include verbatim instructions.
Thanks for letting us know this is a homework question.
Firstly, your challenge with formatDate <- strptime(as.character(postsData$Date),format="“%d/%m/%y")
is
note the typo of the extra “ in the format argument
In format you need to get the right conversion specifications. Note the example, "16/12/14 3:34", that appears to be day/month/year hour:minute. Have a look at your link for all the conversation specifications.