File: touch.betas.R

package info (click to toggle)
r-cran-eipack 0.2-2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 476 kB
  • sloc: ansic: 1,155; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 446 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
touch.betas <- function(names) {
  check <- system("ls", intern = TRUE)
  if (any(check %in% names)) {
    exist <- na.omit(check[match(names, check)])
    stop(paste( length(exist), " files already exist in ", getwd(), ".  Either select a new working directory or remove these files and try again.", sep = ""))
  }
  for (ii in names) {
    cmd <- paste("echo \"", ii, "\" | gzip >> ", ii, sep = "")
    system(cmd)
  }
  return(invisible(0))
}