You can get TestWithRStudio
by
devtools::install_github("Non-Contradiction/TestWithRStudio")
library(TestWithRStudio)
check_rstudio()
#> Start a new RStudio process with pid = 68568
#> The rsession has pid = 68578
#> [1] TRUE
detailed_check_in_rstudio("1")
#> Start a new RStudio process with pid = 68605
#> The rsession has pid = 68615
#> $crashed
#> [1] FALSE
#>
#> $finished
#> [1] TRUE
#>
#> $errmsg
#> character(0)
detailed_check_in_rstudio("q()")
#> Start a new RStudio process with pid = 68644
#> The rsession has pid = 68654
#> Warning: 运行命令'kill -s 0 68654 >/dev/null 2>/dev/null'的状态是1
#> $crashed
#> [1] TRUE
#>
#> $finished
#> [1] FALSE
#>
#> $errmsg
#> character(0)
detailed_check_in_rstudio("doesntexist()")
#> Start a new RStudio process with pid = 68682
#> The rsession has pid = 68692
#> $crashed
#> [1] FALSE
#>
#> $finished
#> [1] FALSE
#>
#> $errmsg
#> [1] "Error in doesntexist() : 没有\"doesntexist\"这个函数"
#> [2] ""
detailed_check_in_rstudio("library(TestWithRStudio); crash()")
#> Start a new RStudio process with pid = 68719
#> The rsession has pid = 68729
#> Warning: 运行命令'kill -s 0 68729 >/dev/null 2>/dev/null'的状态是1
#> $crashed
#> [1] TRUE
#>
#> $finished
#> [1] FALSE
#>
#> $errmsg
#> character(0)
TestWithRStudio
is under active development now. Any suggestion or issue reporting is welcome! You may report it using the link: https://github.com/Non-Contradiction/TestWithRStudio/issues/new. Or email me at lch34677@gmail.com or cxl508@psu.edu.