Skip to content
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

Rename crossover and create separate function for cases where a function is supplied as .y argument #9

Open
TimTeaFan opened this issue May 22, 2021 · 0 comments
Labels
further discussion needed this issue needs further discussion next major release try to implement this in the next major release

Comments

@TimTeaFan
Copy link
Owner

At the moment crossover has two functionalities:

  1. Its the equivalent to across2x and over2x when an object (vector or list) is supplied to .y
  2. It behaves different, when a function is supplied to .y. In this case the function in .y is applied on all columns in .xcols an the functions in .fns are applied to the resulting return object (of the function in .y being applied to all .xcols).

The behavior in 2. is helpful when creating dummy variables and unique() or dist_values is supplied to .y. However, since the functionality is quite different from what crossover does normally this behavior should be implemented in a separate function, mabye called crossfun().

Further, when a vector or list is supplied to .y then the behavior of crossover resembles to across2x and over2x. Therefore, the current function should be renamed to crossoverx(). I considered this once, but refrained from this naming convention, since it is hard to read and decipher compared to across2x and over2x where we have 2 as a separator. Still at the moment there is no equivalent of crossover to over2 or across2. Originally I thought that this functionality is not much needed, and maybe this really is the case, but introducing a different behavior under a similar name is likely to confuse users. So even if a new sequential crossover might not be used very often, it should still exist and the current function should be renamed to crossoverx, while the .y argument accepting function should be put into a separate function ( crossfun).

@TimTeaFan TimTeaFan added the further discussion needed this issue needs further discussion label May 22, 2021
@TimTeaFan TimTeaFan changed the title Split crossover into several functions Rename crossover and create separate function for cases where a function is supplied as .y argument May 22, 2021
@TimTeaFan TimTeaFan added the next major release try to implement this in the next major release label May 22, 2021
@TimTeaFan TimTeaFan added this to the next major release milestone May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
further discussion needed this issue needs further discussion next major release try to implement this in the next major release
Projects
None yet
Development

No branches or pull requests

1 participant