https://github.com/cran/foreign
Raw File
Tip revision: 3df343a1f3be96337da5a8b8a765edfb4cd207a8 authored by R-core on 29 March 2006, 00:00:00 UTC
version 0.8-15
Tip revision: 3df343a
R_systat.R
# Copyright 2004 by Roger Bivand
#

read.systat <- function(file, to.data.frame=TRUE)
{
    if (length(file) != 1) stop("only one file")
    if (!is.character(file)) stop("file must be character")
    res <- .Call(readSystat, as.character(file))
    if (to.data.frame) {
        comment <- NULL
        if (!is.null(attr(res, "comment")) &&
            (nchar(attr(res, "comment")) > 0))
            comment <- attr(res, "comment")
        res <- as.data.frame(res)
        if (!is.null(comment)) comment(res) <- comment
    }
    res
}
back to top