R/walk1.R

Defines functions walk1

Documented in walk1

#' walk 
#' 
#' Given index \code{i} and the coordinates list \code{z}, generate the corresponding ggplot aesthetics
#' 
#' @param i, the first index
#' @param z, the coordinates list extracted from dataset
#' @return  the corresponding ggplot aesthetics including geo coordinates
#' @examples
#' x<-ICU$new(land="world-2",date="1984-11")   ## New class
#' z<-x$guo$Countries$coordinates
#' ggplot()+walk1(1,z)  ## Western Sahara
#' 

walk1<-function(i,z){  ## Go through one by one
  #da<-convertDF(z[[i]])
  da<-as.data.frame(unlist(z[[i]]))
  geom_polygon(data=da,aes(x=da[[1]],y=da[[2]]))
}
yewei369/FancyPackRLiU5 documentation built on Nov. 5, 2019, 12:34 p.m.