Constraints in R Multiple Integer Linear Programming
I am working on some code in R to optimize my fantasy football lineup but I am having some difficulty with one constraint. I basically have a list of players, their position, expected points, and cost. Roster must include: 1 QB 2 RB 2 WR 1 TE 1 FLEX (either a RB, WR, or TE) Total cost under $200 My issue is that my code wants to pick the FLEX position as player it already selected as a WR, RB or TE. Here is the code I am using, I have a table that I imported with columns for player, position, points, and cost. In the table, any RB, WR, or TE is duplicated with the position as FLEX. I tried to