Created
April 14, 2022 19:32
-
-
Save snotskie/a286473f56af4aa0eb470518fc00c64d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Julia from https://julialang.org/ | |
# Add needed packages and import them | |
using Pkg | |
Pkg.add(url="https://github.com/snotskie/EpistemicNetworkAnalysis.jl") | |
Pkg.add("CSV") | |
Pkg.add("DataFrames") | |
Pkg.add("Plots") | |
using EpistemicNetworkAnalysis | |
using CSV | |
using DataFrames | |
using Plots | |
let # make a local context, avoid putting things in global scope | |
# Load CSV | |
data = DataFrame(CSV.read("filename.csv")) | |
# Specify model options | |
## :Whatever is a symbol | |
## "Whatever" is a string | |
## jENA expects column ids to be symbols, not strings | |
codes = [ | |
:FirstCode, | |
:SecondCode | |
] | |
conversations = [:TopLevel, :SecondLevel] | |
units = [:TopLevel, :SecondLevel] | |
rotation = MulticlassRotation(:GroupVar) | |
# Run model | |
myENA = ENAModel( | |
data, codes, conversations, units, | |
windowSize=4, | |
dropEmpty=false, | |
rotateBy=rotation | |
) | |
display(myENA) | |
# Plot | |
p = plot(myENA) | |
savefig(p, "filename.svg") | |
end # let |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rotation = MulticlassRotation(:GroupVar, 2, 3)