M.Sc. Marco Antonio Peixoto
- PhD. candidate in genetics and breeding - UFV
- Visiting scholar researcher - University of Florida
- Quantitative genetics/genomics and data analyses
Date: 08/27/2022
Time: 9-12 am (GMT 3)
This is a repository created to aid the short course in R programming offered to Núcleo de estudos em Silvicultura - UFLA
2 Introduction to R and RStudio
3 Basic functions and structures in R language
8 Plotting using ggplot2 package
Use the following link to download the R program and install it on your computer. It can be done for Windows, Linux, and MAC systems. After the download and installation of R, you can also download and install RStudio. RStudio is an IDE (integrated development environment). It makes your life easier.
- Download R (https://cran.r-project.org/)
- Download RStudio (https://www.rstudio.com/products/rstudio/download/)
Tip: go to this link (https://www.youtube.com/watch?v=28bKdOtIgSY) they will explain to you everything that you need to download and install both tools
- Integration, IDE, console, R environment, and communities
- mean, variance, median, length, dim, str
- data structure: matrix, dataframe, list, arrays
Vector
V1 = c(1:15)
V1[1]
Matrix
M1 = matrix(V1, nrow = 5,ncol = 3)
M1[1,3]
Arrays
V2 = c(16:30)
M2 = matrix(V2,ncol=3,nrow=5)
A1 = array(c(M1,M2), dim=c(3,5,2))
Data frame
df1 = data.frame(id=c(rep(c(1,2,3,4,5),2)),
Var1=c(rnorm(10,10,1)),
Var2=c(runif(10,2,5)),
Var3=c(rep(c("a","b"),5)))
str(df1)
List
L1=list()
L1[[1]] = c(1,2,5,6,4,5,4,9)
L1[[2]] = c(54,28,68,45,75,98,74,68,45,45,"u","t","d",3,"x",6)
L1[[3]] = c(rnorm(18, 2,0.7))
str(L1)
- Import and export/save datasets
- What is a function?
- What is a package and how to install and use them
- Analyses of variance using the package Agricolae (Mendiburu, 2021)
- Implementation of tukey test
- Regression model
y = B0 + B1 + e
- Installing the package ggplot2
- Saving the graphs
#Paste
paste()
paste0()
#binds
rbind()
cbind()
tydiverse
ggplot2
dplyr
plyr
stringr
#Graphics
https://r-graph-gallery.com/index.html
#Packages cheatsheet
https://www.rstudio.com/resources/cheatsheets/