title: How to resolve data must be a dataframe issue in R
body: <p>I am new to R and I am trying to create a basic world map and I have tried a number of methods but my latest trial has given me a new error.</p>
  <pre><code>install.packages(&quot;mapdata&quot;)
  install.packages(&quot;maps&quot;)
  library(maps)
  library(mapdata)
  df1 &lt;- data(world2MapEnv)
  p &lt;- ggplot(data = df1,
              aes(x = long, y = lat,
                  group = group, fill = region))
  
  p + geom_polygon(color = &quot;gray90&quot;, size = 0.1) + guides(fill = FALSE)
  </code></pre>
  <p>I am getting an error under the first ggplot that says:</p>
  <pre><code>Error: `data` must be a data frame, or other object coercible by `fortify()`, not a character vector. Run `rlang::last_error()` to see where the error occurred.
  </code></pre>
  <p>How do I resolve this.</p>
  <p>Thanks in advance.</p>