cobCoin | R Documentation |
cobCoin
produces a netCoin object to graph a CoWeb graphic (Upton 2000).
cobCoin(data, variables=names(data), degree=0, significance=.05, ...)
data |
a data frame. |
variables |
a vector of variables included in the previous data frame. |
degree |
degree to rotate the categories of the graph |
significance |
p value maximum to represent the links |
... |
Any surCoin or netCoin argument. |
This function creates a netCoin object (or igraph) and, if stated, a folder in the computer with an HTML document named index.html which contains the produced graph. This file can be directly opened with your browser and sent to a web server to work properly.
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
Upton, Graham J.G. (2000) Cobweb diagrams for multiway contingency tables. The Statistician, 49(1), 79-85.
# A data frame with two variables Gender and Opinion
frame <- data.frame(Gender=c(rep("Man",3),rep("Woman",3)),
Opinion=c("Yes","Yes","No","No","No","Yes"))
cobCoin(frame, significance=.5, degree=45) # netCoin object
# A data frame with two variables (Gender and Hand) and nodes
input <- data.frame(
Gender = c("Women", "Men", "Men", "Women", "Women","Men",
"Men", "Men", "Women", "Women", "Men", "Women"),
Hand = c("Right", "Left","Right", "Right", "Right", "Right",
"Left", "Right", "Right", "Left","Right", "Right"))
nodes <- data.frame(
name = c("Gender:Men","Gender:Women", "Hand:Left", "Hand:Right"),
label = c("Women(50\u25)","Men(50\u25)",
"Left hand(25\u25)", "Right hand(75\u25)"))
G <- cobCoin(input, nodes=nodes, label="label", degree=22.5,
showArrows=TRUE, significance=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.