Search code examples
rlistegg

List as an argument in R


This might be a fairly banal question. I am a r-user who knows little about coding.

I am using the package 'EGAnet' and create a plot using the function EGA. This function has a 'plot.args' argument. From the ?EGA page

plot.args
List. A list of additional arguments for the network plot.

For plot.type = "GGally" (see ggnet2 for full list of arguments):

vsize Size of the nodes. Defaults to 6.

label.size Size of the labels. Defaults to 5.

alpha The level of transparency of the nodes, which might be a single value or a vector of values. Defaults to 0.7.

edge.alpha The level of transparency of the edges, which might be a single value or a vector of values. Defaults to 0.4.

legend.names A vector with names for each dimension

color.palette The color palette for the nodes. For custom colors, enter HEX codes for each dimension in a vector. See color_palette_EGA for more details and examples

I can't figure out how to modify the parameters of this list to add them to the function EGA. For instance, I'd like to change the color.palette (color.palette = "grayscale") and vsize (vsize = 8) arguments.

How do I create this list to add to the function?

The final function looks something like

ega.sds <- EGA(data = ex_graph, model = "glasso", plot.EGA = T, plot.args = ???)

What do I add in place of ???

Thank you a million.


Solution

  • I believe you just need to write:

    plot.args = list(
       color.palette = "grayscale",
       vsize = 8
    )