# NOT RUN {
data(RS.data)
codeNames = c('Data','Technical.Constraints','Performance.Parameters',
'Client.and.Consultant.Requests','Design.Reasoning','Collaboration');
accum = ena.accumulate.data(
units = RS.data[,c("UserName","Condition")],
conversation = RS.data[,c("GroupName","ActivityNumber")],
metadata = RS.data[,c("CONFIDENCE.Change","CONFIDENCE.Pre","CONFIDENCE.Post","C.Change")],
codes = RS.data[,codeNames],
window.size.back = 4,
model = "A"
);
set = ena.make.set(accum);
unitNames = set$enadata$units
### Subset rotated points and plot Condition 1 Group Mean
first.game = unitNames$Condition == "FirstGame"
first.game.points = set$points.rotated[first.game,]
### Subset rotated points and plot Condition 2 Group Mean
second.game = unitNames$Condition == "SecondGame"
second.game.points = set$points.rotated[second.game,]
### get mean network plots
first.game.lineweights = set$line.weights[first.game,]
first.game.mean = colMeans(first.game.lineweights)
second.game.lineweights = set$line.weights[second.game,]
second.game.mean = colMeans(second.game.lineweights)
subtracted.network = first.game.mean - second.game.mean
# Plot dimension 1 against ActivityNumber metadata
dim.by.activity = cbind(
set$points.rotated[,1],
set$enadata$trajectories$step$ActivityNumber*.8/14-.4 #scale down to dimension 1
)
plot = ena.plot(set)
plot = ena.plot.network(plot, network = subtracted.network, legend.name="Network")
plot = ena.plot.trajectory(
plot,
points = dim.by.activity,
names = unique(set$enadata$units$UserName),
by = set$enadata$units$UserName
);
print(plot)
# }
Run the code above in your browser using DataLab