Question: I am trying to plot a simple map in R using function get\_map() for a certain location. Following is my code :

e.g.

```
get_map(location = "texas", zoom = 10, source = "google")

```

I've tried different parameters. The error I'm getting is following:

```
Error in aperm.default(map, c(2, 1, 3)) : 
perm' is of wrong length 3 (!= 2)

```

What is exactly happening in the background & how do I fix it? I checked all the possible blogs I could, no one seems to get this error. 

Please help!

Answer: 
I had the same problem and updating my google api key worked out.
Navigate directly to the URL generated, and you should see a different error message that might be more informative:

```
https://maps.googleapis.com/maps/api/staticmap?center=31,-97&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=<INSERT_YOUR_KEY>

```

In my case, it said my API key was not valid for this API, although up to that point the error just said the same thing about 

```
Error in aperm.default(map, c(2, 1, 3)) : 
     invalid first argument, must be an array

```

and

```
HTTP 400 Bad Request

```