I use this Matlab code:
load ~/emailAnalysis/results.txt results=results(size(results,1)-400:size(results,1),:) temp = results(:,3)-1238370000; h=plot(temp,smooth(results(:,1)),':b') set(h,'LineWidth',1) ylim([0 80]) xlim([max(temp)-(86400*7),max(temp)-1]) set(gca,'XGrid','on') ylabel('Emails') hold on i=plot(temp,smooth(results(:,4)),'r') j=plot(temp,smooth(results(:,5)),'-g') k=plot(temp,smooth(results(:,6)),'m') xlim([max(temp)-(86400*7),max(temp)-1]) set(gca,'XTick',[1:86400:(86400*max(temp))+1]) set(gca,'XTickLabel',['Mon';'Tue';'Wed';'Thu';'Fri';'Sat';'Sun']) set(j,'LineWidth',2) set(h,'LineWidth',1) set(i,'LineWidth',2) set(k,'LineWidth',2) xlabel('Time') title('Size of inbox over time (seven days)') print -r3000 -djpeg /XXXX/inbox7day.jpeg hold off
to generate this graph:
from data like:
34 2012-01-21 1327152611 5 16 10 32 2012-01-21 1327154411 5 14 9 32 2012-01-21 1327156209 5 14 9 34 2012-01-21 1327158012 5 14 9 34 2012-01-21 1327159808 5 15 9 34 2012-01-21 1327161611 5 15 9 34 2012-01-21 1327163406 5 15 9 33 2012-01-21 1327165211 5 13 9 34 2012-01-21 1327167011 5 13 9 31 2012-01-21 1327168810 4 12 8
but it's a little slow, and also probably not very elegant (it's my first use of Matlab) I'm interested in any tips for best practice, tips for speeding it up, or examples of how I might do the same things in R...