Skip to content

marcopxt/NES-UFLA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 

Repository files navigation

Short course on R environment

M.Sc. Marco Antonio Peixoto

  • PhD. candidate in genetics and breeding - UFV
  • Visiting scholar researcher - University of Florida
  • Quantitative genetics/genomics and data analyses

Information

Date: 08/27/2022

Time: 9-12 am (GMT 3)


Introduction

This is a repository created to aid the short course in R programming offered to Núcleo de estudos em Silvicultura - UFLA


Summary

1 Download R and RStudio

2 Introduction to R and RStudio

3 Basic functions and structures in R language

4 Functions and packages

5 Models (AoV)

6 Tukey test

7 Regression models

8 Plotting using ggplot2 package


Content

1 Download R and RStudio

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.

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

2 Introduction to R and RStudio

  • Integration, IDE, console, R environment, and communities

3 Basic functions and structures in R language

  • 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

4 Functions and packages

  • What is a function?
  • What is a package and how to install and use them

5 Models (AoV)

  • Analyses of variance using the package Agricolae (Mendiburu, 2021)

6 Tukey test

  • Implementation of tukey test

7 Regression model

  • Regression model

y = B0 + B1 + e

8 Plotting using ggplot2 package

  • Installing the package ggplot2
  • Saving the graphs

Sources that you may use

i. Github

ii. Coursera

iii. Youtube

iv. Usefull functions

#Paste
paste()
paste0()

#binds
rbind()
cbind()

v. Usefull packages

tydiverse
ggplot2
dplyr
plyr
stringr

vi. Usefull websites

#Graphics

https://r-graph-gallery.com/index.html

#Packages cheatsheet

https://www.rstudio.com/resources/cheatsheets/

Main Menu

About

Repository with the content of the course "Introdução ao R e RStudio" offered to NES-UFLA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors