title: Warning gets to Error in RShiny: Ignoring unknown aesthetics: text
body: <p>I'm doing the following:</p>
  <pre><code>## Get the world map: ##
  worldMap &lt;- getMap()
  
  ## Define vector with all European countries: ##
  v.europe &lt;- c(&quot;Norway&quot;, &quot;Sweden&quot;, &quot;Finland&quot;, &quot;Denmark&quot;, &quot;United Kingdom&quot;,&quot;Ireland&quot;, &quot;Greece&quot;,
                &quot;Belgium&quot;, &quot;Netherlands&quot;, &quot;France&quot;, &quot;Spain&quot;, &quot;Portugal&quot;, &quot;Luxembourg&quot;, &quot;Croatia&quot;,
                &quot;Germany&quot;, &quot;Switzerland&quot;, &quot;Austria&quot;, &quot;Slovenia&quot;, &quot;Italy&quot;, &quot;Bulgaria&quot;, &quot;Romania&quot;,
                &quot;Czech Rep.&quot;, &quot;Slovakia&quot;, &quot;Hungary&quot;, &quot;Poland&quot;, &quot;Bosnia Hercegovina&quot;, &quot;Serbia&quot;,
                &quot;Turkey&quot;, &quot;Ukraine&quot;, &quot;Moldova&quot;, &quot;Belarus&quot;, &quot;Estonia&quot;, &quot;Latvia&quot;, &quot;Lithuania&quot;,
                &quot;Montenegro&quot;, &quot;Albania&quot;, &quot;Macedonia&quot;)
                
  ## Select only the index of countries of Europe: ##
  indEU &lt;- which(worldMap$NAME%in%v.europe)
  
  
  ## Extract longitude and latitude border's coordinates of countries: ##
  df.europeCoords &lt;- lapply(indEU, function(i){
      df &lt;- data.frame(worldMap@polygons[[i]]@Polygons[[1]]@coords)
      df$region = as.character(worldMap$NAME[i])
      colnames(df) &lt;- list(&quot;long&quot;, &quot;lat&quot;, &quot;region&quot;)
      return(df)
  })
  df.europeCoords &lt;- do.call(&quot;rbind&quot;, df.europeCoords)
  names(df.europeCoords) &lt;- c(&quot;longitude&quot;, &quot;latitude&quot;, &quot;country&quot;)
  
  ## Mean values of some of the countries of Europe: ##
  meanGermany &lt;- 33.33
  meanAustria &lt;- 35.71
  meanNetherlands &lt;- 35.9
  meanBelgium &lt;- 34.66
  meanFrance &lt;- 34.89
  meanItaly &lt;- 43.97
  meanHungary &lt;- 43.96
  meanCroatia &lt;- 42.54
  meanBulgaria &lt;- 54.61
  meanGreece &lt;- 25.72
  meanNorway &lt;- 27.64
  meanSweden &lt;- 36.41
  meanFinland &lt;- 32.13
  meanDenmark &lt;- 36.83
  meanSlovakia &lt;- 35.94
  meanCzechia &lt;- 44.15
  meanRomania &lt;- 36.52
  meanSwitzerland &lt;- 44.12
  meanSerbia &lt;- 45.53
  meanSlovenia &lt;- 45.1
  
  ## Create vector with mean values: ##
  v.meanValues &lt;- c('Germany' = meanGermany, 'Austria' = meanAustria, 'Netherlands' = meanNetherlands,
                    'Belgium' = meanBelgium, 'France' = meanFrance, 'Italy' = meanItaly, 'Greece' = meanGreece,
                    'Hungary' = meanHungary, 'Croatia' = meanCroatia, 'Bulgaria' = meanBulgaria,
                    'Norway' = meanNorway, 'Sweden' = meanSweden, 'Finland' = meanFinland, 'Denmark' = meanDenmark,
                    'Slovakia' = meanSlovakia, 'Czech Rep.' = meanCzechia, 'Romania' = meanRomania,  
                    'Serbia' = meanSerbia, 'Slovenia' = meanSlovenia, 'Switzerland' = meanSwitzerland)
  
  ## Merge mean values with European countries: ##
  df.europeCoords$meanValues &lt;- v.meanValues[match(df.europeCoords$country, names(v.meanValues))]
  
  
  ## Read Excel-file with longitude and latitude of each country: ##
  df.longLat &lt;- read_excel(&quot;C:/Users/z_kordasch/Documents/fire/server/input_Data/EUROPE_LongitudeLatitude.xlsx&quot;, na = &quot;NA&quot;)
  
  ## Merge mean values to this new data frame: ##
  df.longLat$meanValues &lt;- v.meanValues[match(df.longLat$country, names(v.meanValues))]
  
  
  
  ## Deletes/Removes borders of PLOT: ##
  ax &lt;- list(
    title = &quot;&quot;,
    zeroline = FALSE,
    showline = FALSE,
    showticklabels = FALSE,
    showgrid = FALSE
  )
  </code></pre>
  <p>When I'm plotting the European map I get the error massage <strong>Warning: Ignoring unknown aesthetics: text</strong>, where I use <code>text = paste(&quot;&lt;b&gt;&quot;, country, '&lt;/b&gt;')</code> in <code>geom_polygon()</code>. See the next code snippet:</p>
  <pre><code>## Plot the map: ##
  p &lt;- ggplot() + 
       geom_polygon(data = df.europeCoords, 
                    aes(x = longitude, y = latitude, 
                        group = country, fill = meanValues, 
                        text = paste(&quot;&lt;b&gt;&quot;, country, '&lt;/b&gt;')),
                    color = &quot;black&quot;, size = 0.1) +
       coord_map(xlim = c(-13, 35),  ylim = c(32, 71)) +
       theme_classic() +
       scale_fill_gradient(name = &quot;Price Mean Values&quot;, low = &quot;#81C07A&quot;, 
                           high = &quot;#007d3c&quot;, na.value = &quot;#CCCCCC&quot;) +
       theme(axis.text.x = element_blank(), 
             axis.text.y = element_blank(), 
             axis.ticks.x = element_blank(),
             axis.ticks.y = element_blank(), 
             axis.title = element_blank(), 
             legend.position = &quot;none&quot;,
             plot.margin = unit(0 * c(-1.5, -1.5, -1.5, -1.5), &quot;lines&quot;)) +
       geom_text(data = df.longLat, aes(long, lat, label = meanValues), size = 2)
                    
  ## Generate ggplot() to plot_ly() object: ##
  EuropePlot &lt;- plotly::ggplotly(p, tooltip = &quot;text&quot;) %&gt;%
                layout(xaxis = ax, yaxis = ax)
  </code></pre>
  <p>The plot looks like this:</p>
  <p><a href="https://i.stack.imgur.com/YxFib.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YxFib.png" alt="enter image description here" /></a></p>
  <p>The problem is that the warning in R doesn't bother as it still plots the desired result. When called in the Shiny App, nothing is displayed, precisely because of this warning. And it's supposed to work the same way in RShiny, so I have to somehow resolve this warning.
  How can I solve this issue/problem?</p>