12.1 kable()
We raden aan om in eerste instantie kable()
te gebruiken. De standaard (tabel 12.1) genereert zowel tabellen in pdf als HTML output formaat. In pdf formaat wordt het een floating tabel. Dat houdt in dat de volledige tabel op een pagina geplaatst wordt van zodra er plaats is om de volledige tabel te plaatsen. Is de tabel zo groot dat ze niet op een pagina past, dan valt het laatste stuk van de pagina.
X1 | X2 | X3 | X4 | A | B | |
---|---|---|---|---|---|---|
rij 1 | 0.0026900 | 0.6158187 | 1.3779620 | -0.7906852 | lebc | fk ovyu l xbzuik |
rij 2 | -0.1271766 | 0.5378341 | 0.5560273 | 0.8158726 | tvdfx olmvjf zlnu vx qmk yzuhwn | tbhk djd |
rij 3 | -1.8217642 | -0.2172378 | -0.5250205 | 1.2954328 | zo cqrgo | nqyxn mlbhvko asnkv ncv ek duhs |
rij 4 | -1.2100947 | -1.2417833 | 0.0853342 | 0.4677383 | fou kdgm eqwpqwsdc vjmj | tfu eziw puc xryvzb |
rij 5 | 0.4974872 | -0.1204657 | 0.5257259 | -0.5486896 | kmyd tesn | qmuv sjl ws tfgpf pzbz |
rij 6 | 0.6765226 | -2.1609471 | -1.2302927 | 0.0585364 | xn qjneqk akpnblbuu fuyveg | hyof oxnnrhq nhx bdfz uqcls rpc |
rij 7 | -0.5525922 | -0.6908974 | -0.3450829 | 0.9707596 | jxdl omyw un | c hdlhsu kzdftppht vs xyg oblfllkg |
rij 8 | 0.5824695 | -0.7686303 | -0.0585020 | -0.3599278 | wpugejbgr xaes ahsbll | |
rij 9 | -0.4993571 | -1.2594165 | 0.2838260 | 1.5476156 | zxgsw a apzz bush | jqqon yn tap myeh zwf dmzv fo |
rij 10 | 0.1014611 | 1.1473936 | 0.0158765 | -0.3353321 | psurcmzww dld f qnvdehm gjixb y | t ggfea ocbe qvihd bqmy ifym kp zqd |
rij 11 | 0.2306562 | -0.2546867 | -1.3716381 | 0.5787648 | qkkck y mkqdpyih yazmlg lonfw hjeup | evgbc zavkca aovl ptg lyunpw vtlw |
rij 12 | -0.2322630 | -0.3419082 | 0.9385485 | 1.7171056 | bbc arcwa plxojz | okr gewrdrw exqbotdwyadvk wudaom wu |
rij 13 | 0.6774688 | -0.2208887 | -0.9640424 | 0.7430237 | fy xdddaesc rvwdd pgoc | |
rij 14 | -0.9724629 | 0.2260262 | -1.5082715 | 0.6365879 | ifuzk | pf kdtakpaf eeo |
rij 15 | 0.4870265 | -0.1965331 | -0.7786511 | -0.3555884 | unjw hmbx ickdz pfnivo xqiq | zpv |
rij 16 | 1.5210035 | 0.2169718 | -1.1211749 | -0.5462763 | vrns xfmt efh i jxxzff o msv iwfl zh ezqns pm | ztkkhp cgxn dcaj |
rij 17 | 0.8458379 | -0.5022253 | -0.8658230 | -0.0410358 | fdih dcemw bqmyzoi roa nfsnk | rbdoq ghgzr pii npi |
rij 18 | -1.3591996 | 1.1244061 | 0.0865063 | 0.2638209 | wxfc | qtj sychfau mwog |
rij 19 | -0.6852189 | -1.4035497 | -0.2500250 | -2.1392560 | itq yxz | s gnk sgtdzg wnzjv |
rij 20 | -1.3099304 | -0.8102097 | 0.0433877 | -0.3830013 | wsxm eftad yeq | ilxnmig vdbxt l qeks mof |
rij 21 | 1.8764493 | -0.9041098 | -0.3102505 | -0.5524460 | gx ged | qlbt yt thftwjoowj |
rij 22 | -0.8696961 | 1.4778391 | 0.0501977 | -0.7579431 | kyzvotzv yjsn plnjhgya htlci | dzgf |
rij 23 | -0.0665749 | 1.6151111 | -0.2344381 | 0.7556692 | yqmfb kzeu ftodx inua rqvg xm | lgw dhhcag |
rij 24 | 0.5681764 | 2.3048811 | -0.1208357 | -0.4675286 | bnspmanz nrnvam kot gjeg ytnj dkms tjqtks mzcqxo | ykwgqtare |
rij 25 | -0.5129303 | -2.7492148 | 1.3714629 | -0.0453593 | tdfad ijvoy dbmfix eobzh | mr xaile bgdhee |
rij 26 | -1.2159160 | -1.0136789 | -0.1397726 | 0.0820024 | jgodie jqhrqe ivgbg cxdnt duc | qozco yubui iood |
rij 27 | 0.1225525 | -0.2661802 | 0.3915341 | -0.1107206 | n cpocri uf jprzo fmzlvdq di | rclg gtees |
rij 28 | 0.4462192 | -1.6498599 | -0.6707093 | 0.5424673 | rpwwg ixqlg | sd lo wstgme ap faqksfc jxu nupm |
rij 29 | 0.3194503 | -0.3603660 | 1.8897057 | 2.0502412 | eaj kgqyb | bv bh qmxkw itpkge slbi |
rij 30 | 0.3480076 | 1.9596927 | -0.4967588 | 0.3576672 | wqitx su qnx zqjol | eun hnb hfd cugim qh gb |
rij 31 | -0.1253577 | -0.5607971 | 1.0847684 | 1.0166918 | pklmkc zx ldi miho soh | oxfdoagg gmy yvpk posbrw me gq bn b |
rij 32 | -0.6414619 | 0.1795914 | 0.3815428 | 1.2807476 | asijg dszv vlto | bgk ocrupz bi |
rij 33 | 0.2492252 | -0.2660365 | -0.0384635 | -0.3215242 | htbv | |
rij 34 | -0.0518068 | 1.0269102 | 0.2924039 | -1.9872860 | tufagw | kuix |
rij 35 | -1.1036734 | -0.1445045 | 0.7195579 | -1.1531317 | qlpojwn oqfk isw w yzypfra | gga iybzv nn i wkrupuosg hydk |
rij 36 | 0.2007170 | 0.1614646 | 0.4054393 | -0.5586053 | tesj utcyw ctmgi | n tu eypcix ydgm tq |
rij 37 | -0.4208135 | 1.0457594 | 0.3064338 | -0.5260522 | anoqptoq rgnmdnxvw | rh kefpqsd |
rij 38 | 0.4708458 | -0.5520534 | -0.0286152 | -1.0563577 | zvhsio xpk xtq ydgx b wv hsk | c lroka |
rij 39 | -1.7308296 | -0.5217710 | -0.6501733 | -0.6607432 | lzjew vgxpuj zhmng | eruhnyez cgqw b ghe lejiv kggm fvc mmbwkk |
rij 40 | 3.1665087 | 0.6773208 | 0.9761889 | -0.8383522 | ltbkp awtb tiqae df | sdmuq bu tzvy |
rij 41 | -0.9052020 | 1.9147783 | -1.0183798 | 0.2012569 | ubpc bvaqb hze droxl hlx qqy | nca prle dc |
rij 42 | -0.1861984 | -0.3097156 | -1.6678721 | -1.0357479 | ymy bxmpq iqjyk c itwt cmujtl | pa cfiiuydyn malq qjp jekaet |
rij 43 | 2.1441209 | -1.7994309 | -0.7510226 | 0.3418121 | deun qpd rf xlh tku | eak xup digptpf xbwgv |
rij 44 | 1.3972379 | -1.8505757 | -0.5852545 | 0.1738369 | fimq oh | keuh h |
rij 45 | 2.2105455 | -0.9830897 | -0.9732075 | -0.1059541 | hkdd uptduqu po sjz ofscy ysdd | ahn |
rij 46 | 1.3536684 | -0.2703286 | 0.6023682 | 0.5062872 | ysl nfx mkmre | gv nufusg phs dex |
rij 47 | -0.2231235 | 0.0224909 | 0.9917823 | 0.4184043 | xiext uqgcz | dmc fi mv kww fu |
rij 48 | 2.6599856 | -1.1346593 | 0.0644289 | 0.5518188 | wqya wwo hdko icmo rwmmc bz | ctrvq otvukiq fwk ziczrd llrfdhfjdxvb |
rij 49 | 0.4666610 | 0.1129732 | 0.3029305 | -0.3516095 | xwd svn j pmar epuxjqwq | dmi yod kmmck vtkrvho |
rij 50 | -0.3680349 | -0.2722929 | -1.3455835 | 0.4017902 | oe fju jqolya | hzo moiihszkrt fyg |
Het markdown formaat is handig voor grotere tabellen met tekst. Wanneer de tekst te lang is worden de rijen over meerdere regels gespreid. Indien nodig wordt de tabel over meerdere pagina’s gespreid. Het nadeel is dat je geen bijschrift kan plaatsen en er ook niet naar kan verwijzen.
X1 | X2 | X3 | X4 | A | B | C | |
---|---|---|---|---|---|---|---|
rij 1 | -2.21 | -0.94 | 0.32 | -0.48 | pcfk mfv uukzw utqhgl e uzrl | t | pzped eydd yxylial ugmu glvc llyhxji nm okeeuxa |
rij 2 | -0.66 | -1.08 | -1.92 | -0.19 | kll sq wa wly lhp bvg | mhdydk qux ske gbgoe cp | esug erj bheuha |
rij 3 | -0.27 | -0.89 | -1.88 | -0.04 | oudtqskup pvnzx | kqo wafdrm i pv ypou fch | foz qix wyyetf wd |
rij 4 | 1.07 | 0.11 | 2.00 | -0.49 | whuefq fuws lvhe fyok efm pb n aam | es zvimljts | gkhv elnxfwg dptyg uizkgkh beszxwsr rkss veyhm rdzdfq |
rij 5 | -0.53 | 0.15 | -0.05 | 0.41 | rpdt asyd chnaz giwirj | cba ojl brgud | vorfuk xef is tzryct kmq ppb sni tfrfa xp upt |
rij 6 | 0.90 | 0.75 | 1.09 | 0.25 | dql rln ww ldu | cx xjhhw dxgz iyq | dfb sllu py vwbfw o mna nlfkq |
rij 7 | 0.20 | 0.67 | -0.22 | -0.15 | m idv | yyw wt eppy | lgvsuqxlyxv fs aqw zsngrjp wvqxjx caltcq |
rij 8 | 1.71 | 0.35 | 0.24 | 0.00 | rwj lmnha fd rfn | tca mofhegh uxbx | prtsqv hsjhb siuhwbx fdvniwcuk |
rij 9 | 0.20 | 1.33 | 0.69 | 0.85 | xcs | fnrho kiwrwnh zpo i | laye hlvd qvzuzg go oxgdv vbj fuu zxh naln |
rij 10 | 1.71 | 0.72 | 1.54 | -0.55 | pqhcwd bvekm l dhjug pcqwjg iq dbu rouki fd | azqq hys tnrcvh riugm | bqy fm vaek icpj ntm pdd ng vrzma |
rij 11 | 0.12 | -0.24 | 1.35 | -0.12 | mvfmoujx yn unjlzfe bhscxvp xlhgp asxtdg agnya | xt wynvb ncqsy gxd wxhhgf ruzug | wnql sth f abqg rxcbr |
rij 12 | 0.99 | 1.31 | 0.11 | -1.69 | elo bebbjx rjb | lsrl tmayscfy adfflgr fyadhhia qzhivbzi | udzg gi xdedjlw |
rij 13 | 0.12 | 0.66 | 1.83 | 1.12 | jipxrn lgnx zdvmsyh oe dzl | qmt wrlo kv | mcs vicmf |
rij 14 | -0.71 | -0.89 | 0.99 | 0.79 | lwz dsxsrbpmp n rbd | jgnqx w woj ztubtdqwb avpcdom | mzrbbqt xhzg dj |
rij 15 | -0.90 | 0.17 | 0.25 | 0.86 | tugttz fkef bx xrspuf myx mh | dtj gszywwut fbaytld wyin muq cufqn | nsyow qamual emfs mw dkdiogq rvq |
rij 16 | 0.11 | -1.48 | 0.51 | -0.72 | ptvhdl flg drfu zn | hk iepnify whqtdse bc | fwtd wl pnas wjibyc rmxis mdfqyh |
rij 17 | 0.76 | 1.01 | 0.23 | -0.34 | rayqaxpft pmaoq ivrwsk | acxex lyg mhdqz cdl | tav kqutc vl xlkxbm uci bnlyd |
rij 18 | 2.01 | 0.12 | 3.12 | -0.11 | nwmn fatm camlnvz pm | xpia okaly dypr pvd lmkf pq mav | ml glc hsqo xk entf |
rij 19 | -0.27 | -0.13 | 0.26 | -0.34 | r pspx yxthaso jlyrude kso | j | siwsdll lncv uxnx |
rij 20 | 1.37 | 0.40 | -0.67 | -0.41 | r opzmr wagw wknjz pass pc zg | hcncdbud te of |
De laatste optie is het pandoc formaat (tabel 12.2). Dit gedraagt zich als het longtable formaat met een aangepaste lay-out.
kable(
genereer_tabel(50, c(3, 1), 4, 4),
digits = 3,
caption = "pandoc output van `kable()`",
format = "pandoc"
)
X1 | X2 | X3 | A | |
---|---|---|---|---|
rij 1 | -0.034 | 2.009 | 0.119 | uxbqelxn ozd jtmzu vjggfr jdd zbmwlc |
rij 2 | -0.261 | -0.980 | 0.499 | bmxzknasyj jhnps qdpc |
rij 3 | 0.614 | -0.859 | -1.430 | lb bfwjh d heppc nn |
rij 4 | 1.593 | 0.231 | 0.451 | rjikcn uijrrcz tzbq lrn vnbzd vck |
rij 5 | 0.374 | -0.979 | 3.012 | x xd bduomj wcpet |
rij 6 | -1.370 | -0.507 | -0.877 | nfgj piepme qwckdhw ljxnvd fdhec |
rij 7 | 1.006 | -1.398 | 0.870 | wkbla pomt |
rij 8 | -0.138 | -0.356 | -1.025 | kjf hwyjtxrxb hruduaf uqr koulvmkw oou |
rij 9 | -1.468 | -0.131 | -0.907 | mxx hiu j onn lmv uxel rjva ibcv |
rij 10 | -2.299 | -0.300 | -0.673 | rjbu df bzqww mqzq nmpa hu |
rij 11 | -0.326 | -0.392 | 0.046 | xc u o tehdsg wlmtzt |
rij 12 | 1.789 | 0.577 | 1.655 | aoh yfibv jjj rut tumiu |
rij 13 | -0.560 | -0.689 | -0.504 | ijvfw xce mbxih yvc yxgk dvrpav |
rij 14 | 0.296 | 1.050 | -0.546 | sbgijtah hns svz dze wc |
rij 15 | 0.519 | -0.214 | 0.251 | brj xmi qpsxpivu re egr |
rij 16 | 0.416 | -0.058 | 1.842 | |
rij 17 | 1.111 | -0.454 | -1.259 | rvrcp gb |
rij 18 | 1.067 | -0.433 | 0.416 | pb xb |
rij 19 | 0.218 | 2.256 | 0.148 | rvjfg zc hpxe |
rij 20 | 1.460 | 0.060 | -0.643 | xgbs dy |
rij 21 | 0.639 | 1.507 | -1.863 | rkudc rhgn mbyi neb |
rij 22 | 0.144 | -0.196 | 0.084 | px |
rij 23 | -0.042 | -1.422 | -1.354 | yawm mmea dtmgb |
rij 24 | -0.132 | 0.518 | 1.619 | ssopbi kcai konu |
rij 25 | -0.306 | -0.206 | -0.939 | sjci oqr zlzllcws zf sgrl mqsaq nrbiokg |
rij 26 | 0.170 | 2.367 | -0.490 | iqqj ubenhl zjdnkb x |
rij 27 | 1.099 | -0.960 | -1.530 | f pstip nba vqlfev |
rij 28 | 0.675 | -1.700 | 0.598 | ed lfsk lnrymey ae gtyxi oarb beu maamds |
rij 29 | -0.376 | 0.102 | 1.204 | vsjv |
rij 30 | -0.894 | 0.038 | 1.016 | nvqmyo jkpivk |
rij 31 | -2.030 | -0.732 | -1.419 | qt i u kum ij ebxuusyl mhfaf ffczii |
rij 32 | 0.081 | 1.179 | -0.825 | bgg qdvwraj ttofspg |
rij 33 | 0.151 | -0.522 | 1.475 | norh qn |
rij 34 | -0.235 | -1.222 | 0.686 | gxxt nd wh fmvxtvglt hls |
rij 35 | 0.751 | 1.527 | 0.081 | xvercej |
rij 36 | 0.151 | 0.016 | 2.851 | mc nrc wlcyryimvv wh |
rij 37 | -0.998 | -1.154 | 1.119 | oxh ch ghguubp zypkk jya afdgrwf iqqbq kfinyv pol |
rij 38 | 0.721 | 1.379 | 1.618 | zoymf nrd aje |
rij 39 | 0.691 | 0.079 | 0.072 | xh sp etcao xqmj |
rij 40 | 0.956 | -0.041 | -1.298 | zn hnlwfwbw hulvxyzfx odklivcg |
rij 41 | -0.180 | 1.064 | 2.093 | ienft h avouko rv |
rij 42 | 0.095 | 0.513 | 2.119 | ger arl rniy dyxsa jjl |
rij 43 | -0.441 | -1.975 | -0.016 | uefd ds jhzubgy |
rij 44 | 0.834 | 1.546 | -1.866 | hi yhq lugazwa jt oruqd |
rij 45 | 0.684 | -0.086 | -0.209 | xpary ujkl lmn mtukcf cqshoq |
rij 46 | 1.183 | -0.537 | 1.109 | tor |
rij 47 | -0.289 | 1.045 | 0.854 | phy zxkrx mlru |
rij 48 | -0.734 | -1.337 | -0.137 | ckz ligs pusm bug h vtb |
rij 49 | 1.184 | 0.533 | -0.137 | hrb |
rij 50 | 0.792 | 1.229 | -1.210 | bkx addrotwat nvrhh zsm |
Onkelinx, T. (2021). https://doi.org/10.5281/zenodo.842223