title: Magic %% commands in R inside Jupyter
body: <p>How do I run %%magic in R inside Jupyter?</p>
  
  <pre><code>%%javascript
  IPython.OutputArea.auto_scroll_threshold = 99999;
  </code></pre>
  
  <p>The auto scroll feature on longer output is vastly annoying as I have several functions and scripts that spit out a lot of output.</p>
  
  <p>The above Javascript works fine in python notebooks but not in R notebooks.</p>
  
  <p>When I run the %% magic command in R, it barfs:</p>
  
  <pre><code>Error in parse(text = x, srcfile = src): &lt;text&gt;:1:1: unexpected SPECIAL
  1: %%
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <hr>
  
  <p>According to this post <a href="https://github.com/minrk/ipython_extensions/blob/master/extensions/disable_autoscroll.py" rel="nofollow">disable_autoscroll.py</a>, it may be possible to put that Javascript into a profile_dir/static/js/custom.js file.  Pray tell, where is the profile_dir on a Windows box?</p>
  
  <p>I found: <code>c:/Anaconda2/Lib/site-packages/notebook/static/custom/custom.js</code> but that is the central custom.js file.  </p>
  
  <hr>
  
  <p>References:</p>
  
  <p><a href="https://github.com/ipython/ipython/issues/2172" rel="nofollow">Auto-scrolling of long output should be configurable in the UI</a></p>