Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
39 lines (24 sloc) 649 Bytes
#' @importFrom utils capture.output
capture.print <- function(obj,comment = NA,...){
if(details_env$device){
if(details_env$imgur)
obj <- sprintf('![](%s)',imgur_upload(obj))
}else{
if(!inherits(obj,'character')){
obj <- utils::capture.output(print(obj,...))
}
}
if(!is.na(comment))
obj <- paste0(comment,' ',obj)
paste0(obj,collapse = '\n')
}
read_text <- function(text){
if(!inherits(text,'character')||length(text)>1)
return(text)
if(!details_env$device){
if(file.exists(text)){
text <- readLines(text,warn = FALSE)
}
}
text
}
You can’t perform that action at this time.