I have a list of 73 data sets generated by the function "mcsv_r()" called "L1" and a function "gc()" that generates a map. Using "lapply" I can create my 73 plots. I need to save and name all of them. I know I can do it one by one with RStudio. But I am sure that thanks to "jpeg()" and "dev.off" and mixing them with a loop I can do it with a few lines of code.
out <- setwd("C:/")
dir(out)
mcsv_r(dir(out))
gc <- function(x){
xlim <- c(-13.08, 8.68)
ylim <- c(34.87, 49.50)
map("world", lwd=0.05, xlim=xlim, ylim=ylim)
map.axes()
symbols(x$lon, x$lat, bg="#e2373f", fg="#ffffff", lwd=0.5, circles=rep(1, length(x$lon)), inches=0.05, add=TRUE)
node <- x[x$node == 1, c("lon", "lat")]
for (i in 2:nrow(x)) lines(gcIntermediate(node, x[i, c("lon", "lat")]), col="red", lwd=0.8)
}
lapply(L1, gc)
Anyone can help me!? Thanks in advance. This is my code...