Tuesday, 8 January 2013

ITBAL-1 on Jan 8th

Today's class introduced us to software package 'R' - very useful in statistical computing and graphics. Some of the basic commands and plots. The assignments are below:

Data used:
Nifty Indices from Oct 1, 2012 to Jan 4, 2013. Source - NSE (http://www.nseindia.com/products/content/equities/indices/historical_index_data.htm)

The complete data:

Command:
z<-read.csv(file.choose(),header=T)


Question 1 : Plotting values in histogram

Command:
zcol1<-z[ ,3]



Question 2 : Plotting values 'dots and lines' along with title and labels

Command:
zcol2<-z[ ,4]
plot(zcol2,type="b",main="NSE data",xlab="time",ylab="value")



Question 3 : Plotting scatterchart

Command:
zcol2<-z[ ,3]
plot.default(zcol2,main="NSE Scatter",xlab="time",ylab="value")


Question 4 : Finding max and min indices

Command:
zmerge<-c(zcol1,zcol2)
range(merge)







No comments:

Post a Comment