R/chooseDTAFile.R

Defines functions chooseDTAFile

chooseDTAFile = function(f) {
    if (is.null(f) || !file.exists(f)) {
        library(tcltk)
        f = tclvalue(tkgetOpenFile(title="Choose a Lotek .DTA file for input",
            initialdir = ifelse(exists("sensorgnome.dtadir"), sensorgnome.dtadir,"."),
            filetypes="{{Lotek DTA files} {.DTA}} {{All files} {.*}}"))
        if (length(f) == 0 || nchar(f)[1] == 0)
            stop("Cancelled")
    }
    sensorgnome.dtadir <<- dirname(f)
    return(f)
}
jbrzusto/sensorgnome-R-package documentation built on May 18, 2019, 9:19 p.m.