diff --git a/R/ggkegg.R b/R/ggkegg.R index dbaec05..821bcaa 100644 --- a/R/ggkegg.R +++ b/R/ggkegg.R @@ -34,7 +34,7 @@ #' @param numeric_attribute named vector for appending numeric attribute #' @param node_rect_nudge parameter for nudging the node rect #' @param group_rect_nudge parameter for nudging the group node rect -#' @example +#' @examples #' ## Use pathway ID to obtain `ggraph` object directly. #' g <- ggkegg("hsa04110") #' g + geom_node_rect() diff --git a/R/module_functions.R b/R/module_functions.R index 526cd6c..3bb004c 100644 --- a/R/module_functions.R +++ b/R/module_functions.R @@ -722,7 +722,7 @@ parse_module <- function(kmo) { } steps[[j]] <- current_step j <- j + 1 - steps[sapply(steps, is.null)] <- NULL + steps[vapply(steps, is.null, FUN.VALUE=TRUE)] <- NULL return(steps) } ## Preallocate diff --git a/man/ggkegg.Rd b/man/ggkegg.Rd index 1a6aa8f..059c896 100644 --- a/man/ggkegg.Rd +++ b/man/ggkegg.Rd @@ -75,3 +75,8 @@ ggplot2 object main function parsing KEGG pathway data, making igraph object and passing it to ggraph. } +\examples{ +## Use pathway ID to obtain `ggraph` object directly. +g <- ggkegg("hsa04110") +g + geom_node_rect() +}