title: Pythagorean Theorem in R programming
body: <p>I want write R code for Pythagoras theorem.</p>
  
  <p>The Pythagorean Theorem states that the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides.</p>
  
  <blockquote>
    <p>(sideA)^2+(SideB)^2=hypotenuse^2</p>
  </blockquote>
  
  <p>Now I wrote the R code as below:</p>
  
  <pre><code>pythag&lt;-function(sidea,sideb){
  if (sidea&gt;=0&amp;sideb&gt;=0)
  hypoteneuse=sqrt(sidea^2+sideb^2)
  else if (sidea&lt;0|sideb&lt;0)
  hypoteneuse&lt;-"Values Need to be Positive"
  else if (!is.vector(x))
  hypoteneuse&lt;-"I need numeric values to make this work"
  print(hypoteneuse)
  }
  pythag(4,5)
  pythag("A","B")
  pythag(-4,-5)
  </code></pre>
  
  <p>In case of pythag(4,5) it is ok, also pythag(-4,-5) is giving comment "Values Need to be Positive".</p>
  
  <p>But in case of pythag("A","B") I want comment "I need numeric values to make this work", but unfortunately my code does't work for this.</p>