How to have combinations that match requirements ?

Hi,
I have a dataframe with courses ("courses") and the number of hours the course is teached for a year ("hours")

my problem is that for each course, i have to choose someone to teach it. every teacher have a profil which are either :

  • Perm
  • Vac
  • temp
    -other

The amount of hours teach a year (the sum of all hours) must be given by at least :

  • 90% of ("Perm" + "Vac" + temp)
  • 50% of ("Vac"+ "temp")
  • 20% of "temp".

Is it possible to have combinations of which profile should teach which course to match the requirements ?

my dataframe would look like that.

Course Hours combination1 combination2
course1 200 ? ?
course2 50 ? ?
course3 150 ? ?
course4 220 ? ?
course5 25 ? ?

in that exemple, at least :
-129 hours should be teach by temp teachers
-322,5 hours should be teach by Vac or temp teachers
-580,5 hours should be teach by Temp, Vac or perm teachers

Is it possible ?

Hi @tischana, a first step would be to post your data frame so others can help you more easily: Let's say your data frame is called my_data. Then what you would do is run the command dput(my_data), which will produce output in the console. Then you would copy that output and paste it here, between a pair of triple backticks (```, you can find ` just below the 'esc' key), like this:

```
<-- paste output of dput(my_data) here
```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.