2个回答
2015-07-07 · 知道合伙人数码行家
可以叫我表哥
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:25897
获赞数:1464974
2010年毕业于北京化工大学北方学院计算机科学与技术专业毕业,学士学位,工程电子技术行业4年从业经验。
向TA提问 私信TA
关注
展开全部
命令代码参考如下:
# An R function to clear the screen on RGui:
cls <- function() {
if (.Platform$GUI[1] != "Rgui")
return(invisible(FALSE))
if (!require(rcom, quietly = TRUE)) # Not shown any way!
stop("Package rcom is required for 'cls()'")
wsh <- comCreateObject("Wscript.Shell")
if (is.null(wsh)) {
return(invisible(FALSE))
} else {
comInvoke(wsh, "SendKeys", "\014")
return(invisible(TRUE))
}
}
#cls() # test
# If you want to make sure that it worked (well, not 100% sure, but...)
res <- cls()
if (res) cat("Console should be cleared now!\n")
# An R function to clear the screen on RGui:
cls <- function() {
if (.Platform$GUI[1] != "Rgui")
return(invisible(FALSE))
if (!require(rcom, quietly = TRUE)) # Not shown any way!
stop("Package rcom is required for 'cls()'")
wsh <- comCreateObject("Wscript.Shell")
if (is.null(wsh)) {
return(invisible(FALSE))
} else {
comInvoke(wsh, "SendKeys", "\014")
return(invisible(TRUE))
}
}
#cls() # test
# If you want to make sure that it worked (well, not 100% sure, but...)
res <- cls()
if (res) cat("Console should be cleared now!\n")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询