Skip to content

Commit

Permalink
documented
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Jul 15, 2014
1 parent a7ce953 commit f17cdba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions man/ggcorr.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ggcorr(data, method = "pairwise", palette = "RdYlGn", name = "rho",
\item{...}{other arguments supplied to geom_text for the diagonal labels. Arguments pertaining to the title or other items can be achieved through ggplot2 methods.}
}
\description{
Function for making a correlation plot starting from a data matrix, using ggplot2. The function is directly inspired by Tian Zheng and Yu-Sung Su's arm::corrplot function. Please visit \link{http://github.com/briatte/ggcorr} for the latest development and descriptions about ggcorr.
Function for making a correlation plot starting from a data matrix, using ggplot2. The function is directly inspired by Tian Zheng and Yu-Sung Su's arm::corrplot function. Please visit \url{http://github.com/briatte/ggcorr} for the latest development and descriptions about ggcorr.
}
\examples{
# Basketball statistics provided by Nathan Yau at Flowing Data.
Expand All @@ -43,7 +43,7 @@ ggcorr(nba[, -1],
label = TRUE,
label_alpha = TRUE,
name = "") +
theme(legend.position = "bottom")
ggplot2::theme(legend.position = "bottom")
# Custom options.
ggcorr(
nba[, -1],
Expand Down
10 changes: 6 additions & 4 deletions man/ggnet.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ ggnet(net, mode = "fruchtermanreingold", layout.par = NULL, size = 12,

\item{label.nodes}{label nodes with their vertex names attribute. If set to \code{TRUE}, all nodes are labelled. Also accepts a vector of character strings to match with vertex names.}

\item{label.size}{size of the labels. Defaults to \code{size / 2}.}

\item{top8.nodes}{use the top 8 nodes as node groups, colored with \code{"Set1"}. The rest of the network will be plotted as the ninth (grey) group. Experimental.}

\item{trim.labels}{removes '@', 'http://', 'www.' and the ending '/' from vertex names. Cleans up labels for website and Twitter networks. Defaults to \code{TRUE}.}
Expand Down Expand Up @@ -73,16 +75,16 @@ nw.mat <- matrix(0, nrow = x, ncol = x)
dimnames(nw.mat) <- list(1:x, 1:x)
nw.mat[row(nw.mat) != col(nw.mat)] <- runif(ndyads) < density
nw.mat
rnd <- network(nw.mat)
rnd <- network::network(nw.mat)
rnd

# random network
pRnd <- ggnet(rnd, label = TRUE, alpha = 1, color = "white", segment.color = "grey10")
pRnd <- ggnet(rnd, label.nodes = TRUE, alpha = 1, color = "white", segment.color = "grey10")
# pRnd

# random groups
category = LETTERS[rbinom(x, 4, .5)]
ggnet(rnd, label = TRUE, color = "white", segment.color = "grey10", node.group = category)
ggnet(rnd, label.nodes = TRUE, color = "white", segment.color = "grey10", node.group = category)

# city and service firms data from the UCIrvine Network Data Repository
url = url("http://networkdata.ics.uci.edu/netdata/data/cities.RData")
Expand All @@ -93,7 +95,7 @@ close(url)
type = cities \%v\% "type"
type = ifelse(grepl("City|Law", type), gsub("I+", "", type), "Firm")
pRnd <- ggnet(cities, mode = "kamadakawai", alpha = .2, node.group = type,
label = c("Paris", "Beijing", "Chicago"), color = "darkred")
label.nodes = c("Paris", "Beijing", "Chicago"), color = "darkred")
# pRnd
}
\author{
Expand Down

0 comments on commit f17cdba

Please sign in to comment.