What is R?
R and Rstudio - What’s the difference?
Get R and Rstudio
- Download R at r-project.org
- Download Rstudio
Learning by doing: R and Rstudio
- Open Rstudio and get familiar with the interface.
- Create a new, empty R script.
- What is the difference between the script editor and the console?
- Copy the code below into the R script and run it line by line. Try to understand what each line does.
<- 5
a <- 10
b
+ b
a
<- a-b
p
<- c(3,12,6,9,23)
v
v
/ b
v
mean(v)
# sum(v)
Questions:
- Why does
p <- a-b
not produce an output? - What is
c()
? - Why does
# sum(v)
not work?