bergant / datamodelr

Data model diagrams in R
Other
285 stars 28 forks source link

error when using single column dataframes #7

Closed backsy closed 6 years ago

backsy commented 6 years ago
Error in data.frame(column = names(t1), type = sapply(t1[0, ], function(x) paste(class(x), : arguments imply differing number of rows: 1, 0
6. stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), collapse = ", ")), domain = NA)
5. data.frame(column = names(t1), type = sapply(t1[0, ], function(x) paste(class(x), collapse = ", ")), stringsAsFactors = FALSE)
4. FUN(X[[i]], ...)
3. lapply(names(tables), function(table_name) { t1 <- tables[[table_name]] columns <- data.frame(column = names(t1), type = sapply(t1[0, ], function(x) paste(class(x), collapse = ", ")), stringsAsFactors = FALSE) ...
2. do.call(rbind, lapply(names(tables), function(table_name) { t1 <- tables[[table_name]] columns <- data.frame(column = names(t1), type = sapply(t1[0, ], function(x) paste(class(x), collapse = ", ")), stringsAsFactors = FALSE) ...
1. dm_from_data_frames(flights, messages, timestamps, parameters, values)

dataframe flights has only one column and the dm_from_data_frames() errors.

> str(flights)
'data.frame':   2 obs. of  1 variable:
 $ id: int  1 2
bergant commented 6 years ago

Thanks for reporting this.