R is the programing language and the software envrionment. R Studio is the integrated devlopment environment that uses R. R Markdown is inside R Studio that creates and organized report that can be downloaded as HTML, PDF or Word.
R script is a plain text file that’s better to use for making multiple lines of code. R console is the part that exectues the commands using R and does statistical and mathematical outputs. R Markdown file is the just the file output that is made by the R markdown.
It must be a R markdown file that is knitted to a PDF and uploaded through Sakai or knitted into a HTML and published through RPub.
Note: The below code is math mode. You can see the formula in the HTML or PDF.
\[ \tan(1) - (67.2^{0.5} * 19) \]
\[ \lvert -0.3^{0.82} + \cos(\pi/\sqrt{2}) \rvert - 0.585479 \]
tan(1) - (67.2^{0.5} * 19)## [1] -154.1962
abs(-0.3^{0.82} + cos(pi/sqrt(2))) - 0.585479## [1] 0.3928179
ANSWER HERE
tan (1) - (67.2^{0.5} * 19) #For this one if you add a space between tan and (1) it doesn't affect the answer.## [1] -154.1962
tan( 1 ) - ( 67.2^{ 0.5 } * 19 ) #If you add a space between the parenthasis you get get same answer.## [1] -154.1962
tan(1) - (67.2 ^{0.5} * 19 ) #If you add spaces between the number and the exponent you get the same answer.## [1] -154.1962
Note: The below code is math mode. You can see the formula in the HTML or PDF. \[ tan(0.5) \] \[ tan 0.5 \] \[ ton(0.5) \] \[ tan0.5 \]
tan(0.5) This is the correct way and gives you the tangent of 0.5. tan 0.5 This is incorrect because tangent isn’t applied to 0.5 because 0.5 is just a random number when it’s not associated with tangent there needs to be parenthasis. ton(0.5) This one is incorrectly spelled so there no function called ton. ton0.5 When presented like this R thinks that ton0.5 is an object.
The knit won’t print the rest of the codes under ```{r, echo=TRUE}
tan(0.5) # This is the correct way and gives you the tangent of 0.5## [1] 0.5463025
Please turn–in your homework via Sakai by saving and submitting an R Markdown PDF or HTML file from R Pubs!