l_loonWidgets {loon} | R Documentation |
Get all active top level loon plots.
Description
Loon's plots are constructed in TCL and identified with a path string appearing in the window containing the plot.
If the plots were not saved on a variable, this function will look for all loon plots displayed and return their values in a list whose elements may then be assigned to R variables.
Usage
l_loonWidgets(pathTypes, inspector = FALSE)
Arguments
pathTypes |
an optional argument identifying the collection of path types that are to be returned (if displayed). |
inspector |
whether to return the loon inspector widget or not This must be a subset of the union of
If it is missing,
all |
Value
list whose elements are named by, and contain the values of, the
loon plot widgets. The list can be nested when loon plots (like l_pairs
)
are compound in that they consist of more than one base loon plot.
See Also
l_basePaths
l_compoundPaths
l_getFromPath
Examples
if(interactive()){
l_plot(iris)
l_hist(iris)
l_hist(mtcars)
l_pairs(iris)
# The following will not be loonWidgets (neither is the inspector)
tt <- tktoplevel()
tkpack(l1 <- tklabel(tt, text = "Heave"), l2<- tklabel(tt, text = "Ho"))
#
# This will return loon widgets corresponding to plots
loonPlots <- l_loonWidgets()
names(loonPlots)
firstPlot <- loonPlots[[1]]
firstPlot["color"] <- "red"
histograms <- l_loonWidgets("hist")
lapply(histograms,
FUN = function(hist) {
hist["binwidth"] <- hist["binwidth"]/2
l_scaleto_world(hist)
}
)
}