Jeanne Thibeault
2005-Nov-15 20:23 UTC
[R] labeling contours that are output from contourLines
Hello, I have been trying to map some climate data using contourLines on a projected map. The following code seems to work well to add the lines, but the lines are not labeled: res <- contourLines(data.li) contours_x <- unlist(sapply(res, function(x) c(x$x, NA))) contours_y <- unlist(sapply(res, function(x) c(x$y, NA))) contours <- list(x= contours_x, y = contours_y) lines(mapproject(contours, proj = ""), type="l") I was thinking about trying to adapt some of the code from panel.levelplot(), but was wondering if someone else had already written a labeling function. Thanks for the help, Jeanne