ThisIsLorenzo / PFAS_Systematic_Evidence_Map

0 stars 0 forks source link

Modifying code of networkPlot function - Bibliometrix package #3

Open ThisIsLorenzo opened 4 months ago

ThisIsLorenzo commented 4 months ago

We need to change the function's code to make the label's alpha = 1 while making the network lines' alpha = 0.3. Function's code is available prompting the function's name in the R console. > networkPlot Look for the line V(bsk.network)$label.color <- adjustcolor("black", min(c(1, alpha + 0.1))) change it with V(bsk.network)$label.color <- "black" Then, we add the alpha value in the code networkPlot(NetMatrix_keywords, normalize = "association", n = 20, Title = "Keyword co-occurrences", type = "fruchterman", size.cex = TRUE, size = 10, remove.multiple = F, edgesize = 3, labelsize = 3, label.cex = TRUE, edges.min = 1, label.n = 30, alpha = 0.3) However, I get an error when I try to run the revised > networkPlot function: Error in degree(bsk.network, mode = "all") : unused argument (mode = "all")

I did not change anything else in the function's code.

itchyshin commented 4 months ago

@ThisIsLorenzo

Change

V(bsk.network)$label.color <- adjustcolor("black", min(c(1,  alpha + 0.1)))

to

V(bsk.network)$label.color <- adjustcolor("black", max(c(1,  alpha + 0.1)))

You should name your function differently from the original code

mlagisz commented 4 months ago

@lorenzo which file contains this code?

ThisIsLorenzo commented 4 months ago

https://github.com/ThisIsLorenzo/PFAS_Systematic_Evidence_Map/blob/53d7033d50d05c2ca87e892a46d18948dacce648/R/analysis_code.Rmd#L4216 @mlagisz the only thing I changed in the function code is V(bsk.network)$label.color <- adjustcolor("black", min(c(1, alpha + 0.1))) with V(bsk.network)$label.color <- "black".

ThisIsLorenzo commented 4 months ago

V(bsk.network)$label.color <- adjustcolor("black", max(c(1, alpha + 0.1)))

Still having the same error: Error in degree(bsk.network, mode = "all") : unused argument (mode = "all") @itchyshin

ThisIsLorenzo commented 4 months ago

SFig.22.pdf This is how the Fig looks like at the moment. All of this is to bring down alpha for the network lines so that we can easier read the lables.

itchyshin commented 4 months ago

@mlagisz - please have a look at @ThisIsLorenzo's issue (too busy to have a look at it right now while teaching)

mlagisz commented 4 months ago

@itchyshin I am on it! almost there! @ThisIsLorenzo

mlagisz commented 4 months ago

Note: Cooking dinner while coding is a bad habit... as bad as coding while cooking dinner...