Assuming your data is in a data.frame called tempdat
, you could use the following code to put the temperature as text at each point:
library(maps)
map("state", "Virginia")
text(tempdat$long, tempdat$lat, label=tempdat$temperature)
For example, you could create tempdat
by filtering the list of US cities built into the maps package for those in Virginia, then adding random temperatures:
data(us.cities)
tempdat= us.cities[us.cities$country.etc == "VA", ]
tempdat$temperature = round(rnorm(nrow(tempdat), mean=75, sd=5))
At which point the plot would look something like this (it's far too crowded, so if your set of cities are this crowded you may want to plot the temperature using color rather than text. Anything you can do with the points
function built into R, you can do here).