Skip to contents

This is a shorthand for accessing mediator-related slots in classes exported by the multimedia package.

Usage

mediators(object)

Arguments

object

An object whose mediators we want to access (either their names or values).

Value

The output will depend on the class of the object that is passed in. For multimedia objects, this returns a character vector of mediators. For mediation data objects, this returns the mediator mediator data.

Examples

exper <- demo_joy() |>
    mediation_data("PHQ", "treatment", starts_with("ASV"))
mediators(exper)
#>            ASV1          ASV2          ASV3        ASV4        ASV5
#> 1    0.88524436  0.4271737343 -0.2176190027 -0.07596873  1.23729030
#> 2    0.12961446 -0.6898355493 -1.1294585517 -0.73315881 -0.91736085
#> 3   -1.16413330  0.4383932663 -0.0680973828 -1.41049678 -0.69517032
#> 4    0.82490015  0.4759058780  0.2670994448  2.08521498 -0.55908211
#> 5    0.29551636  0.6546409098 -0.4425965709 -0.43008162 -0.41686907
#> 6   -0.46696678 -2.3344401703  1.0301134672  1.39425598  0.44830674
#> 7    2.09575230  0.5983778010 -1.6791852497 -0.70846568  0.09605929
#> 8   -1.53776067 -0.0074744535  1.0899754267  2.06574842 -0.48517847
#> 9    0.40989739  1.2496109441 -1.4779100903 -0.39949644 -1.50211505
#> 10  -0.06602635  1.4641175038  1.0948031332  0.70794104  1.28776295
#> 11   0.14376479 -1.4115360027  1.1202204905 -2.32212621  1.23220481
#> 12   0.37766965 -0.2437315517  0.3026467766 -2.24047747 -0.49901515
#> 13  -0.61982080  2.5544362884  1.5868690390  0.57686322  0.34344476
#> 14  -1.63106338  2.1956373506  0.5514453145 -0.40752418  0.25291733
#> 15   0.19275685  0.6965192734  1.9220300586 -0.54720092 -0.83523231
#> 16   0.80409708 -0.0101900881  0.4380231862 -1.36588694 -0.83549276
#> 17  -0.55947285 -0.7685907834 -0.6738372750  1.05025146 -1.32196522
#> 18  -1.26679796  1.3920511732 -0.4100628541 -0.13836491  0.15739537
#> 19   1.40355867 -0.7657344667 -1.4586065782  0.21136279 -0.01980796
#> 20  -0.61269463  0.5489727298 -2.1438291570 -0.73512580  1.30086649
#> 21   0.57331349 -0.2577366596 -0.3505295778  0.10448664 -0.25379571
#> 22   0.56828843  0.4835046488 -0.0630591745 -1.24805798 -0.30267416
#> 23   1.68928674 -0.8729171939  0.3257938575 -0.65170322  0.28572828
#> 24   1.49837716  0.0673858613 -0.1000355117 -1.14658935 -0.93170645
#> 25  -0.15426269  1.0302799365  0.2316959041  1.20290817  0.06773298
#> 26   0.25238443 -0.5995475048  1.5693486095 -0.80722724  0.24031760
#> 27  -1.19992673  0.5339503145  0.0005737401 -0.14675911 -1.45539872
#> 28   1.48214904  0.6345925480 -0.6002380835 -0.69802503 -0.07130829
#> 29  -0.67036876 -2.1994853580  1.0776051349 -1.34357389 -0.15368548
#> 30   0.88309977 -0.0519955807 -1.4008605444 -0.81214369 -1.34893066
#> 31  -0.58602433  0.5495066212 -0.7523674483 -0.48643267  0.27025223
#> 32  -0.56335217  1.6777292182 -0.1246707012  0.77604379  1.32906175
#> 33   0.51074987 -0.2719584271 -0.7687834892 -0.73668435 -0.20654191
#> 34  -0.16283432  0.4278091274  0.4577569692 -1.55157000 -0.11499552
#> 35   2.24722764  0.4369296564  0.2669811469 -0.50867286 -0.82455328
#> 36  -0.27813743 -0.1378149714 -0.8711770762 -1.99295232  0.31203318
#> 37  -1.00247516  1.9386226048 -0.7585852375 -0.65894912  0.87260735
#> 38   1.24510507  0.6368092158  3.3009883894  0.09920175 -2.25327095
#> 39   0.87973926  0.1657507750  0.4348878338 -0.13479822 -1.80092023
#> 40  -0.30601696 -1.1579461730 -1.6425536088 -0.60184807 -1.80587719
#> 41   0.54931693  0.4354172989 -0.2004305052  0.37818945 -0.14637669
#> 42  -0.49649299 -0.6543213715 -0.0752677386 -0.01045327  0.34026583
#> 43  -1.22625958  0.1087166245  0.3848809398  0.51959032 -0.26161204
#> 44  -0.12309183 -1.1585706097 -0.6438028519 -1.33751271 -2.24730315
#> 45  -1.53871162 -0.5486445940  1.5469766326 -0.66306984  0.63301168
#> 46  -1.05584894  0.1551964265  2.0576462832  0.23320574  0.14328143
#> 47  -1.26015685  0.2475529062  0.2038333642  0.78043139  0.84690807
#> 48  -0.52645168  1.0583739158  0.9460619991  0.70646202 -0.37641971
#> 49   0.16633605  0.3443941490  1.1657115768 -0.57870402 -0.40439867
#> 50  -0.07882612 -0.1089155555  1.5105733640  0.19736378  0.01113938
#> 51  -1.22030935  1.8113936246  0.7587110045  0.63404498 -2.26165951
#> 52  -0.87062285  1.3298038845  0.0991455790  0.17249114  0.21552896
#> 53  -1.33577391 -1.2734150123 -0.2728284862 -0.97801076  0.97422517
#> 54  -0.23427106  2.0230434264  1.0787601399 -1.58083873  0.95947888
#> 55   0.32857175  2.0759178233  1.6145160901 -1.77279562  0.67874019
#> 56   0.03717945 -1.3049033869  0.1466413089 -0.87165122  0.02510768
#> 57  -0.88081698  0.1984293423 -0.5436860537 -0.01968132 -0.50707135
#> 58   0.15134861  0.3141207609  0.0151306889  0.95222691  1.01144618
#> 59   2.41031816  0.7386504420 -0.8602257610 -0.36089213  0.21609501
#> 60   1.11031361 -2.5099137038 -1.3326461796 -0.37332909 -0.83546867
#> 61   0.58941650  1.1484626904 -0.1105869150  1.40100101 -0.45935365
#> 62  -0.06998609 -0.2908381267  0.9730576780  0.34761653 -0.39524604
#> 63  -0.19959410  0.8694767047 -0.3547979603 -1.11940850  0.32558434
#> 64   1.10901332 -0.8502510668  0.3058801722  0.66764270  1.11964062
#> 65  -1.18164248  0.0801939662  1.2021106221 -0.32746908 -0.51258970
#> 66   0.25104482 -0.5876819316 -0.6731441937 -0.68021330 -1.12621143
#> 67  -0.33950952  0.0482369930 -0.0087401549  0.37963934  1.71228192
#> 68  -0.27788278  1.0831651445  1.5113172282  1.89758480 -0.59026796
#> 69  -0.44741014 -1.6602283018  1.9219019688  0.41030813 -1.89589511
#> 70  -2.87181269 -0.9388824056  0.1158759167  1.14793210  2.15079009
#> 71  -0.27424479  1.3354046218 -0.9061130521 -1.54475415 -1.24006517
#> 72   1.63059831 -0.3950427196  0.1370043051 -0.16456660 -1.41685827
#> 73  -0.49271862  1.0868725759  0.6919666917  1.30835299 -2.53480562
#> 74  -0.19106431  0.4154988195  1.3605830961  0.05980699 -0.02714906
#> 75  -1.92564704 -0.0622740066  0.1668434235 -1.27193408  0.62488847
#> 76   1.08243480  1.8690001988  0.8732649381  0.11721569 -2.60131111
#> 77   0.66756621 -0.5699464205 -0.6637963419  1.19534932  0.74571840
#> 78  -2.41172214  0.3939018479  1.6228584244 -0.35548222  0.31778967
#> 79  -0.22398677 -1.1292747106 -0.1039545451  1.60430744  0.60437437
#> 80  -0.31909824 -1.1600969724  0.2699785866  1.32167837  0.88779522
#> 81  -1.49217115 -1.0041209592  1.9924232553 -0.33538669  0.37941603
#> 82  -0.22413092  1.2620055725  1.2756067395 -1.31084067 -0.43950875
#> 83  -0.54632057 -0.0031373807 -1.5322072370  1.60266565 -1.15046609
#> 84   0.16570197 -0.4100230273  0.3006331161  0.93507394  0.04826952
#> 85   0.72673085 -0.4195121511  0.2640443510 -0.31157169  1.04183975
#> 86   2.48673990 -1.6336529660  0.1263661033 -0.80904629  1.03874288
#> 87  -0.28618299  0.1261572699  0.5822542978  0.99876920 -0.58147382
#> 88   0.42026118 -0.1003111073 -0.5373312614  1.31731934  0.89824717
#> 89  -0.22125994 -1.3875689666 -0.4470326281 -0.05657299  0.07485042
#> 90   1.74840158  0.8122887689 -0.7131126660 -0.61877260  0.38757086
#> 91   0.22532195 -1.2267262411  0.3789921371 -0.57303148  1.27699236
#> 92   2.24730483  0.7748858838  0.2869974247  0.06040442 -0.53300029
#> 93   0.53385363 -1.2079813815  0.1171763621  1.42520027  1.60844021
#> 94  -0.43262456  0.0006116572  1.3339356443  0.09824280  0.40524393
#> 95  -0.25779490 -0.8641460292 -0.3957492857  0.52402402  0.74854155
#> 96   0.66248902 -1.1491899353  0.1843961733 -0.60273013 -0.53666335
#> 97   0.05966649 -0.1747993802  1.5895116053  1.51882036  2.58259068
#> 98  -2.64504900  1.2110017720 -0.4243995212 -0.09436743 -1.62915774
#> 99   0.67077263 -0.6957486411 -0.8684287470  0.26289651 -0.68356398
#> 100 -2.25874144 -0.1606084886  0.3120302520  1.51135141 -0.20761622