HI all!
I'm very new to R and this is my first post asking for help. Hope it works.
I'm trying to make maps using a dataframe that I have. I'm working in RStudio and am using ggplot2 and maps packages. I have a variable in my dataframe called 'Ten year FDI'/ I want to color the map based on that variable, using the following code:
> ggplot(data = Combined_FDI_maps) +
geom_polygon(aes(x = long, y = lat, fill = Ten year FDI, group = group), color = "white") +
coord_fixed(1.3) +
guides(fill=FALSE)
I get two error messages which I don't understand (you can also see the attached image):
Error: unexpected symbol in:
"ggplot(data = Combined_FDI_maps) +
geom_polygon(aes(x = long, y = lat, fill = Ten year"
coord_fixed(1.3) +
-
guides(fill=FALSE)
Error: Cannot add ggproto objects together. Did you forget to add this object to a ggplot object?
Interestingly, when I change my variable to another one ('region'), then all works our perfectly (you can see the result in the map that is shown in the attached image)
In there any solution to this problem? I would greatly appreciate your support!