[Rsiena-help] Loop in "sienaDataCreate"
Philippe Sulger
philippesulger at hotmail.com
Thu Jun 21 18:50:34 CEST 2012
Dear all
I try to program a loop over 5 different networks. Therein I use
"sienaDataCreate". E.g.:
mydata.basic.model <- list();
for (i in c(1:5))
{mydata.basic.model[[i]] <- sienaDataCreate(peers[[i]])}
Where "peers" is defined/specified previously as a list over networks s.t.
peers <- list()
for (i in c(1:5))
{peers[[i]] <- sienaNet(
array( c(peers.data.w1[[i]], peers.data.w2[[i]]),
dim = c( dim(peers.data.w1[[i]])[1],
dim(peers.data.w2[[i]])[1], 2)))}
The latter loop works. The former loop does not work. That is,
mydata.basic.model[[1]], for instance, gets "peers[[i]]" as dependent
variable (instead of "peers[[1]]". The same for the other networks.
But if I define the model-data separately for each network, i.e.,
mydata.basic.model[[1]] <- sienaDataCreate(peers[[1]])
mydata.basic.model[[2]] <- sienaDataCreate(peers[[2]])
it works.
What goes wrong?
Thank you for your efforts.
Best
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rsiena-help/attachments/20120621/e47b3fd0/attachment.html>
More information about the Rsiena-help
mailing list