[R] New R user- Simple optimization problem

Bert Gunter bgunter.4567 at gmail.com
Thu Feb 16 02:46:32 CET 2017


If so, we don't do hw here. Otherwise, we usually ask people to show us
their failed coding efforts rather than expecting us to do the problem for
them. Please read and follow the posting guide.



On Feb 15, 2017 10:25 AM, "Brady Richter" <bradyrichter at gmail.com> wrote:

Hi I am learning R currently and I having trouble structuring a program.

Data consists of 1 data frame with a day of the week, a class list, and a
utility score.

Date                   Class                   Utility

Monday              Chem                  85

Monday              Physics               75

Tuesday              Chem                  95

Tuesday              Math                  93

Tuesday              History               87

Tuesday              Language           86

And so on through Friday.

I want to maximize total utility (the sum) given 2 constraints:

1.      The number of classes you must take each day is fixed. (Must take 1
class on Monday, 2 on Tuesday, 1 on Wednesday etc.)
2.      No repeats- You can only take any given class zero or one time.

Any help to go about this would be appreciated.

Thank you.


        [[alternative HTML version deleted]]

R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list