Hey Andy,
thank you for your immediate reply.
I corrected my code but unfortunately it does not work. This is my code so far:
library(rworldmap)
svg("Map.svg")
#Create map
newmap <- getMap(resolution = "high")
plot(newmap, xlim=c(-10,19), ylim=c(40,56), col= "#C0C0C0", fill=TRUE)
par(new=TRUE)
newmap <- getMap(resolution = "high")
dF <- data.frame(country = c("spain","france","belgium","germany","austria","italy","czechrepublic), sampled = c(1,1,1,2,2,2,2))
sPDF <- joinCountryData2Map(dF,joinCode = "NAME", nameJoinColumn = "country", mapResolution = "low")
mapCountryData(sPDF, nameColumnToPlot = "sampled", catMethod = "categorical", xlim=c(-10,19), ylim=c(40,56), colourPalette = c("gray90", "gray30"))
dev.off()
The error message is the following:
In par(new = TRUE) : calling par(new=TRUE) with no plot
>
> newmap <- getMap(resolution = "high")
Error: could not find function "getMap"
>
> dF <- data.frame(country = c("spain","france","belgium","germany","austria","italy","czechrepublic"), sampled = c(1,1,1,2,2,2,2))
> sPDF <- joinCountryData2Map(dF,joinCode = "NAME", nameJoinColumn = "country", mapResolution = "low")
Error: could not find function "joinCountryData2Map"
>
> mapCountryData(sPDF, nameColumnToPlot = "sampled", catMethod = "categorical", xlim=c(-10,19), ylim=c(40,56), colourPalette = c("gray90", "gray30"))
Error: could not find function "mapCountryData"
Sarah