Description Usage Arguments Details Author(s) See Also Examples
Convert a .dna file into a sociomatrix and import it into R.
1 2 3 4 5 6 7 8 9 10 11 | dna.network(infile, algorithm = "cooccurrence",
agreement = "combined", start.date = "01.01.1900",
stop.date = "31.12.2099", two.mode.type = "oc",
one.mode.type = "organizations", via = "categories",
ignore.duplicates = TRUE, include.isolates = FALSE,
normalization = FALSE, window.size = 100, step.size = 1,
alpha = 100, lambda = 0.1, ignore.agreement = FALSE,
exclude.persons = c(""), exclude.organizations = c(""),
exclude.categories = c(""), invert.persons = FALSE,
invert.organizations = FALSE, invert.categories = FALSE,
verbose = TRUE)
|
infile |
The input .dna file as a string (i.e., enclosed in quotation marks). If the file is not in the current working directory, specify the path together with the file name. Include the file suffix. Example: |
algorithm |
The algorithm which should be used to create the network. Refer to the DNA manual at http://www.philipleifeld.de for details. Possible values are: |
agreement |
The agreement pattern to be used. Must be one of the following: |
start.date |
Only statements after this date will be retained. The start date is a character string of the form |
stop.date |
Only statements before this date will be retained. The stop date is a character string of the form |
two.mode.type |
If the |
one.mode.type |
If the |
via |
If the one.mode.type argument is active (i.e., the |
ignore.duplicates |
A boolean variable indicating whether two statements with the same actor, category, agreement pattern and date should be counted separately during network creation. For example, if a speaker re-iterates the same concepts in the same way over and over again in the same article, each of these statements increases the edge weight between this speaker and other speakers using the same argument if |
include.isolates |
If several time slices are exported, usually the network matrices will have different dimensions. If the |
normalization |
Some actors make statements more frequently than others, and this behavior is caused by their institutional position. These actors are likely to be at the center of the network. If |
window.size |
If the |
step.size |
If the |
alpha |
If the |
lambda |
If the |
ignore.agreement |
This argument is only used if |
exclude.persons |
Specify a list of persons to be excluded from the network. For example, |
exclude.organizations |
Specify a list of organizations to be excluded from the network. For example, |
exclude.categories |
Specify a list of categories to be excluded from the network. For example, |
invert.persons |
Reverse the selection of persons. If |
invert.organizations |
Reverse the selection of organizations. If |
invert.categories |
Reverse the selection of categories. If |
verbose |
If |
Specify an input .dna file, specify options for generating a network, and transfer the network as a matrix object into R.
Philip Leifeld (http://www.philipleifeld.com)
rDNA
dna.init
dna.attributes
dna.categories
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 | # download files and initialize DNA:
download.file("http://www.philipleifeld.de/cms/upload/Downloads/dna-1.31.jar",
destfile = "dna-1.31.jar", mode = "wb")
download.file("http://www.philipleifeld.de/cms/upload/Downloads/sample.dna",
destfile = "sample.dna", mode = "wb")
dna.init("dna-1.31.jar")
## Not run:
# plot a congruence network using the statnet package:
congruence <- dna.network("sample.dna", exclude.categories =
"There should be legislation to regulate emissions.")
library("network")
congruence.nw <- network(congruence)
plot(congruence.nw, displaylabels = TRUE, label.cex = 0.6, pad = 0.8)
## End(Not run)
# do a hierarchical cluster analysis with an affiliation network:
affiliation.yes <- dna.network("sample.dna", algorithm = "affiliation",
agreement = "yes", include.isolates = TRUE)
affiliation.no <- dna.network("sample.dna", algorithm = "affiliation",
agreement = "no", include.isolates = TRUE)
affiliation <- cbind(affiliation.yes, affiliation.no)
affiliation <- affiliation[rowSums(affiliation) > 0, ] #remove isolates
distances <- dist(affiliation, method = "binary")
clustering <- hclust(distances)
plot(clustering)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.