Here is the link to very detailed list of IB data limitations:
https://www.interactivebrokers.com/en/software/api/apiguide/tables/historical_data_limitations.htm
I don't know about R or Python but in C# for IB TWS just for fun I did this:
http://www.bowgett.com/Blog/?tag=IbTalks
The app will replay movie quotes based on your trading.
I got bored and lonely :banghead: so I created an add-in to IB TWS that talks back to you when you trade. It monitors your trades and gives random famous movie quotes.
Hit loss it would say "I told you not to go there! I told you not to go there!" (Anger Management / 2003). Make profit and it...