title: prime numbers in R
body: <p>I am trying to write a function to calculate all prime numbers below 100. Unfortunately, I need to use the mod division function in R (%%) to test each number from 1 to 100 against all values below it and the final output should result in a vector of all prime numbers.</p>
  
  <p>Here is what I have so far, but am not sure where I'm going wrong, or how to go about fixing this at all. I'm new to programming and R, and so I'm having a bit of a tough time with it. I have looked at the other questions on StackOverflow to try to understand how to change the code to get it to work, but am not having any luck (also, when I try to run those codes, they do not seem to generate responses through R).</p>
  
  <pre><code>prime &lt;- function(x){
  for(i in 1:100)
  if(x==1){print("TRUE")}
  if((x %% (1:x-1))==0){print("TRUE")}
  else{print("FALSE")}
  
  
  print(seq(as.numeric("TRUE")))
  </code></pre>
  
  <p>Any help will be appreciated!</p>
  
  <p>Thank you!</p>