Magnetar
Magnetar

Reputation: 197

full join error in R since switching from read.csv

I've just swapped out read.csv for vroom and since then my full_join is not working. It throws following error

Error in [.data.table(y, x, nomatch = if (all.x) NA else NULL, on = by, : logical error. i is not a data.table, but 'on' argument is provided.

I've seen some other answers relating to this but can't see how it applies to my code..

DataA <- vroom("data/DataA.csv")
DataB <- vroom("data/DataB.csv")
AllData <- full_join(DataA, DataB, by = 'ID')

I've tried removing the join 'by' but makes no difference. What has changed between the way vroom takes in the data and the way readr does? Data is all dataframes. Should this be changed to work with vroom?

Data: DataA: chr(24), dbl(5) lgl(6) DataB: chr(6), dbl(5) ID is character on intake, but converted to numeric before join They are not datatables, but dataframes.

Any guidance appreciated

Upvotes: 0

Views: 20

Answers (1)

Magnetar
Magnetar

Reputation: 197

data needs to be converted to data.table from Vroom pkg using setDT before full_join will work.

Upvotes: 0

Related Questions