title: Compute for average of grades in R (RStudio)
body: <p>csv excel file (CLASS RECORD.csv) imported to RStudio</p>
  
  <p><a href="https://i.stack.imgur.com/bwT2K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bwT2K.png" alt="enter image description here"></a></p>
  
  <p><a href="https://drive.google.com/open?id=0By0EBRkKuYC3bUViM2ZPRElpSEE" rel="nofollow noreferrer">https://drive.google.com/open?id=0By0EBRkKuYC3bUViM2ZPRElpSEE</a></p>
  
  <p>by using a variable it becomes:</p>
  
  <pre><code>&gt; classrecord=(CLASS.RECORD)
  &gt; classrecord
           V1 V2 V3 V4 V5   V6      V7
  1     Names Q1 Q2 Q3 Q4 Exam Project
  2      ABLE 35 35 30 15   78      80
  3   ALVAREZ 30 36 30 15   86      90
  4 CARBAJOSA 50 28 30 18   88      90
  5      KHAW 30 36 30 15   70      85
  6  TAGUIBAO 50 45 30 18   92      95
  7     TILOG 28 32 30 10   63      80
  8  VIRTUCIO 26 30 30 15   72      80
  </code></pre>
  
  <p>how do I go about and compute for a term grade column? id like to add the other all up to 100% for that term grade: 40 % of average of Q1+Q1+Q3+Q4 (total 150), 40% of the Exam (total 100), and 20% of the project (total 100).</p>
  
  <p>im told that you have to add a data frame and compute in order to create a new column (i apologize for just giving a few lines of code, we were given this task without prior knowledge of R)</p>
  
  <p>i created: CLASS.RECORD$Term_Grade &lt;- (Term_Grade = 0)</p>
  
  <pre><code>UPDATE: classrecord &lt;- read.csv(file.choose(), header = TRUE) (find the excel file)
          classrecord$Term_Grade &lt;- ((classrecord$Q1 + classrecord$Q2 + classrecord$Q3 + classrecord$Q4)/150*50+50 *0.4 + classrecord$Exam*0.4+classrecord$Project*0.2)
  </code></pre>