Q1: What are the differences among R, R Studio, and R Markdown?

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.

Q2: What are the differences among the R console, R script, and R Markdown file?

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.

Q3: What format must your homework be turned-in as to receive full credit?

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.

Q4: Compute the following two equations and present your answers below.

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

Q5: Choose one of the math functions above. When you run your code in R, do the number of spaces between the function name, parentheses, and numbers affect the result? Run three different trials. Explain and present your answers below.

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

Q6: Type the following functions into R. Present your output below. If you get an error message, attempt to explain the message using your own words.

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!