Thursday, March 28, 2013

ITBA lab Session # 10 - 26 March 2013

#this post is created as a solution for assignment for IT & Business Applications Lab, Spring Semester, VGSoM, IIT Kharagpur Class of 2014

Topic:
3D plotting in R

Assignment:1
Create 3 vectors, x, y, z and choose any random values for them, ensuring they are of equal length, bind them together.Create 3 dimensional plots of the same.

Solution 1:


plot3d(final)



plot3d(final,col=rainbow(1000))


plot3d(final,col=rainbow(1000),type='l')


plot3d(final,col=rainbow(1000),type='s')


Assignment no:2 
Choose 2 random variables 
Create 3 plots: 
1. X-Y 
2. X-Y|Z (introducing a variable z and cbind it to z and y with 5 diff categories)
3. Color code and draw the graph 
4. Smooth and best fit line for the curve 

Solution 2:

 qplot(x,y)

qplot(x,z)


qplot(x,z,alpha=I(1/20))


qplot(x,y,geom=c("boxplot","jitter"))


qplot(x,y,colour=z)


qplot(log(x),log(y),colour=z)




No comments:

Post a Comment

Please leave your precious comment here...