No debería ser posible desde las propiedades del dispositivo porque es propiedad de la ventana.
bajo Windows podría intentar meterse con names(getWindowsHandles())
que me da:
> names(getWindowsHandles())
[1] "R Console"
[2] "The title (ACTIVE)"
[3] "R Information"
P. ej para el dispositivo activo grep("\\(ACTIVE\\)$", names(getWindowsHandles()), value=TRUE)
devuelve el título.
que era más fácil de lo que pensaba:
getTitle <- function(dev=dev.cur()) {
all_pointers <- getWindowsHandles(which="R", minimized=TRUE)
all_pointers <- sapply(all_pointers, deparse)
to_find <- deparse(getWindowsHandle(dev))
if (to_find=="NULL") {
warning("Device not found")
NULL
} else {
names(all_pointers)[to_find==all_pointers]
}
}
Ahora algunas pruebas:
> getTitle()
Warning in getTitle() : Device not found
NULL
> windows(title="Test window one")
> getTitle()
[1] "Test window one (ACTIVE)"
> getTitle(3)
Warning in getTitle(3) : Device not found
NULL
> windows(title="Test window two")
> windows(title="Test window three")
> sapply(dev.list(), getTitle)
windows windows windows
"Test window one (inactive)" "Test window two (inactive)" "Test window three (ACTIVE)"
No estoy tratando de ser inteligente o cualquier cosa, pero no puedes simplemente 'plotname = "El título"; ' ' windows (title = plotname); ' ' plotname' – Seth