Nothing
# Copyright (c) 2023 Apex Resource Management Solution Ltd. (ApexRMS). All rights reserved.
# MIT License
#' @include AAAClassDefinitions.R
NULL
# Overwrite default print methods to improve display of SsimObjects.
# Inspired by print methods for raster objects in raster package.
setMethod(
"print", "SsimObject",
function(x, ...) {
show(x)
}
)
setMethod(
"print", "Session",
function(x, ...) {
show(x)
}
)
setMethod(
"show", "SsimObject",
function(object) {
.printSsim(object)
}
)
setMethod(
"show", "Session",
function(object) {
.printSsim(object)
}
)
setMethod(
"print", "Folder",
function(x, ...) {
show(x)
}
)
setMethod(
"show", "Folder",
function(object) {
.printSsim(object)
}
)
.printSsim <- function(x, ...) {
outStrings <- list()
outStrings[["class"]] <- class(x)
cNames <- slotNames(x)
for (i in seq(length.out = length(cNames))) {
cName <- cNames[i]
cSlot <- slot(x, cName)
outName <- paste0(cName, " [", class(cSlot), "]")
outString <- ""
if (is.element(class(cSlot), c("numeric", "character", "logical", "integer"))) {
outString <- paste0(outString, paste(cSlot, collapse = ","))
}
if (is.element(class(cSlot), "Session")) {
outString <- paste0(outString, "", .filepath(cSlot), ", printCmd=", printCmd(cSlot))
}
if (is.element(class(cSlot), "data.frame")) {
outString <- paste0(outString, "", paste(names(cSlot), collapse = ","))
}
outStrings[[outName]] <- outString
}
# now pad names with spaces to get allignment.
maxLength <- max(nchar(names(outStrings)))
for (i in seq(length.out = length(names(outStrings)))) {
names(outStrings)[[i]] <- paste0(names(outStrings)[[i]], paste(rep(" ", maxLength - nchar(names(outStrings)[[i]])), collapse = ""))
names(outStrings)[[i]] <- paste0(names(outStrings)[[i]], ": ")
cat(paste0(names(outStrings)[[i]], outStrings[[i]], "\n"))
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.