R/readConstraint.R

Defines functions readConstraint

Documented in readConstraint

readConstraint <-
function(x, ...) {
    fn <- if(!missing(x)) {
        Sys.glob(x)
    } else if(interactive()) {
        file.choose()
    } else {
        NULL
    }

    if(!is.null(fn)) {
        x <- read.table(file=fn, header=TRUE, stringsAsFactors=FALSE, ...)
        cNames <- tolower(names(x))
        cNames[cNames == "patid"] <- "patID"
        setNames(x, cNames)
    } else {
        warning("No single file was selected")
        NULL
    }
}

Try the DVHmetrics package in your browser

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

DVHmetrics documentation built on March 23, 2022, 5:08 p.m.