Conflict masking

When loading .csv using sqldf everything goes fine until data.table . For instance:

 library(sqldf) write.table(trees, file="trees.csv", row.names=FALSE, col.names=FALSE, sep=",") my.df <- read.csv.sql("trees.csv", "select * from file", header = FALSE, row.names = FALSE) 

works well

 library(data.table) my.df <- read.csv.sql("trees.csv", "select * from file", header = FALSE, row.names = FALSE) # Error in list(...)[[1]] : subscript out of bounds 

does not. When loading, data.table tells you that

 The following object(s) are masked from 'package:base': cbind, rbind 

So i tried this

 rbind <- base::rbind # `unmask` rbind from base:: library(data.table) my.df <- read.csv.sql("trees.csv", "select * from file", header = FALSE, row.names = FALSE) rbind <- data.table::rbind # `mask` rbind with data.table::rbind 

which is working. Before I put all my code with this trick:

What is the best solution for resolving masking conflicts in R?

EDIT . There is a closely related stream here, but no general solution is proposed.

+6
source share
1 answer

According to the comments yes, please write a bug report:

 bug.report(package="data.table") 

Thus, this will not be forgotten, you will receive an automatic email every time the status changes, and you can open it again if the correction is insufficient.

EDIT:

Now in v1.6.7 on R-Forge:

  • Compatibility with the sqldf package (which can call do.call("rbind",...) on an empty ... ) is fixed and a test is added. data.table included list(...)[[1]] , not ..1 . Thanks to RYogi for reporting No. 1623.
+2
source

Source: https://habr.com/ru/post/899348/


All Articles