<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>RSelenium on R Views</title>
    <link>https://rviews.rstudio.com/tags/rselenium/</link>
    <description>Recent content in RSelenium on R Views</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 13 May 2019 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://rviews.rstudio.com/tags/rselenium/" rel="self" type="application/rss+xml" />
    
    
    
    
    <item>
      <title>Virtual Morel Foraging with R</title>
      <link>https://rviews.rstudio.com/2019/05/13/virtual-morel-foraging-with-r/</link>
      <pubDate>Mon, 13 May 2019 00:00:00 +0000</pubDate>
      
      <guid>https://rviews.rstudio.com/2019/05/13/virtual-morel-foraging-with-r/</guid>
      <description>
        
&lt;script src=&#34;/rmarkdown-libs/htmlwidgets/htmlwidgets.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;/rmarkdown-libs/jquery/jquery.min.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;/rmarkdown-libs/leaflet/leaflet.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;/rmarkdown-libs/leaflet/leaflet.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;/rmarkdown-libs/leafletfix/leafletfix.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;/rmarkdown-libs/Proj4Leaflet/proj4-compressed.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;/rmarkdown-libs/Proj4Leaflet/proj4leaflet.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;/rmarkdown-libs/rstudio_leaflet/rstudio_leaflet.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;/rmarkdown-libs/leaflet-binding/leaflet.js&#34;&gt;&lt;/script&gt;


&lt;p&gt;&lt;em&gt;&lt;a href=&#34;http://illposed.net/&#34;&gt;Bryan Lewis&lt;/a&gt; is a mathematician, R developer and mushroom forager.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/2019-05-07-Lewis-Foraging_files/morchella-americana.jpg&#34; width=&#34;600&#34; height=&#34;600&#34;/&gt;&lt;/p&gt;
&lt;p&gt;                              Morchella Americana by Bryan W. Lewis, see &lt;a href=&#34;https://ohiomushroomsociety.wordpress.com/&#34; class=&#34;uri&#34;&gt;https://ohiomushroomsociety.wordpress.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;
It’s that time of year again, when people in the Midwestern US go nuts for morel
mushrooms. Although fairly common in Western Pennsylvania, Ohio, Indiana,
Illinois, Wisconsin, and, especially, Michigan&lt;a href=&#34;#fn1&#34; class=&#34;footnote-ref&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;, they can still be
tricky to find due to the vagaries of weather and mysteries of morel
reproduction.&lt;/p&gt;
&lt;p&gt;Morels are indeed delicious mushrooms, but I really think a big part of their
appeal is their elusive nature. It’s so exciting when you finally find some–or
even one!–after hours and hours of hiking in the woods.&lt;/p&gt;
&lt;p&gt;For all of you not fortunate to be in the Midwest in the spring, here is a
not-so-serious note on virtual morel foraging. But really, this note explores
ways you can mine image data from the internet using a cornucopia of data
science software tools orchestrated by R.&lt;/p&gt;
&lt;p&gt;Typical forays begin with a slow, deliberate hunt for mushrooms in the forest.
Morels, like many mushrooms, may form complex symbiotic relationships with
plants and trees, so seek out tree species that they like (elms, tulip tress,
apple trees, and some others). Upon finding a mushroom, look around and closely
observe its habitat, maybe photograph it, and perhaps remove the fruiting body
for closer inspection and analysis, and maybe for eating. The mushroom you
pick is kind of like a fruit - it is the spore-distributing body of a much
larger organism that lives below the ground. When picking, get in the habit of
carefully examining a portion of the mushroom below the ground because
sometimes that includes important identifying characteristics. Later, use
field guide keys and expert advice to identify the mushroom, maybe even
examining spores under a microscope. Sometimes we might even send a portion of
clean tissue in for DNA analysis (see, for instance,
&lt;a href=&#34;https://mycomap.com/projects&#34; class=&#34;uri&#34;&gt;https://mycomap.com/projects&lt;/a&gt;). Then, finally, for choice edible mushrooms like
morels, once you are sure of your bounty, cook and eat them!&lt;/p&gt;
&lt;p&gt;Edible morels are actually pretty easy to identify in the field. There &lt;em&gt;are&lt;/em&gt; a
few poisinous mushrooms that kind of look like morels, but on closer inspection
not really. Chief among them are the false morels or &lt;a href=&#34;https://en.wikipedia.org/wiki/Gyromitra&#34;&gt;Gyromitra&lt;/a&gt;, some of which we will find below in
our virtual foray!&lt;/p&gt;
&lt;p&gt;Our virtual foray proceeds similarly as follows:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;Virtually hunt for images of morel mushrooms on the internet.&lt;/li&gt;
&lt;li&gt;Inspect each image for GPS location data.&lt;/li&gt;
&lt;li&gt;Map the results!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, I know what you’re saying: most mushroom
hunters - especially morel hunters - are secretive
about their locations, and will strip GPS information from their pictures.
And we will see that is exactly the case: only about 1% of the pictures
we find include GPS data.
But there are &lt;em&gt;lots&lt;/em&gt; of pictures on the internet,
so eventually even that 1% can be interesting to look at…&lt;/p&gt;
&lt;div id=&#34;the-hunt&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;The Hunt&lt;/h2&gt;
&lt;p&gt;Our virtual mushroom foray begins as any real-world foray does, looking around
for mushrooms! But instead of a forest, we’ll use the internet. In particular,
let’s ask popular search engines to search for images of morels, and then
inspect those images for GPS coordinates.&lt;/p&gt;
&lt;p&gt;But how can we ask internet search engines to return image information directly
to R? Unfortunately, the main image search engines like Google and Bing today
rely on interactive JavaScript operation, precluding simple use of, say, R’s
excellent &lt;code&gt;curl&lt;/code&gt; package. Fortunately, there exists a tool for
&lt;em&gt;web browser automation&lt;/em&gt; called &lt;a href=&#34;https://docs.seleniumhq.org/&#34;&gt;Selenium&lt;/a&gt; and, of course, a corresponding R interface package called &lt;a href=&#34;https://cran.r-project.org/package=RSelenium&#34;&gt;&lt;code&gt;RSelenium&lt;/code&gt;&lt;/a&gt;.
&lt;code&gt;RSelenium&lt;/code&gt; essentially allows R to use a web browser like a human, including
clicking on buttons, etc. Using web browser automation is not ideal because
we rely on fragile front-end web page/JavaScript interfaces that can change
at any time instead of something well-organized like HTML, but we
seem to be forced into this approach by the modern internet.&lt;/p&gt;
&lt;p&gt;Our hunt requires that the Google Chrome browser is installed on your
system&lt;a href=&#34;#fn2&#34; class=&#34;footnote-ref&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;, and of course you’ll need R! You’ll need at least the
following R packages installed. If you don’t have them, install them from CRAN:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;library(wdman)
library(RSelenium)
library(jsonlite)
library(leaflet)
library(parallel)
library(htmltools)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let’s define two functions, one to search Microsoft Bing images, and another
to search Google images. Each function takes an &lt;code&gt;RSelenium&lt;/code&gt; browser and
a search term as input, and returns a list of search result URLs.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;bing = function(wb, search_term)
{
  url = sprintf(&amp;quot;https://www.bing.com/images/search?q=%s&amp;amp;FORM=HDRSC2&amp;quot;, search_term)
  wb$navigate(url)
  invisible(replicate(200, wb$executeScript(&amp;quot;window.scrollBy(0, 10000)&amp;quot;))) # infinite scroll down to load more results...
  x = wb$findElements(using=&amp;quot;class name&amp;quot;, value=&amp;quot;btn_seemore&amp;quot;) # more results...
  if(length(x) &amp;gt; 0) x[[1]]$click()
  invisible(replicate(200, wb$executeScript(&amp;quot;window.scrollBy(0, 10000)&amp;quot;)))
  Map(function(x)
  {
    y = x$getElementAttribute(&amp;quot;innerHTML&amp;quot;)
    y = gsub(&amp;quot;.* m=\\\&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, y)
    y = gsub(&amp;quot;\\\&amp;quot;.*&amp;quot;, &amp;quot;&amp;quot;, y)
    y = gsub(&amp;quot;&amp;amp;quot;&amp;quot;, &amp;quot;\\\&amp;quot;&amp;quot;, y)
    y = gsub(&amp;quot;&amp;amp;amp;&amp;quot;, &amp;quot;&amp;amp;&amp;quot;, y)
    fromJSON(y)[c(&amp;quot;purl&amp;quot;, &amp;quot;murl&amp;quot;)]
  }, wb$findElements(using = &amp;quot;class name&amp;quot;, value = &amp;quot;imgpt&amp;quot;))
}
google = function(wb, search_term)
{
  url = sprintf(&amp;quot;https://www.google.com/search?q=%s&amp;amp;source=lnms&amp;amp;tbm=isch&amp;quot;, search_term)
  wb$navigate(url)
  invisible(replicate(400, wb$executeScript(&amp;quot;window.scrollBy(0, 10000)&amp;quot;)))
  Map(function(x)
  {
    ans = fromJSON(x$getElementAttribute(&amp;quot;innerHTML&amp;quot;)[[1]])[c(&amp;quot;isu&amp;quot;, &amp;quot;ou&amp;quot;)]
    names(ans) = c(&amp;quot;purl&amp;quot;, &amp;quot;murl&amp;quot;) # comply with Bing (cf.)
    ans
  }, wb$findElements(using = &amp;quot;xpath&amp;quot;, value = &amp;#39;//div[contains(@class,&amp;quot;rg_meta&amp;quot;)]&amp;#39;))
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These functions emulate what a human would do by scrolling down to get more
image results (both web sites us an ‘infinite scroll’ paradigm), and, in the
Bing case, clicking a button. This is what I meant above when I said that this
approach is fragile and not optimal - it’s quite possible that some small change
in either search engine in the future will cause the above functions to not
work.&lt;/p&gt;
&lt;p&gt;Let’s finally run our virtual mushroom hunt! We set up a Google Chrome-based
&lt;code&gt;RSelenium&lt;/code&gt; web browser interface, and run some searches:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;eCaps = list(chromeOptions = list( args = c(&amp;#39;--headless&amp;#39;, &amp;#39;--disable-gpu&amp;#39;, &amp;#39;--window-size=1280,800&amp;#39;)))
cr = chrome(port = 4444L)
wb = remoteDriver(browserName = &amp;quot;chrome&amp;quot;, port = 4444L, extraCapabilities = eCaps)
wb$open()
foray = c(google(wb, &amp;quot;morels&amp;quot;),
          google(wb, &amp;quot;indiana morel&amp;quot;),
          google(wb, &amp;quot;michigan morel&amp;quot;),
          google(wb, &amp;quot;oregon morel&amp;quot;),
          bing(wb, &amp;quot;morels&amp;quot;),
          bing(wb, &amp;quot;morel mushrooms&amp;quot;),
          bing(wb, &amp;quot;michigan morels&amp;quot;))
wb$close()&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Feel free to try out different search terms. The result is a big list of possible
image URLs that just might contain pictures of morels with their coordinates.
This particular foray result above, run in late April, 2019, returned about
2000 results.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;identification&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Identification&lt;/h2&gt;
&lt;p&gt;Next, we scan every result for GPS coordinates using the nifty external
command-line tool called &lt;a href=&#34;https://www.sno.phy.queensu.ca/~phil/exiftool/&#34;&gt;&lt;code&gt;exiftool&lt;/code&gt;&lt;/a&gt;
and the venerable &lt;a href=&#34;https://curl.haxx.se/download.html&#34;&gt;&lt;code&gt;curl&lt;/code&gt; program&lt;/a&gt;.
If you don’t have those tools, you’ll need to install them on your computer.
They are available for most major operating systems. On Debian flavors of GNU/Linux
like Ubuntu it’s really easy, just run:&lt;/p&gt;
&lt;pre class=&#34;bash&#34;&gt;&lt;code&gt;sudo apt-get install exiftool curl&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once the &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;exiftool&lt;/code&gt; programs are installed, we can invoke them for each
image URL result from R to efficiently scan through part of the image for GPS
coordinates using these functions:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;#&amp;#39; Extract exif image data
#&amp;#39; @param url HTTP image URL
#&amp;#39; @return vector of exif character data or NA
exif = function(url)
{
  tryCatch({
    cmd = sprintf(&amp;quot;curl --max-time 5 --connect-timeout 2 -s \&amp;quot;%s\&amp;quot; | exiftool -fast2 -&amp;quot;, url)
    system(cmd, intern=TRUE)
  }, error = function(e) NA)
}
#&amp;#39; Convert an exif GPS character string into decimal latitude and longitude coordinates
#&amp;#39; @param x an exif GPS string
#&amp;#39; @return a named numeric vector of lat/lon coordinates or NA
decimal_degrees = function(x)
{
  s = strsplit(strsplit(x, &amp;quot;:&amp;quot;)[[1]][2], &amp;quot;,&amp;quot;)[[1]]
  ans = Map(function(y)
            ifelse(y[4] == &amp;quot;S&amp;quot; || y[4] == &amp;quot;W&amp;quot;, -1, 1) *
              (as.integer(y[1]) + as.numeric(y[2])/60 + as.numeric(y[3])/3600),
          strsplit(gsub(&amp;quot; +&amp;quot;, &amp;quot; &amp;quot;, gsub(&amp;quot;^ +&amp;quot;, &amp;quot;&amp;quot;, gsub(&amp;quot;deg|&amp;#39;|\&amp;quot;&amp;quot;, &amp;quot; &amp;quot;, s))), &amp;quot; &amp;quot;))
  names(ans) = c(&amp;quot;lat&amp;quot;, &amp;quot;lon&amp;quot;)
  ans
}
#&amp;#39; Evaluate a picture and return GPS info if available
#&amp;#39; @param url image URL
#&amp;#39; @return a list with pic, date, month, label, lat, lon entries or NULL
forage = function(url)
{
  ex = exif(url)
  i = grep(&amp;quot;GPS Position&amp;quot;, ex)
  if(length(i) == 0) return(NULL)
  pos = decimal_degrees(ex[i])
  date = tryCatch(strsplit(ex[grep(&amp;quot;Create Date&amp;quot;, ex)], &amp;quot;: &amp;quot;)[[1]][2], error=function(e) NA)
  month = ifelse(is.na(date), NA, as.numeric(strftime(strptime(date, &amp;quot;%Y:%m:%d %H:%M:%S&amp;quot;), format=&amp;quot;%m&amp;quot;)))
  label = paste(date, &amp;quot;  source: &amp;quot;, url)
  list(pic=paste0(&amp;quot;&amp;lt;img width=200 height=200 src=&amp;#39;&amp;quot;, url, &amp;quot;&amp;#39;/&amp;gt;&amp;quot;),
       date=date, month=month, label=label,
       lat=pos$lat, lon=pos$lon)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, there might be many search results to evaluate. Each evaluation is not
very compute intensive. And the results are independent of each other. So why
not run this evaluation step in parallel? R makes this easy to do,
although with some differences between operating systems. The following works
well on Linux or Mac systems. It will also run fine on Windows systems, but
sequentially.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;options(mc.cores = detectCores() + 2) # overload cpu a bit
print(system.time({
bounty = do.call(function(...) rbind.data.frame(..., stringsAsFactors=FALSE),
  mcMap(function(x)
  {
    forage(x$murl)
  }, foray)
)
}))
# Omit zero-ed out lat/lon coordinates
bounty = bounty[round(bounty$lat) != 0 &amp;amp; round(bounty$lon != 0), ]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above R code runs through every image result, returning those containing
GPS coordinates as observations in a data frame with image URL, date, month,
label, and decimal latitude and longitude variables.&lt;/p&gt;
&lt;p&gt;Starting with over 2,000 image results, I ended up with about 20 pictures
with GPS coordinates. Morels are as elusive in the virtual world as the
real one!&lt;/p&gt;
&lt;p&gt;Finally, let’s plot each result colored by the month of the image on
a map using the superb R &lt;code&gt;leaflet&lt;/code&gt; package. You can click on each point
to see its picture.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;colors = c(January=&amp;quot;#555555&amp;quot;, February=&amp;quot;#ffff00&amp;quot;, March=&amp;quot;#000000&amp;quot;,
           April=&amp;quot;#0000ff&amp;quot;, May=&amp;quot;#00aa00&amp;quot;, June=&amp;quot;#ff9900&amp;quot;, July=&amp;quot;#00ffff&amp;quot;,
           August=&amp;quot;#ff00ff&amp;quot;, September=&amp;quot;#55aa11&amp;quot;, October=&amp;quot;#aa9944&amp;quot;,
           November=&amp;quot;#77ffaa&amp;quot;, December=&amp;quot;#ccaa99&amp;quot;)
clr = as.vector(colors[bounty$month])
map = addTiles(leaflet(width=&amp;quot;100%&amp;quot;))
map = addCircleMarkers(map, data=bounty, lng=~lon, lat=~lat, fillOpacity=0.6,
         stroke=FALSE, fillColor=clr, label=~label, popup=~pic)
i = sort(unique(bounty$month))
map = addLegend(map, position=&amp;quot;bottomright&amp;quot;, colors=colors[i],
        labels=names(colors)[i], title=&amp;quot;Month&amp;quot;, opacity=1)
map&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;div id=&#34;htmlwidget-1&#34; style=&#34;width:100%;height:480px;&#34; class=&#34;leaflet html-widget&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-1&#34;&gt;{&#34;x&#34;:{&#34;options&#34;:{&#34;crs&#34;:{&#34;crsClass&#34;:&#34;L.CRS.EPSG3857&#34;,&#34;code&#34;:null,&#34;proj4def&#34;:null,&#34;projectedBounds&#34;:null,&#34;options&#34;:{}}},&#34;calls&#34;:[{&#34;method&#34;:&#34;addTiles&#34;,&#34;args&#34;:[&#34;//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png&#34;,null,null,{&#34;minZoom&#34;:0,&#34;maxZoom&#34;:18,&#34;tileSize&#34;:256,&#34;subdomains&#34;:&#34;abc&#34;,&#34;errorTileUrl&#34;:&#34;&#34;,&#34;tms&#34;:false,&#34;noWrap&#34;:false,&#34;zoomOffset&#34;:0,&#34;zoomReverse&#34;:false,&#34;opacity&#34;:1,&#34;zIndex&#34;:1,&#34;detectRetina&#34;:false,&#34;attribution&#34;:&#34;&amp;copy; &lt;a href=\&#34;http://openstreetmap.org\&#34;&gt;OpenStreetMap&lt;\/a&gt; contributors, &lt;a href=\&#34;http://creativecommons.org/licenses/by-sa/2.0/\&#34;&gt;CC-BY-SA&lt;\/a&gt;&#34;}]},{&#34;method&#34;:&#34;addCircleMarkers&#34;,&#34;args&#34;:[[44.3256388888889,41.8755055555556,44.9031666666667,44.2735861111111,39.1164888888889,40.47425,36.1430555555556,39.5449638888889,39.9478861111111,44.0998555555556,45.1679888888889,45.1122444444444,45.1679833333333,44.0736666666667,42.2995,43.9366666666667,44.9594027777778,44.959975,39.8735555555556,39.1174972222222,47.3865222222222,45.7521666666667,45.8490722222222,45.8591416666667],[-72.167825,-93.8518361111111,-93.285,-72.2118694444444,-86.5915138888889,-79.01725,-86.9559833333333,-82.6802055555556,-84.9164305555556,-92.5018472222222,-84.9178916666667,-84.4094305555556,-84.9178305555556,-121.429,-122.878666666667,-121.411833333333,-116.191002777778,-116.191047222222,-86.3160472222222,-85.7993611111111,-120.571686111111,-121.394263888889,-121.507736111111,-122.779372222222],10,null,null,{&#34;interactive&#34;:true,&#34;className&#34;:&#34;&#34;,&#34;stroke&#34;:false,&#34;color&#34;:&#34;#03F&#34;,&#34;weight&#34;:5,&#34;opacity&#34;:0.5,&#34;fill&#34;:true,&#34;fillColor&#34;:[&#34;#00aa00&#34;,&#34;#00aa00&#34;,&#34;#0000ff&#34;,&#34;#00aa00&#34;,&#34;#0000ff&#34;,&#34;#00aa00&#34;,&#34;#0000ff&#34;,&#34;#0000ff&#34;,&#34;#0000ff&#34;,&#34;#00aa00&#34;,&#34;#00aa00&#34;,&#34;#00aa00&#34;,&#34;#00aa00&#34;,&#34;#0000ff&#34;,&#34;#ff9900&#34;,&#34;#00aa00&#34;,&#34;#00aa00&#34;,&#34;#00aa00&#34;,&#34;#0000ff&#34;,&#34;#0000ff&#34;,&#34;#ff9900&#34;,&#34;#00aa00&#34;,&#34;#0000ff&#34;,&#34;#0000ff&#34;],&#34;fillOpacity&#34;:0.6},null,null,[&#34;&lt;img width=200 height=200 src=&#39;https://www.fairbanksmuseum.org/blog/wp-content/uploads/2016/05/Common-Morels.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://www.thegreatmorel.com/wp-content/uploads/2018/08/post_image_1921x621_clump.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://i2.wp.com/foragerchef.com/wp-content/uploads/2013/05/Dreamy-Minnesota-Morels.jpg?fit=1200%2C1115&amp;ssl=1&amp;resize=350%2C200&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://www.fairbanksmuseum.org/blog/wp-content/uploads/2016/05/False-Morels.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://indianamushrooms.com/images/late_April_109.JPG&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://i0.wp.com/www.thegreatmorel.com/wp-content/uploads/2018/05/PA_Diltown_FB79184-Large.jpeg?resize=331%2C426&amp;ssl=1&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://i1.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/DSC05044.jpg?fit=3840%2C2160&amp;ssl=1&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://blog-assets.thedyrt.com/uploads/2018/05/IMG_20180426_160603.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://farm2.static.flickr.com/1594/26565966582_c5832e2c0e_b.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://mwoutdoors.com/wp-content/uploads/2017/05/20170511_090240-1-495x400.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://i0.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/2016-MI2-group-pic.jpg?resize=604%2C390&amp;ssl=1&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://i0.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/2016-MI3-group-pic.jpg?resize=604%2C449&amp;ssl=1&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://i0.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/2016-MI1-group-pic.jpg?resize=604%2C379&amp;ssl=1&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://www.mushroomsinbend.org/wp-content/uploads/2016/04/Kevins16morelsinApril.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://greatoregonoutdoors.com/wp-content/uploads/2016/03/Photo-Jun-30-5-28-50-PM.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://www.mushroomsinbend.org/wp-content/uploads/2016/05/Deermorels-Buddy.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://ronspomeroutdoors.com/wp-content/uploads/2017/05/IMG_6566-827x900.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://ronspomeroutdoors.com/wp-content/uploads/2017/05/IMG_6615-900x675.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://peopleplacespies.com/wp-content/uploads/2016/05/IMG_16001.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://static1.squarespace.com/static/559d5353e4b0a6ed5cd890d9/t/56133cbae4b014e6e912683a/1469711728639/Lissa%27s+Morels&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;https://upload.wikimedia.org/wikipedia/commons/7/71/Morchella_elata_4846.JPG&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://www.yellowelanor.com/wp-content/uploads/2015/04/IMG_4091.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://www.yellowelanor.com/wp-content/uploads/2015/04/IMG_7849.jpg&#39;/&gt;&#34;,&#34;&lt;img width=200 height=200 src=&#39;http://www.yellowelanor.com/wp-content/uploads/2015/04/IMG_2266.jpg&#39;/&gt;&#34;],null,[&#34;2016:05:19 18:01:50   source:  https://www.fairbanksmuseum.org/blog/wp-content/uploads/2016/05/Common-Morels.jpg&#34;,&#34;2018:05:13 17:00:32   source:  https://www.thegreatmorel.com/wp-content/uploads/2018/08/post_image_1921x621_clump.jpg&#34;,&#34;2012:04:12 15:07:27   source:  https://i2.wp.com/foragerchef.com/wp-content/uploads/2013/05/Dreamy-Minnesota-Morels.jpg?fit=1200%2C1115&amp;amp;ssl=1&amp;amp;resize=350%2C200&#34;,&#34;2016:05:19 16:58:15   source:  http://www.fairbanksmuseum.org/blog/wp-content/uploads/2016/05/False-Morels.jpg&#34;,&#34;2019:04:22 15:09:10   source:  http://indianamushrooms.com/images/late_April_109.JPG&#34;,&#34;2018:05:11 17:40:42   source:  https://i0.wp.com/www.thegreatmorel.com/wp-content/uploads/2018/05/PA_Diltown_FB79184-Large.jpeg?resize=331%2C426&amp;amp;ssl=1&#34;,&#34;2016:04:16 18:36:01   source:  https://i1.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/DSC05044.jpg?fit=3840%2C2160&amp;amp;ssl=1&#34;,&#34;2018:04:26 16:06:03   source:  https://blog-assets.thedyrt.com/uploads/2018/05/IMG_20180426_160603.jpg&#34;,&#34;2016:04:26 10:50:46   source:  https://farm2.static.flickr.com/1594/26565966582_c5832e2c0e_b.jpg&#34;,&#34;2017:05:11 09:02:40   source:  https://mwoutdoors.com/wp-content/uploads/2017/05/20170511_090240-1-495x400.jpg&#34;,&#34;2016:05:22 18:57:29   source:  https://i0.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/2016-MI2-group-pic.jpg?resize=604%2C390&amp;amp;ssl=1&#34;,&#34;2016:05:23 13:38:41   source:  https://i0.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/2016-MI3-group-pic.jpg?resize=604%2C449&amp;amp;ssl=1&#34;,&#34;2016:05:21 19:04:08   source:  https://i0.wp.com/morelmushroomhunting.com/wp-content/uploads/2018/09/2016-MI1-group-pic.jpg?resize=604%2C379&amp;amp;ssl=1&#34;,&#34;2016:04:17 13:39:01   source:  http://www.mushroomsinbend.org/wp-content/uploads/2016/04/Kevins16morelsinApril.jpg&#34;,&#34;2012:06:30 17:28:50   source:  http://greatoregonoutdoors.com/wp-content/uploads/2016/03/Photo-Jun-30-5-28-50-PM.jpg&#34;,&#34;2016:05:04 11:14:41   source:  http://www.mushroomsinbend.org/wp-content/uploads/2016/05/Deermorels-Buddy.jpg&#34;,&#34;2017:05:20 10:24:18   source:  https://ronspomeroutdoors.com/wp-content/uploads/2017/05/IMG_6566-827x900.jpg&#34;,&#34;2017:05:20 12:05:11   source:  https://ronspomeroutdoors.com/wp-content/uploads/2017/05/IMG_6615-900x675.jpg&#34;,&#34;2016:04:22 17:20:26   source:  http://peopleplacespies.com/wp-content/uploads/2016/05/IMG_16001.jpg&#34;,&#34;2015:04:25 08:11:06   source:  https://static1.squarespace.com/static/559d5353e4b0a6ed5cd890d9/t/56133cbae4b014e6e912683a/1469711728639/Lissa%27s+Morels&#34;,&#34;2012:06:14 22:46:35   source:  https://upload.wikimedia.org/wikipedia/commons/7/71/Morchella_elata_4846.JPG&#34;,&#34;2014:05:17 20:30:47   source:  http://www.yellowelanor.com/wp-content/uploads/2015/04/IMG_4091.jpg&#34;,&#34;2015:04:03 16:43:20   source:  http://www.yellowelanor.com/wp-content/uploads/2015/04/IMG_7849.jpg&#34;,&#34;2014:04:14 17:34:00   source:  http://www.yellowelanor.com/wp-content/uploads/2015/04/IMG_2266.jpg&#34;],{&#34;interactive&#34;:false,&#34;permanent&#34;:false,&#34;direction&#34;:&#34;auto&#34;,&#34;opacity&#34;:1,&#34;offset&#34;:[0,0],&#34;textsize&#34;:&#34;10px&#34;,&#34;textOnly&#34;:false,&#34;className&#34;:&#34;&#34;,&#34;sticky&#34;:true},null]},{&#34;method&#34;:&#34;addLegend&#34;,&#34;args&#34;:[{&#34;colors&#34;:[&#34;#0000ff&#34;,&#34;#00aa00&#34;,&#34;#ff9900&#34;],&#34;labels&#34;:[&#34;April&#34;,&#34;May&#34;,&#34;June&#34;],&#34;na_color&#34;:null,&#34;na_label&#34;:&#34;NA&#34;,&#34;opacity&#34;:1,&#34;position&#34;:&#34;bottomright&#34;,&#34;type&#34;:&#34;unknown&#34;,&#34;title&#34;:&#34;Month&#34;,&#34;extra&#34;:null,&#34;layerId&#34;:null,&#34;className&#34;:&#34;info legend&#34;,&#34;group&#34;:null}]}],&#34;limits&#34;:{&#34;lat&#34;:[36.1430555555556,47.3865222222222],&#34;lng&#34;:[-122.878666666667,-72.167825]}},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]}&lt;/script&gt;
Click on the points to see their associated pictures…&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;closing-notes&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Closing Notes&lt;/h2&gt;
&lt;p&gt;You may have noticed that not all of the pictures are of morels. Indeed,
there are several foray group photos, a picture of a deer, and even a few
pictures of (poisonous) &lt;em&gt;false morel&lt;/em&gt; mushrooms.&lt;/p&gt;
&lt;p&gt;What could be done about that? Well, if you are truly geeky and somewhat
bored - OK very bored - you could train a deep neural network to identify morels,
and then feed the above image results into that. Me, I prefer wasting my time
wandering actual woods looking for interesting mushrooms… Even if there are
no morels to find, wandering in the woods is almost always fun. It’s also worth
pointing out that the false morel and morel habitats are often quite similar, so
those false morel sightings spotted in the map above might actually be
interesting places to forage.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;footnotes&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;To be sure, morels are found in many other places across the
US and the world. But I mostly forage in the Midwest and know it best.&lt;a href=&#34;#fnref1&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;I tried first to use the &lt;code&gt;phantomjs&lt;/code&gt; driver from R’s &lt;a href=&#34;https://cran.r-project.org/package=wdman&#34;&gt;&lt;code&gt;wdman&lt;/code&gt;&lt;/a&gt; package that doesn’t require
an external web browser. But I could only get that to work for searching
Microsoft Bing image results, not Google image search. Help or
advice on getting &lt;code&gt;phantomjs&lt;/code&gt; to work would be appreciated!&lt;a href=&#34;#fnref2&#34; class=&#34;footnote-back&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        &lt;script&gt;window.location.href=&#39;https://rviews.rstudio.com/2019/05/13/virtual-morel-foraging-with-r/&#39;;&lt;/script&gt;
      </description>
    </item>
    
  </channel>
</rss>
