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:
favstats(fastest~seat,data=m111survey)
## seat min Q1 median Q3 max mean sd n missing
## 1 1_front 60 90.00 100 119 130 102.2593 19.15241 27 0
## 2 2_middle 80 90.00 100 110 143 102.9688 15.34230 32 0
## 3 3_back 90 97.25 115 130 190 121.9167 30.09820 12 0
You can also embed plots, for example:
bwplot(fastest~seat,data=m111survey,
xlab="Seating Preference",
yalb="Fastest Speed Driven (mph)",
main="Speed and Seating at GC")
use R to add 2 and 2, by inserting the appropriate command inside the code chunk below.
2+2
## [1] 4
How many heads did you get? 10
How many times did you simulate?
2000000
What percentage of the time did you get 15 or more heads?
.03
Suppose Buzz is just guessing: about what’s the chance that he would get 15 or more correct?
.03
Based on your results, do you think we have strong evidence that Buzz and Doris can communicate?
Yes
We can use R to find 2+7-3*5. Run the code chunk below to see if it works:
2+7-3*5
## [1] -6
You should get -6.
Next, insert write into the following the code needed to (25.5-20.2)/3:
Next, insert your own code chunk below and write into it the code needed to produce the 12 squared plus 10 squared.
Finally, insert your own code chunk and put write into it one line of code that does all of the following:
Run the following code chunk to learn about m111survey:
data(m111survey)
View(m111survey)
help(m111survey)
How many students took part in this survey?
Is fastest a numerical variable or a factor variable?
Is seat a numerical variable or a factor variable?
How many students did not answer the question about their ideal height?
In the following code chunk, insert the code needed to make a list of 100 fives.
In the following code chunk, insert the code needed to make a list of all the numbers from 100 to 220, going up in steps of 10.