Welcome to R.
Work Flow
Reproduceable Analysis: 可重现分析
How to organize your project?(just some suggestions)
- Save the original files others sent to you
- Name those original file folders by time
- Format data in Excel
A small trick: View -> Freeze Panes
Save Excel files as Excel Workbook, otherwise the format you made won’t be kept. - Don’t edit text files directly
- Analysis Files
Today’s Tips:
- There’s a programming language in Excel called VBA
- R script: like a huge R code chunk. The outputs will be shown in Console window and the graphs will be shown in Plots windows on the right of R Studio.
- π in R is pi.
Review of Graphs
Pie Chart
To show the relative proportions.
One-dimentional Graph
Strip Chart
1 |
stripchart( rivers, |
Box Plot
1 |
boxplot( rivers, |
Histogram
1 |
hist( rivers, |
Stratified Graphs
use “~”.
Two-dimentional Graphs
Scatter Plot
1 |
plot( iris$Petal.Width ~ iris$Petal.Length, |
近期评论