I'm just starting with R and I wanted to know if it's possible to create a scatterplot with custom icons (svg or png) instead of points.
I started to import a shapefile, and then I have a set of points (latitude and longitude) that represents the location of the icons.
rm(list=ls())
library(ggplot2)
library(gstat)
library(sp)
library(maptools)
library(rgdal)
#plot
par(mar = c(2, 2, 2, 2))
root <- "C:/"
Al= readShapeLines("/DZA_adm0.shp")
require(rgeos)
simple.output <- gSimplify(Al, topologyPreserve = TRUE, tol = 3)
plot(simple.output,col="black")
(tab <- read.delim(file = paste(root, "/ville.txt", sep = "")))
dat <- SpatialPoints(coords = tab[, 2:3])
(dat <- SpatialPointsDataFrame(coords = tab[, 2:3], data = tab[,
+ c(1, 4)]))
# Rajout des capitales
plot(dat, pch =20, add = T,col="red")
# Extraction des coordonnees
lon <- dat@coords [, "lon"]
lat <- dat@coords [, "lat"]
# Extraction du nom des villes
labs <- as.character(dat@data[, "ville"])