R code throws the error "Error in trial/100 : non-numeric argument to binary operator Called from: Reduce("+", trial/100)"

expdyad<-function(exgrp)
{
trial <- vector(“list”,100)
for ( i in 1:100 )
{
rg <- erdos.renyi.game(n = vcount(exgrp), p.or.m = graph.density(exgrp), directed = TRUE)
trial[[i]] <- dyad.census(rg)
Reduce("+",trial/100)
}
return(data.frame(dyad.census=dyad.census()))
}

Dsplit <- split(df1, df1$village)
sapply(Dsplit, function(x) expdyad(graph_from_data_frame(x)))

© Copyright 2013-2019 Analytics Vidhya