Assignment 1: Create 3 vectors, x, y, z and choose any random values for them, ensuring they are of equal length,T<- cbind(x,y,z) and Create 3 dimensional plot of the same
Solution:
plot3d(m)
plot3d(T,col=rainbow(1000),type='s')
Assignment no 2: Create 2 random variables and create 3 plots:
X-Y ,X-Y|Z (introducing a variable z and cbind it to x and y with 5 diff categories)
> x<-rnorm(1500,100,10)
> y<-rnorm(1500,85,5)
> z1<-sample(letters,5)
> z2<-sample(z1,1500,replace=TRUE)
> z<-as.factor(z2)
> t<-cbind(x,y,z)
qplot(x,y)
qplot(x,z)
qplot(x,y,geom=c("point","smooth"))
qplot(x,y,colour=z)
qplot(log(x),log(y),colour=z)
No comments:
Post a Comment