title: embed R leaflet map in wordpress
body: <p>I have just created a simple interactive map using leaflet package in R. Something like this</p>
  
  <pre><code>leaflet() %&gt;% addTiles() 
  </code></pre>
  
  <p>Now I would like to embed it in my wordpress website. </p>
  
  <p>I clicked on the export button of RStudio Viewer and chosen "Save as web page...", then stored the .html in my local computer. </p>
  
  <p>I tried to embed this map in a post in my WP website by clicking on "Add a media" in the editor of the page and the choosing the .html previously stored. But I get the error: </p>
  
  <p>"1 file could not be uploaded because the file type is not supported."</p>
  
  <p>I tried to open the html file in an editor and copy and paste the (very long, full of coordinates) html code into the html tab of WP page editor. The editor convert this code into</p>
  
  <pre><code>&lt;div id="htmlwidget_container"&gt;
  &lt;div id="htmlwidget-2390" class="leaflet html-widget" style="width: 100%; height: 400px;"&gt;&lt;/div&gt; &lt;/div&gt;
  </code></pre>
  
  <p>and I don't see any map in the visual tab. 
  I really don't know how to proceed. Any help will be appreciated. As you have noticed I am completely new to WP and web applications.</p>
  
  <p>Thanks a lot,
  jacopo</p>