R tutorial (Intro to r)

Codes in the tutorial:

 

getwd()
setwd(“./Rtutorial”)

install.packages()

??ggplot2

Height <- c(1,2,3,4,5)
Species <- c(“A”,”B”,”C”, “D”,”E”)
dat <- data.frame(Height,Species)
dat

 

Anuj <- read.csv(“./data file name.csv”)
Anujfunction <- read.csv(file.choose()) # Load data

attach(dat)

 

dat <- iris
dat
str(dat)

plot(Sepal.Length)

dat$Sepal.Length <- as.numeric(dat$Sepal.Length)

plot(dat$Sepal.Length, dat$Sepal.Width, xlab=”Length”, ylab=”Width”, main=”First plot on R”)

summary(dat)

Setosta <- filter(dat, Species==”setosa”)

Setosta

Facebook Comments Box

Mr Zoologist

I am a Zoologist!

Leave a Reply

Your email address will not be published. Required fields are marked *