l_layer_lines.RdLoon's displays that are based on Cartesian coordinates (i.e. scatterplot, histogram and graph display) allow for layering visual information including polygons, text and rectangles.
l_layer_lines(widget, x, y, color = "black", linewidth = 1, label = "lines", parent = "root", index = 0, ...)
| widget | widget path name as a string |
|---|---|
| x | list with vectors with x coordinates |
| y | list with vectors with y coordinates |
| color | color of lines |
| linewidth | vector with line widths |
| label | label used in the layers inspector |
| parent | group layer |
| index | of the newly added layer in its parent group |
| ... | additional state initialization arguments, see
|
layer object handle, layer id
For more information run: l_help("learn_R_layer")
s <- Filter(function(df)nrow(df) > 1, split(UsAndThem, UsAndThem$Country)) sUaT <- Map(function(country){country[order(country$Year),]} , s) xcoords <- Map(function(x)x$Year, sUaT) ycoords <- Map(function(x)x$LifeExpectancy, sUaT) region <- sapply(sUaT, function(x)as.character(x$Geographic.Region[1])) p <- l_plot(showItemLabels=TRUE) l <- l_layer_lines(p, xcoords, ycoords, itemLabel=names(sUaT), color=region) l_scaleto_layer(l)