Learn R Programming

GADMTools (version 3.9-1)

dots: Plot dots on a map

Description

Plot points on a map with different colors and shapes.

Usage

dots(x, points, color="red", size = 8, value = NULL,
    breaks = NULL, steps = 5, palette = NULL, labels = NULL, strate = NULL,
    title="", subtitle = "", caption  = "", legend = NULL, note=NULL)

Arguments

x

Object gadm_sp or gadm_sf

points

Object data.frame with columns 'latitude' and 'longitude'

color

a valid color

size

integer size of point

value

Character Name of a column in the data.frame. If is not null, colored dots are displayed according to the value.

breaks

vector of breaks

steps

Integer Number of breaks for the value field.

palette

a valid palette

labels

vector of labels

strate

Character name of a column in the data.frame. If is not null, display dots with different shapes according to the value.

title

Character title of the plot

subtitle

Character subtitle of the plot

caption

Character caption of the plot

legend

Character The title of the legend

note

Character Add an annotation

Value

Object ggplot2

Details

----

References

----

See Also

RColorBrewer

Examples

Run this code
# NOT RUN {
library(GADMTools)
data("Corsica")

longitude <- runif(6, min=8.74, max = 9.25)
latitude  <- runif(6, min=41.7, max = 42.6)
Cases <- runif(6, 25, 112)
DAT <- data.frame(longitude, latitude, Cases)

dots(Corsica, DAT, color="red", size = 8, value = "Cases")


# }

Run the code above in your browser using DataLab