My first knitr Document

Angie Felipe

This is some text (i.e. a “text chunk”). Here is a code chunk.

Only results are printed.

## [1] 0.1088874

Hiding Results

Here is a code chunk but it doesn’t print anything!

Inline TExt Computations

Here I will use the variables computed above:

The current time is sáb mar 03 16:16:23 2018. My favorite random number is -0.6203667.

Incorporating Graphics

Let’s first simulate some data

x<-rnorm(100); y<-x+rnorm(100,sd=0.5)

Here is a scatterplot of the data

par(mar =c(5,4,1,1),las=1)
plot(x, y, main="Simulated Data")

Making Tables with xtable

First I work out the model

library(datasets)
data("airquality")
library(stats)
fit<-lm(Ozone~Wind+ Solar.R + Temp,data=airquality)

Then I print the table of regrression coefficients

library(xtable)
xt<-xtable(summary(fit))
print(xt, type = "html")
Estimate Std. Error t value Pr(>|t|)
(Intercept) -64.3421 23.0547 -2.79 0.0062
Wind -3.3336 0.6544 -5.09 0.0000
Solar.R 0.0598 0.0232 2.58 0.0112
Temp 1.6521 0.2535 6.52 0.0000