Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/base_Fastcornet2.R
Draw Network plot of D3 style
1 2 3 4 5 6 7 | Fastcornet2(data, source.col = NULL, target.col = NULL, value = NULL,
color.group = list(), control.group = NULL, ratio = 1,
legend = T, size = 15, linkColour = NULL,
linkColour.type = list(name = "Blues", select.lower = 1, select.upper =
9), control.linkColour = NULL, colourScale.type = NULL,
nodeColour = list(), linkDistance = 300, linkWidth = 6,
opacity = 1, arrows = F, opacityNoHover = 0, zoom = T)
|
data |
a data frame with source,target and value cols |
source.col |
the colnames of source |
target.col |
the colnames of target |
value |
the colnames of value |
color.group |
a list of elements goup. |
control.group |
Default is NULL.The group you want highlight. |
ratio |
The portion of data you select |
legend |
Whether show lengend |
size |
a numeric to adjust the size of nodes |
linkColour |
the link color.If it's NULL,the link color would be provided by |
linkColour.type |
a list of link color for |
control.linkColour |
the color of highlight group.It only works when |
colourScale.type |
d3-scale-chromatic style object. |
nodeColour |
the named list of group color.It is unavailable when colourScale.type exists |
linkDistance |
link distance |
linkWidth |
the width of link.If it is not a numeric,the default |
opacity |
numeric value of the proportion opaque you would like the graph elements to be |
arrows |
Whether show direction between two nodes |
opacityNoHover |
the legend intensity.From 0-1.Default is 0 |
zoom |
logical value to enable (TRUE) or disable (FALSE) |
linkColour.type make full use of RColorBrewer and would be a good color strategy provider.The parameters of linkColour.type is including:
1.names: One of "Blues","BuGn","BuPu","GnBu","Greens","Greys","Oranges","OrRd","PuBu","PuBuGn","PuRd","Purples","RdPu","Reds" ,"YlGn","YlGnBu","YlOrBr" and "YlOrRd";
2.select.lower: the lower color order;
3.select.upper: the upper color order.
a list contain a network plot information and edge/node data.
Weibin Huang<654751191@qq.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | library(lucky)
data=state.x77;colnames(data)
## get MIC cormatrix
result1 <- FastMINE(data,
transposition = F,
method = "all.pairs",
control.markers="Income",
target.markers=NULL)
## long data frame network
data <- result1[["MINE.result"]][,1:3]
colnames(data) #[1] "X var" "Y var" "MIC (strength)"
source.col="X var";target.col="Y var";value="MIC (strength)"
## parameters of Fastcornet2
color.group = list(
love = c("Murder","Frost","Area","HS Grad"),
hate = c("Life Exp","Illiteracy"),
control = c("Population","Income"))
control.group = "control"
linkColour.type = list(
name = "Blues",
select.lower = 1,
select.upper = 3
)
# control.linkColour = "red"
control.linkColour = NULL
colourScale.type = NULL
nodeColour=list(
love = mycolor[6],
hate = mycolor[8],
control = mycolor[35])
## Quick Start
nw2 <- Fastcornet2(data,
source.col,
target.col,
value,
color.group,
control.group,
ratio=0.8,
legend=T,
size = 15,
linkColour=NULL,
linkColour.type,
control.linkColour,
colourScale.type = NULL,
nodeColour);nw2$netplot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.