This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
Name <- c("Frank","Bob","Sally","Susan","Joan")
Age <- c(34,28,19,28,30)
BMI <- c(24.2,18.3,15.4,22.7,29.2)
dat1 <- data.frame(Name,Age,BMI)
str(dat1)
## 'data.frame': 5 obs. of 3 variables:
## $ Name: chr "Frank" "Bob" "Sally" "Susan" ...
## $ Age : num 34 28 19 28 30
## $ BMI : num 24.2 18.3 15.4 22.7 29.2
dat1$Log.Age <- log(dat1$Age)
dat1$BMI.Sqrt <- sqrt(dat1$BMI)
dat1$smoking <- c("Yes","No","No","Yes","Yes")