R Under development (unstable) (2024-07-28 r86931 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > message("*** install() / uninstall() ...") *** install() / uninstall() ... > > print(startup:::is_installed()) [1] FALSE > > path <- tempdir() > > > message("- install() ...") - install() ... > > file <- file.path(path, ".Rprofile") > res <- startup:::is_installed(file) > print(res) [1] FALSE > stopifnot(!res) > > print(startup:::install(file)) Creating R profile directory: 'D:/temp/RtmpCQ3D26/.Rprofile.d' Creating R environment directory: 'D:/temp/RtmpCQ3D26/.Renviron.d' Created new R startup file with 'startup::startup()': 'D:\temp\RtmpCQ3D26/.Rprofile' [1] "D:\\temp\\RtmpCQ3D26/.Rprofile" > res <- startup:::is_installed(file) > print(res) [1] TRUE attr(,"file") [1] "D:\\temp\\RtmpCQ3D26/.Rprofile" > stopifnot(res) > > res <- tryCatch({ + startup:::install(file, backup = FALSE) + }, warning = identity) startup::startup() already installed: 'D:\temp\RtmpCQ3D26/.Rprofile' > print(res) > stopifnot(inherits(res, "warning")) > > cat("# Empty\n", file = file) > print(startup:::install(file, backup = FALSE)) Added 'startup::startup()' to already existing R startup file: 'D:\temp\RtmpCQ3D26/.Rprofile' [1] "D:\\temp\\RtmpCQ3D26/.Rprofile" > res <- startup:::is_installed(file) > print(res) [1] TRUE attr(,"file") [1] "D:\\temp\\RtmpCQ3D26/.Rprofile" > stopifnot(res) > > > message("- uninstall() ...") - uninstall() ... > > print(startup:::uninstall(file)) Backed up R startup file: 'D:\temp\RtmpCQ3D26/.Rprofile' (110 bytes) -> 'D:\temp\RtmpCQ3D26/.Rprofile.bak.20240729-233540' (110 bytes) R startup file updated: 'D:\temp\RtmpCQ3D26/.Rprofile' [1] "D:\\temp\\RtmpCQ3D26/.Rprofile" > > res <- startup:::is_installed(file) > print(res) [1] FALSE attr(,"file") [1] "D:\\temp\\RtmpCQ3D26/.Rprofile" > stopifnot(!res) > > res <- tryCatch({ + startup:::uninstall(file) + }, warning = identity) startup::startup() not installed: 'D:\temp\RtmpCQ3D26/.Rprofile' > print(res) > stopifnot(inherits(res, "warning")) > > message("*** install() / uninstall() ... DONE") *** install() / uninstall() ... DONE > > proc.time() user system elapsed 0.14 0.06 0.18