|
|
@@ -1,3 +1,8 @@ |
|
|
|
detectBadName <- function(name) |
|
|
|
{ |
|
|
|
!grepl("^[[:alpha:]]([[:alnum:]]|[_.])*$", name) |
|
|
|
} |
|
|
|
|
|
|
|
getType <- function(object) |
|
|
|
{ |
|
|
|
if (is.list(object)) |
|
|
@@ -20,21 +25,26 @@ getType <- function(object) |
|
|
|
listObjects <- function() |
|
|
|
{ |
|
|
|
noms <- ls(envir = .GlobalEnv) |
|
|
|
objects <- lapply(noms, get, envir = .GlobalEnv) |
|
|
|
types <- lapply(objects, get_type) |
|
|
|
|
|
|
|
Map(cat, types, noms, "\n") -> nul |
|
|
|
} |
|
|
|
objects <- mget(noms, envir = .GlobalEnv) |
|
|
|
types <- lapply(objects, getType) |
|
|
|
|
|
|
|
vars <- lapply(noms, function(nom) |
|
|
|
{ |
|
|
|
if (detectBadName(nom)) |
|
|
|
{ |
|
|
|
nom <- gsub("\\n", "\\\\n", nom) |
|
|
|
nom <- gsub("\\t", "\\\\t", nom) |
|
|
|
paste0("`", nom, "`") |
|
|
|
} else nom |
|
|
|
}) |
|
|
|
|
|
|
|
list_objects() |
|
|
|
noms <- gsub("\\n", "⏎", noms) |
|
|
|
noms <- gsub("\\t", "⭾", noms) |
|
|
|
|
|
|
|
class(unclass(x)) -> list | other |
|
|
|
length(x) |
|
|
|
names(x) |
|
|
|
Map(cat, types, noms, vars, "\n") -> nul |
|
|
|
} |
|
|
|
|
|
|
|
default_limit <- 5 |
|
|
|
current_limit <- default_limit |
|
|
|
listObjects() |
|
|
|
|
|
|
|
objectContent <- function(x) |
|
|
|
{ |
|
|
|