Because of the functionality of rbind.fill.matrix, which I’d rather not implement myself. It only accepts matrices.

On 30 Apr 2014, at 10:46, JanKanis <notifications@github.com> wrote:

> In transmartRClient/R/RClientConnectionManager.R:
> 
> > +        return(result)
> > +    }
> > +    return(NULL)
> > +}
> > +
> > +.listToDataFrame <- function(list) {
> > +    # add each list-element as a new row to a matrix
> > +    df <- matrix(nrow = 0, ncol = 0)
> > +    for (el in list) df <- rbind.fill.matrix(df, t(unlist(el)))
> > +
> > +    if (is.null(names(list)) || is.na(names(list)) || length(names(list)) != length(list)) { 
> > +        rownames(df) <- NULL
> > +    } else { rownames(df) <- names(list) }
> > +    # convert matrix to data.frame
> > +    as.data.frame(df, stringsAsFactors = FALSE)
> > +}
> Why do you first convert to a matrix and then to a data frame instead of converting to a data frame immediately?
> 
> —
> Reply to this email directly or view it on GitHub.
>