Dividing components of a vector into several data points in R -
i trying turn vector of length n (say, 14), , turn vector of length n (say, 90). example, vector
x<-c(5,3,7,11,12,19,40,2,22,6,10,12,12,4)
and want turn vector of length 90, creating 90 equally "spaced" points on vector- think of x function. there way in r?
something this?
> x<-c(5,3,7,11,12,19,40,2,22,6,10,12,12,4) > seq(min(x),max(x),length=90) [1] 2.000000 2.426966 2.853933 3.280899 3.707865 4.134831 4.561798 [8] 4.988764 5.415730 5.842697 6.269663 6.696629 7.123596 7.550562 [15] 7.977528 8.404494 8.831461 9.258427 9.685393 10.112360 10.539326 [22] 10.966292 11.393258 11.820225 12.247191 12.674157 13.101124 13.528090 [29] 13.955056 14.382022 14.808989 15.235955 15.662921 16.089888 16.516854 [36] 16.943820 17.370787 17.797753 18.224719 18.651685 19.078652 19.505618 [43] 19.932584 20.359551 20.786517 21.213483 21.640449 22.067416 22.494382 [50] 22.921348 23.348315 23.775281 24.202247 24.629213 25.056180 25.483146 [57] 25.910112 26.337079 26.764045 27.191011 27.617978 28.044944 28.471910 [64] 28.898876 29.325843 29.752809 30.179775 30.606742 31.033708 31.460674 [71] 31.887640 32.314607 32.741573 33.168539 33.595506 34.022472 34.449438 [78] 34.876404 35.303371 35.730337 36.157303 36.584270 37.011236 37.438202 [85] 37.865169 38.292135 38.719101 39.146067 39.573034 40.000000 >