Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #LAB 07
- #importing text .txt file
- #to see the current path
- getwd()
- #first set path to the exact folder
- setwd('C:\\Users\\cr\\Desktop\\LAB07')
- data<-read.table('Forest.txt',header = TRUE,sep = ",")
- # ctrl+l for clear the terminal
- attach(data)
- fix(data)
- #close the data widow before execute anymore commands
- #q2)
- str(data)
- #q3)
- #ANSWER - 517 Observations(number of rows in the dataset)
- #q4)
- min(wind)
- max(wind)
- #q5)
- summary(temp)
- #q6)
- #to simply find the out liers ou can create a bloxplot
- boxplot(wind,horizontal = TRUE,outline = TRUE,pch=16)
- #pch is for the symbol (star, circle, traingle)
- #this is a negative distribution.
- #you can see midle line of the boxplot is close to the right side margin of the bloxplot
- #if it close to the left side it will called as Positive distribtion
- #if it lie on the center , called normal distribution
- #q08)
- median(temp)
- #09)
- mean(wind)
- sd(wind)
- #to get value for the whole data set at once.
- #second parameter is anything Etc: sd,mean,median
- sapply(data,sd)
- #10)
- # interqurtile means: q3-q1
- IQR(wind)
- #11)
- #in this we have to have consern two colomns to get the answer
- freq<-table(day,month)
- freq
- #from this view you can find out the observation count
- #ANSWER - 21
- #12)
- mean(temp[month=='sep'])
- #13)
- freq
- #ANSWER: saturday
- #you can refer the previous table we have created.
- barplot(freq,beside = TRUE,xlab = "month",ylab = "frequncy",legend=rownames(freq))
- #using beside true -> you will get a separate bar for each and every day.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement