title: condtional computation based on two dataframes in R
body: <p>I am performing this computation that involves two data frames.I created two reproducible examples of the two data frames as an example</p>
  
  <p><code>&gt; df1
              Day1      Day2      Day3      Day4      Day5      Day6      Day7      Day8      Day9      Day10
  Time1 0.03 0.43 0.39 0.41 0.94 0.70 0.18 0.65 0.72 0.72
  Time2 0.42 0.63 0.93 0.53 0.19 0.55 0.22 0.16 0.56 0.04</code></p>
  
  <p>and </p>
  
  <p><code>&gt; df2
     Day Time        X3        X4        X5
  1   1  1  9.252042 19.512621 11.601671
  2   1  2  5.021522 17.712484  5.044728
  3   2  1  9.603795 19.404302 17.206771
  4   2  2 19.686793 18.791541 12.655874
  5   3  1  7.546551 18.810526 19.865979
  6   3  2 18.233872 19.596584 11.653980
  7   4  1 17.499680 14.014276 15.553013
  8   4  2  8.115352 17.898786 12.841630
  9   5  1 10.719540  8.518823 19.126440
  10  5  2 12.853401  6.026599 14.041490
  11  6  1 19.984946 10.693528  6.890835
  12  6  2 16.360035 15.778092 18.087471
  13  7  1 15.498714 15.039444  5.259257
  14  7  2 13.179111 17.533358  7.382507
  15  8  1  5.124188 15.507194 12.547365
  16  8  2  8.008336 10.463382  6.934014
  17  9  1 11.246527  6.975527 14.464758
  18  9  2 17.914083 18.039384 19.324091
  19 10  1  9.876625 19.216317  8.787550
  20 10  2 11.851955 15.729080  5.741095</code></p>
  
  <p>the columns in df1 represent days that the values were recorded and the rows indicate the hours/or time (time 1 or 2). In df2, the first two columns represent the days and times respectively and the other columns are for the locations where data was recorded.</p>
  
  <p>what I will like to do with R is to create another data frame which has the same size as df2, that divides the values in df2[,3:5] by the corresponding df1 value i.e depending on the values in the day and time columns of df2, select the corresponding values of df1.
  an example is for for the first value of df2$X3, in the new data frame I will have a value of 9.252042 divided by 0.03. and for the third value of df2$X3, I will have a value of 9.603795 divided by 0.43.</p>
  
  <p>Thank you in advance for any help!</p>