Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Extra
- #.xlsx --> .csv
- #Opening csv file
- #data{#variable name} <- read.csv('filename.csv', header=TRUE)
- #Opening text file
- #data{#variable name} <- read.table('filename.txt', header=TRUE,sep=","{#Because data is seperated by ','s})
- #To clear console
- #Ctrl + L
- #LAB 07
- #Set Path
- setwd("C:\\Users\\it18011012\\Desktop\\IT18011012")
- getwd()
- #1
- #read data from the text file
- data<-read.table("Forest.txt",header=TRUE,sep=",")
- attach(data)
- fix(data)
- #2
- #Summary/Strucure of data variable
- str(data)
- #3
- #str - Used to count obesrvations
- #Observations = 517
- #4
- min(wind)
- max(wind)
- #5
- summary(temp)
- #6
- boxplot(wind, horizontal = TRUE, outline = TRUE, pch=16)
- #pch = Symbols for representing outliers. ex:-8,16,24
- #7
- #Negative
- #8
- median(temp)
- #9
- mean(wind)
- sd(wind)
- sapply(data,sd)
- #10
- IQR(wind)
- #11
- #Create a frequency table with day &month count
- freq<-table(day, month)
- freq
- #Answer = 21
- #12
- #Average = Mean
- mean(temp[month=='sep'])
- #13
- barplot(freq,beside = TRUE,xlab = "Month",ylab="Frequency",legend=rownames(freq))
- #Beside = TRUE --> Bars in seperate
- #Beside = FALSE --> Bars in one
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement