R/fprintf.R

Defines functions fprintf

## Function written to match MATLAB function
## Author: Andrew Hooker

fprintf <- function(file="",...,both=FALSE){
  if(any(class(file)=="file")){
    cat(sprintf(...),file=file)
  } else {
    if(file==""){cat(sprintf(...))} else {
      cat(sprintf(file,...))
    }
  }
  if(both && file!=""){
    cat(sprintf(...))
  }
}

Try the PopED package in your browser

Any scripts or data that you put into this service are public.

PopED documentation built on May 21, 2021, 5:08 p.m.