Skip to contents

Get data for all phases as a list of matrices

Usage

getPhaseData(x, include_subphases = FALSE)

Arguments

x

A segmented_phases object

include_subphases

Whether to include subphases

Value

Named list of matrices

References

Winter DA (2009). "Biomechanics and Motor Control of Human Movement." 4th ed. Wiley.

Examples

set.seed(123)
data <- matrix(rnorm(200), 100, 2)
events <- data.frame(
  event = c("hs1","ff","ms","ho","to","hs2"),
  label = c("Heel Strike","Foot Flat","Midstance","Heel Off","Toe Off","Heel Strike 2"),
  index = c(1, 13, 31, 41, 61, 100), time = c(0, .12, .30, .40, .60, 1.0),
  percent = c(0, 12, 30, 40, 60, 100), method = rep("manual", 6),
  confidence = rep(1, 6), stringsAsFactors = FALSE)
class(events) <- c("detected_events", "data.frame")
attr(events, "sampling_rate") <- 100
phases <- segmentPhases(data, events, schema_gait)
head(getPhaseData(phases))
#> $stance
#>              [,1]        [,2]
#>  [1,] -0.56047565 -0.71040656
#>  [2,] -0.23017749  0.25688371
#>  [3,]  1.55870831 -0.24669188
#>  [4,]  0.07050839 -0.34754260
#>  [5,]  0.12928774 -0.95161857
#>  [6,]  1.71506499 -0.04502772
#>  [7,]  0.46091621 -0.78490447
#>  [8,] -1.26506123 -1.66794194
#>  [9,] -0.68685285 -0.38022652
#> [10,] -0.44566197  0.91899661
#> [11,]  1.22408180 -0.57534696
#> [12,]  0.35981383  0.60796432
#> [13,]  0.40077145 -1.61788271
#> [14,]  0.11068272 -0.05556197
#> [15,] -0.55584113  0.51940720
#> [16,]  1.78691314  0.30115336
#> [17,]  0.49785048  0.10567619
#> [18,] -1.96661716 -0.64070601
#> [19,]  0.70135590 -0.84970435
#> [20,] -0.47279141 -1.02412879
#> [21,] -1.06782371  0.11764660
#> [22,] -0.21797491 -0.94747461
#> [23,] -1.02600445 -0.49055744
#> [24,] -0.72889123 -0.25609219
#> [25,] -0.62503927  1.84386201
#> [26,] -1.68669331 -0.65194990
#> [27,]  0.83778704  0.23538657
#> [28,]  0.15337312  0.07796085
#> [29,] -1.13813694 -0.96185663
#> [30,]  1.25381492 -0.07130809
#> [31,]  0.42646422  1.44455086
#> [32,] -0.29507148  0.45150405
#> [33,]  0.89512566  0.04123292
#> [34,]  0.87813349 -0.42249683
#> [35,]  0.82158108 -2.05324722
#> [36,]  0.68864025  1.13133721
#> [37,]  0.55391765 -1.46064007
#> [38,] -0.06191171  0.73994751
#> [39,] -0.30596266  1.90910357
#> [40,] -0.38047100 -1.44389316
#> [41,] -0.69470698  0.70178434
#> [42,] -0.20791728 -0.26219749
#> [43,] -1.26539635 -1.57214416
#> [44,]  2.16895597 -1.51466765
#> [45,]  1.20796200 -1.60153617
#> [46,] -1.12310858 -0.53090652
#> [47,] -0.40288484 -1.46175558
#> [48,] -0.46665535  0.68791677
#> [49,]  0.77996512  2.10010894
#> [50,] -0.08336907 -1.28703048
#> [51,]  0.25331851  0.78773885
#> [52,] -0.02854676  0.76904224
#> [53,] -0.04287046  0.33220258
#> [54,]  1.36860228 -1.00837661
#> [55,] -0.22577099 -0.11945261
#> [56,]  1.51647060 -0.28039534
#> [57,] -1.54875280  0.56298953
#> [58,]  0.58461375 -0.37243876
#> [59,]  0.12385424  0.97697339
#> [60,]  0.21594157 -0.37458086
#> [61,]  0.37963948  1.05271147
#> 
#> $swing
#>               [,1]        [,2]
#>  [1,]  0.379639483  1.05271147
#>  [2,] -0.502323453 -1.04917701
#>  [3,] -0.333207384 -1.26015524
#>  [4,] -1.018575383  3.24103993
#>  [5,] -1.071791226 -0.41685759
#>  [6,]  0.303528641  0.29822759
#>  [7,]  0.448209779  0.63656967
#>  [8,]  0.053004227 -0.48378063
#>  [9,]  0.922267468  0.51686204
#> [10,]  2.050084686  0.36896453
#> [11,] -0.491031166 -0.21538051
#> [12,] -2.309168876  0.06529303
#> [13,]  1.005738524 -0.03406725
#> [14,] -0.709200763  2.12845190
#> [15,] -0.688008616 -0.74133610
#> [16,]  1.025571370 -1.09599627
#> [17,] -0.284773007  0.03778840
#> [18,] -1.220717712  0.31048075
#> [19,]  0.181303480  0.43652348
#> [20,] -0.138891362 -0.45836533
#> [21,]  0.005764186 -1.06332613
#> [22,]  0.385280401  1.26318518
#> [23,] -0.370660032 -0.34965039
#> [24,]  0.644376549 -0.86551286
#> [25,] -0.220486562 -0.23627957
#> [26,]  0.331781964 -0.19717589
#> [27,]  1.096839013  1.10992029
#> [28,]  0.435181491  0.08473729
#> [29,] -0.325931586  0.75405379
#> [30,]  1.148807618 -0.49929202
#> [31,]  0.993503856  0.21444531
#> [32,]  0.548396960 -0.32468591
#> [33,]  0.238731735  0.09458353
#> [34,] -0.627906076 -0.89536336
#> [35,]  1.360652449 -1.31080153
#> [36,] -0.600259587  1.99721338
#> [37,]  2.187332993  0.60070882
#> [38,]  1.532610626 -1.25127136
#> [39,] -0.235700359 -0.61116592
#> [40,] -1.026420900 -1.18548008
#>