Skip to content

Instantly share code, notes, and snippets.

@snotskie
Created April 14, 2022 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snotskie/a286473f56af4aa0eb470518fc00c64d to your computer and use it in GitHub Desktop.
Save snotskie/a286473f56af4aa0eb470518fc00c64d to your computer and use it in GitHub Desktop.
# 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
@snotskie
Copy link
Author

rotation = MulticlassRotation(:GroupVar, 2, 3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment