From 21e7fc65ceb49a95841997d3a24145e0e33a056e Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Tue, 10 Dec 2019 14:57:47 +0100 Subject: [PATCH] Add fancy characters --- functions.R | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/functions.R b/functions.R index 78e3134..5bc7ed8 100644 --- a/functions.R +++ b/functions.R @@ -34,12 +34,15 @@ listObjects <- function() { nom <- gsub("\\n", "\\\\n", nom) nom <- gsub("\\t", "\\\\t", nom) + nom <- gsub("\\`", "\\\\`", nom) paste0("`", nom, "`") } else nom }) + # if R-object-browser-fancy-char ? noms <- gsub("\\n", "⏎", noms) noms <- gsub("\\t", "⭾", noms) + noms <- gsub("\\`", "\\\\`", noms) Map(cat, types, noms, vars, "\n") -> nul } @@ -50,11 +53,14 @@ objectContent <- function(x) { if (is.list(x)) { - noms <- if (is.null(names(x))) 1:length(x) - else names(x) - list <- ifelse(lapply(x, is.list), "*", "") - printdfleft(data.frame(list = list, - noms = noms)) + noms <- if (is.null(names(x))) 1:length(x) else names(x) + objects <- mget(noms, envir = x) + types <- lapply(objects, get_type) + + noms <- gsub("\\n", "⏎", noms) + noms <- gsub("\\t", "⭾", noms) + + Map(cat, types, noms, "\n") -> nul } }