-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cbinding data with different row number or row ids #309
Comments
Not very well tested yet, but should work. |
I guess I would have to construct the cbind backend explicitly instead of using Task$cbind for this? |
Is there an assertion in task$cbind() or why do you want to do this explicitly? |
> it = mlr_tasks$get("iris")
> it$cbind(data.table(x = 1:200))
Error in `[[<-.data.frame`(`*tmp*`, pk, value = 1:150) :
replacement has 150 rows, data has 200
> it$cbind(data.table(x = 1:100))
Error in `[[<-.data.frame`(`*tmp*`, pk, value = 1:150) :
replacement has 150 rows, data has 100 and even if it did work, there would probably need to be a mechanic to indicate which row of the new data belongs to which row of the task. What does work is something like
is this the intended way of doing this? |
We should do a call to figure this out. |
I guess it should be fine to manually fill with NAs in mlr3pipelines. |
Is there a way to make
$cbind()
behave like an outer join, so data with different rows can be added and the missing fields filled with NAs? See mlr-org/mlr3pipelines#216The text was updated successfully, but these errors were encountered: