Home > Enterprise >  how to plot a vector in R?
how to plot a vector in R?

Time:10-13

I would like to plot the old and the new vector on a diagram. Do I need to use par function or what else?

    programme<-function(a,old_vector){
#there would be two input: V(the vector to be rotated), a(the angle of rotation)

    old_vector=matrix(c(cos(a),sin(a),sin(a),cos(a)),nrow=2)
#the matrix is 2*2 matrix

    rotated_vector=old vector%*%old_vector
#To rotate a vector (           
  •  Tags:  
  • r
  • Related