Learning objective
- R studio + r script
- Basic coding
- Packages and help function
- Import data and explanatory analysis
- Vectors
- R markdown
R studio and R script
R studio: integrated development environment for r programming. Makes the coding efficient and reliable.
R studio has 4 different panels.
,Use editor window so the codes can be saved.
In R consult, you can input the command and view the results.
Enivronemtn: list al the data and variables.
History; see the previous commands and rerun this.
Bottom right: files: data/ docuemtn that are listed
Plots: show the figures.
Package: all the packages that can be installed.
Help: explanatory documentations for each package or command.
Save commands: so you can use it in anny time.
R script use to save them.
New file: File → new file → r scrip.t → save
Use # : is a comment, not a code.
Red cross: is an error.
Coding Basics
1. Calculator: input the formula in the command line.
CTRL +enter = execute.
2. Create new objects.
,Text between ‘’ to be read.
, Distinguish upper and lower case ( hoofdletter)
Console + code not complete
Esc to cancel command → revise and rerun
R: code completion function → use tab key
Always close the code