I was trying to create a centrality plot by referring your tutorial (http://sachaepskamp.com/files/Cookbook.html) especially for centralityPlot however all of the functions gave me the following error:
Error in combine_vars(data, params$plot_env, cols, drop = params$drop) :
At least one layer must contain all variables used for facetting
As I looked into centralityPlot.R, especially for facettinng part, it was using graph and measure as facetting variables.
centralityPlot.R
if (length(unique(Long$graph)) > 1)
{
g <- g + facet_grid(graph ~ measure, scales = "free")
} else
{
g <- g + facet_grid( ~ measure, scales = "free")
}
However, as I looked into it, the centralityTableLong does not seem to have the measure columm.
So I changed the measure in the centralityPlot to variable which solved the problem.
I opened a merge request - or you may revise it by yourself. I hope this helps.
revised centralityPlot.R
if (length(unique(Long$graph)) > 1)
{
g <- g + facet_grid(graph ~ variable, scales = "free")
} else
{
g <- g + facet_grid( ~ variable, scales = "free")
}
Hello,
I was trying to create a centrality plot by referring your tutorial (http://sachaepskamp.com/files/Cookbook.html) especially for
centralityPlot
however all of the functions gave me the following error:As I looked into
centralityPlot.R
, especially for facettinng part, it was usinggraph
andmeasure
as facetting variables.centralityPlot.R
However, as I looked into it, the
centralityTable
Long
does not seem to have themeasure
columm.Here's the function definition of
melt
which does not seem to be acceptingvariable.name
that you specified incentralityTable
.reshape2::melt
centralityTable.R
So I changed the
measure
in thecentralityPlot
tovariable
which solved the problem. I opened a merge request - or you may revise it by yourself. I hope this helps.revised
centralityPlot.R
devmui