R study notes
Monday, October 20, 2014
Exercise-11
Given two vectors x and y of identical length compute a vector z, where z[i]=max(x[i],y[i])
x=c(7,3,4,2)
y=c(31,-6,2,5)
z=x*(x>y)+y*(x<=y)
z
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment