Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up| #' @importFrom utils capture.output | |
| capture.print <- function(obj,comment = NA,...){ | |
| if(details_env$device){ | |
| if(details_env$imgur) | |
| obj <- sprintf('',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 | |
| } | |