0

i need to distribute some days along the year.

I have 213 activities and 247 days.. i need to plan this activities, but i need to cover the maximum time what can be possible.

I am substracting the total days - activities, in this case 34, i divide the total days with the previous result: 247/34= 7,26...

With this number i know what every seven days y have one without activity. To code this part i doing this:

where day is a "for" variable what its looping a dataframe with dates and integer its the integer part of 7,26, in this case 7

if(day%%integer==0) {
      aditional <- 0
    } else {
      aditional <- 1
    }
#
if(day%%7==0) {
      aditional <- 0
    } else {
      aditional <- 1
    }

The result will be:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

In bold font the day without activity

This way its cool, but its not so precise how i want.

I know i need to use the decimal part of the result of 7,26... 26, but i dont know how do it.

Can you help me please?

Thanks and sorry for my english

Ruben DC
  • 3
  • 2
  • 2
    Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – Sotos Aug 10 '17 at 14:35

1 Answers1

1

Make these 34 days the non-activity days:

round((247/34) * seq(34))

giving:

 [1]   7  15  22  29  36  44  51  58  65  73  80  87  94 102 109 116 124 131 138
[20] 145 153 160 167 174 182 189 196 203 211 218 225 232 240 247
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341