r - Creating 10% intervals for displacement -


i want separate data 10 intervals corresponding 10% intervals displacement. each of these 10% intervals want able calculate average force. need these mean values can construct figure 1 below. figure want create except force on y axis instead of velocity (i need creating intervals - figure give idea of purpose of calculation is):

the figure want create except force on y axis instead of velocity
example calculate average force displacement of 0%-10%.

min(lift_s1_intns50_chainno$dis) # [1] 0.02979588 

to

((min(lift_s1_intns50_chainno$dis))+(((max(lift_s1_intns50_chainno$dis)-min(lift_s1_intns50_chainno$dis))/10)*1)) # [1] 0.08614471 

my data (first 100rows) - idea of data:

    structure(list(time = c(10.143, 10.14333333, 10.14366667, 10.144,  10.14433333, 10.14466667, 10.145, 10.14533333, 10.14566667, 10.146,  10.14633333, 10.14666667, 10.147, 10.14733333, 10.14766667, 10.148,  10.14833333, 10.14866667, 10.149, 10.14933333, 10.14966667, 10.15,  10.15033333, 10.15066667, 10.151, 10.15133333, 10.15166667, 10.152,  10.15233333, 10.15266667, 10.153, 10.15333333, 10.15366667, 10.154,  10.15433333, 10.15466667, 10.155, 10.15533333, 10.15566667, 10.156,  10.15633333, 10.15666667, 10.157, 10.15733333, 10.15766667, 10.158,  10.15833333, 10.15866667, 10.159, 10.15933333, 10.15966667, 10.16,  10.16033333, 10.16066667, 10.161, 10.16133333, 10.16166667, 10.162,  10.16233333, 10.16266667, 10.163, 10.16333333, 10.16366667, 10.164,  10.16433333, 10.16466667, 10.165, 10.16533333, 10.16566667, 10.166,  10.16633333, 10.16666667, 10.167, 10.16733333, 10.16766667, 10.168,  10.16833333, 10.16866667, 10.169, 10.16933333, 10.16966667, 10.17,  10.17033333, 10.17066667, 10.171, 10.17133333, 10.17166667, 10.172,  10.17233333, 10.17266667, 10.173, 10.17333333, 10.17366667, 10.174,  10.17433333, 10.17466667, 10.175, 10.17533333, 10.17566667, 10.176 ), displacement = c(0.030035256, 0.029795879, 0.030194801, 0.030434119,  0.030673496, 0.030992586, 0.030753268, 0.030992586, 0.030992586,  0.030912814, 0.031710599, 0.032109521, 0.031949976, 0.031949976,  0.031710599, 0.032269066, 0.032348898, 0.032189294, 0.032588216,  0.032508443, 0.03306691, 0.03306691, 0.032827534, 0.033465774,  0.033864696, 0.033864696, 0.034024241, 0.034104014, 0.03498163,  0.034502936, 0.034901858, 0.035061403, 0.035061403, 0.035460325,  0.035300721, 0.035220948, 0.035460325, 0.035938961, 0.036018793,  0.036577201, 0.036497429, 0.035699643, 0.036417656, 0.036577201,  0.037215441, 0.037215441, 0.037454818, 0.037215441, 0.038093058,  0.038332376, 0.038172831, 0.038332376, 0.03849198, 0.038412149,  0.038412149, 0.03849198, 0.038970616, 0.038811071, 0.039449311,  0.039529083, 0.039369538, 0.039608856, 0.040167323, 0.0404067,  0.040486473, 0.040885336, 0.040885336, 0.041443803, 0.041204485,  0.04104494, 0.041364031, 0.04168318, 0.042002271, 0.042161875,  0.041762953, 0.042161875, 0.042640511, 0.043119205, 0.042720283,  0.043278751, 0.043438355, 0.0435979, 0.0435979, 0.044475458,  0.044555231, 0.044555231, 0.045113698, 0.045113698, 0.04487438,  0.04487438, 0.045273302, 0.04551262, 0.04551262, 0.045592393,  0.045592393, 0.045751938, 0.046071088, 0.046709328, 0.047188022,  0.047507113), velocity = c(0.429684261, 0.431348944, 0.43301051,  0.434668832, 0.436323826, 0.43797547, 0.439623768, 0.441268702,  0.442910202, 0.444548146, 0.44618241, 0.447812952, 0.449439837,  0.451063153, 0.452682914, 0.454299046, 0.455911448, 0.457520018,  0.459124633, 0.460725144, 0.462321409, 0.463913313, 0.465500744,  0.467083567, 0.46866168, 0.470235057, 0.471803725, 0.473367716,  0.474927096, 0.476481989, 0.47803255, 0.479578921, 0.481121233,  0.482659616, 0.484194183, 0.485724998, 0.487252055, 0.48877532,  0.490294802, 0.491810588, 0.493322809, 0.494831545, 0.496336744,  0.49783827, 0.499336038, 0.500830063, 0.502320424, 0.503807201,  0.505290475, 0.506770383, 0.508247138, 0.509720962, 0.51119203,  0.512660458, 0.514126294, 0.515589503, 0.517050001, 0.518507705,  0.519962552, 0.521414518, 0.52286359, 0.524309728, 0.525752878,  0.527193042, 0.528630294, 0.530064758, 0.531496582, 0.532925942,  0.534353028, 0.535777981, 0.537200851, 0.53862164, 0.540040373,  0.54145712, 0.542871937, 0.544284816, 0.545695713, 0.547104642,  0.548511688, 0.549916946, 0.551320507, 0.55272247, 0.554122947,  0.555522075, 0.556920068, 0.55831722, 0.559713859, 0.561110329,  0.562506943, 0.563903923, 0.565301388, 0.566699422, 0.568098112,  0.569497523, 0.570897655, 0.572298438, 0.57369977, 0.57510159,  0.576503965, 0.577907113), acceleration = c(4.972007635, 4.963533506,  4.954888415, 4.946078575, 4.937110277, 4.927989883, 4.918723829,  4.909318616, 4.899780811, 4.890117044, 4.880334004, 4.870438434,  4.860437133, 4.850336945, 4.840144763, 4.829867522, 4.8195122,  4.809085814, 4.798595419, 4.7880481, 4.77745097, 4.766811165,  4.756135833, 4.745432131, 4.734707211, 4.723968212, 4.713222253,  4.702476416, 4.691737741, 4.681013216, 4.670309764, 4.659634241,  4.648993426, 4.638394015, 4.627842622, 4.617345769, 4.606909887,  4.596541313, 4.586246287, 4.57603095, 4.565901339, 4.555863389,  4.545922925, 4.536085668, 4.526357225, 4.51674309, 4.507248637,  4.497879115, 4.488639649, 4.479535229, 4.470570712, 4.461750818,  4.453080131, 4.444563098, 4.43620403, 4.428007107, 4.419976375,  4.41211575, 4.404429016, 4.396919822, 4.389591681, 4.382447968,  4.375491909, 4.368726584, 4.362154915, 4.355779664, 4.349603424,  4.343628615, 4.337857479, 4.332292077, 4.326934288, 4.3217858,  4.316848115, 4.312122542, 4.307610193, 4.30331198, 4.299228611,  4.295360587, 4.291708192, 4.288271494, 4.285050331, 4.282044314,  4.279252814, 4.276674964, 4.27430965, 4.272155509, 4.270210929,  4.268474047, 4.266942753, 4.265614697, 4.264487291, 4.263557721,  4.262822954, 4.262279745, 4.261924646, 4.261754018, 4.26176403,  4.261950674, 4.262309763, 4.262836941), fz = c(2803.144851, 2804.268212,  2805.386402, 2803.882646, 2806.130099, 2805.002781, 2805.381537,  2807.248207, 2804.994318, 2803.877555, 2804.246129, 2806.866598,  2805.738177, 2808.361986, 2804.623636, 2806.484599, 2806.47941,  2806.473638, 2808.353231, 2805.354752, 2805.350179, 2805.717618,  2807.958682, 2807.581191, 2808.698975, 2808.699364, 2808.31996,  2808.696056, 2809.062295, 2807.190907, 2807.938642, 2808.678026,  2809.427237, 2807.927649, 2806.802487, 2808.298362, 2808.664115,  2808.662072, 2810.534076, 2810.163071, 2810.532714, 2807.534268,  2808.654776, 2807.148297, 2810.140338, 2807.894831, 2807.15462,  2805.27566, 2806.024027, 2807.895383, 2809.020722, 2808.644009,  2809.014821, 2807.888767, 2807.516497, 2808.267977, 2807.882087,  2807.882476, 2807.883547, 2808.627925, 2807.505569, 2808.255687,  2807.881374, 2808.998931, 2810.494838, 2807.500413, 2808.630001,  2807.876542, 2806.37042, 2805.627014, 2805.250982, 2806.749046,  2805.248031, 2807.876315, 2803.769148, 2807.507547, 2806.372852,  2806.374149, 2807.132828, 2804.134998, 2801.893204, 2804.88283,  2805.625782, 2805.624647, 2806.743468, 2806.375316, 2806.007554,  2805.24949, 2805.254711, 2804.128026, 2805.253219, 2803.757766,  2804.505728, 2803.759874, 2804.132728, 2803.758447, 2804.873977,  2803.382188, 2805.255327, 2804.880365)), .names = c("time", "displacement",  "velocity", "acceleration", "fz"), row.names = 1235:1334, class = "data.frame") 

i relatively new r, , english not first language please comment if not understand question.

if "displacement" distance measure , want sequence of 11 values define 10 equal length intervals, use this;

bounds <- with( lift_s1_intns50_chainno,                    seq( min(displacement), max(displacement), length=11)                ) 

if want mean of measured values of fz within categories defined bounds use this.

   bounds[11] <- bounds[11]+.000001   # allow last point in 10th inerval.   fzmeans <-   with( lift_s1_intns50_chainno,                   tapply( fz,  findinterval( displacement, bounds), mean)                     ) 

then plot fz mean against right-endpoints of displacement intervals:

plot(bounds[-1], fzmeans) 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -