tar_select_targets()
returns incorrect targets when they are not in alphabetical order
#92
Closed
7 tasks done
Labels
Prework
tarchetypes
and not a known limitation, usage error, or issue from another package thattarchetypes
depends on. If you are unsure, please submit a discussion thread instead.Description
Thanks for the great package ecosystem! Sorry if I am misunderstanding anything here.
tar_select_targets()
returns incorrect targets when they are not in alphabetical order. In the reprex below, I slightly modified the example in thetar_select_targets()
help file, to change the order of targets within thetargets
list, and also make the returned values a bit more obvious. Notice how in the output the returned "y1" target is actually the "x" target (see names and command).I think that the issue comes from the
sort()
function in this line:tarchetypes/R/tar_select_targets.R
Line 29 in d8bded8
Reproducible example
Created on 2022-04-07 by the reprex package (v2.0.0)
Session info
Expected result
The returned targets should not depend on how the targets are ordered in the input list. I think that simply removing
sort()
from the function fixes the issue (see reprex below), but I might be misunderstanding its role?Thank you!
Created on 2022-04-07 by the reprex package (v2.0.0)
Diagnostic information
tarchetypes
currently installed: d8bded8The text was updated successfully, but these errors were encountered: