Skip to content

Commit

Permalink
Merge pull request #40 from AnneChao/master
Browse files Browse the repository at this point in the history
Add ggiNEXT.default back
  • Loading branch information
JohnsonHsieh committed Dec 14, 2018
2 parents 0c33c35 + 09624f3 commit e1221fc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions R/ggiNEXT.R
Expand Up @@ -103,11 +103,12 @@ ggiNEXT.iNEXT <- function(x, type=1, se=TRUE, facet.var="none", color.var="site"
}
z$col <- z$shape <- paste(z$site, z$order, sep="-")
}

z$lty <- z$lty <- factor(z$method, levels=unique(c("interpolated", "observed", "extrapolated"),
zz=z
z$method[z$method=="observed"]="interpolated"
z$lty <- z$lty <- factor(z$method, levels=unique(c("interpolated", "extrapolated"),
c("interpolation", "interpolation", "extrapolation")))
z$col <- factor(z$col)
data.sub <- z[which(z$method=="observed"),]
data.sub <- zz[which(zz$method=="observed"),]

g <- ggplot(z, aes_string(x="x", y="y", colour="col")) +
geom_point(aes_string(shape="shape"), size=5, data=data.sub)
Expand All @@ -120,7 +121,8 @@ ggiNEXT.iNEXT <- function(x, type=1, se=TRUE, facet.var="none", color.var="site"
shape=guide_legend(title="Guides")) +
theme(legend.position = "bottom",
legend.title=element_blank(),
text=element_text(size=18))
text=element_text(size=18),
legend.key.width = unit(1.2,"cm"))

if(type==2L) {
g <- g + labs(x="Number of sampling units", y="Sample coverage")
Expand Down Expand Up @@ -200,7 +202,6 @@ ggiNEXT.default <- function(x, ...){
)
}


#' Fortify method for classes from the iNEXT package.
#'
#' @name fortify.iNEXT
Expand Down

0 comments on commit e1221fc

Please sign in to comment.