Rev 75858 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
R version 3.5.2 RC (2018-12-13 r75856) -- "Eggshell Igloo"Copyright (C) 2018 The R Foundation for Statistical ComputingPlatform: x86_64-pc-linux-gnu (64-bit)R is free software and comes with ABSOLUTELY NO WARRANTY.You are welcome to redistribute it under certain conditions.Type 'license()' or 'licence()' for distribution details.R is a collaborative project with many contributors.Type 'contributors()' for more information and'citation()' on how to cite R or R packages in publications.Type 'demo()' for some demos, 'help()' for on-line help, or'help.start()' for an HTML browser interface to help.Type 'q()' to quit R.> ### Regression tests for which the printed output is the issue> ### May fail.> ### Skipped on a Unix-alike without Recommended packages>> pdf("reg-tests-3.pdf", encoding = "ISOLatin1.enc")>> ## str() for character & factors with NA (levels), and for Surv objects:> ff <- factor(c(2:1, NA), exclude = NULL)> str(levels(ff))chr [1:3] "1" "2" NA> str(ff)Factor w/ 3 levels "1","2",NA: 2 1 3> str(ordered(ff, exclude=NULL))Ord.factor w/ 3 levels "1"<"2"<NA: 2 1 3> if(require(survival)) {+ (sa <- Surv(aml$time, aml$status))+ str(sa)+ detach("package:survival", unload = TRUE)+ }Loading required package: survival'Surv' num [1:23, 1:2] 9 13 13+ 18 23 28+ 31 34 45+ 48 ...- attr(*, "dimnames")=List of 2..$ : NULL..$ : chr [1:2] "time" "status"- attr(*, "type")= chr "right"> ## were different, the last one failed in 1.6.2 (at least)>>> ## lm.influence where hat[1] == 1> if(require(MASS)) {+ fit <- lm(formula = 1000/MPG.city ~ Weight + Cylinders + Type + EngineSize + DriveTrain, data = Cars93)+ print(lm.influence(fit))+ ## row 57 should have hat = 1 and resid=0.+ summary(influence.measures(fit))+ }Loading required package: MASS$hat1 2 3 4 5 6 70.09313909 0.07134091 0.19138434 0.08101081 0.24991662 0.10448752 0.125918288 9 10 11 12 13 140.39348171 0.10008864 0.23497010 0.27831516 0.11499791 0.06684324 0.1677790315 16 17 18 19 20 210.10418769 0.19438856 0.22249600 0.18531791 0.42832529 0.13160780 0.1157105522 23 24 25 26 27 280.13542772 0.05989558 0.09115955 0.07274599 0.16979948 0.10059554 0.3642037029 30 31 32 33 34 350.05892084 0.12226683 0.14266192 0.06389391 0.07851639 0.16317503 0.1051403636 37 38 39 40 41 420.16620182 0.07407892 0.21406715 0.35800879 0.11660151 0.12115515 0.0584683943 44 45 46 47 48 490.07915006 0.05841339 0.07599254 0.14272015 0.10370606 0.22461698 0.0742392550 51 52 53 54 55 560.16054084 0.10007740 0.22613089 0.05679789 0.05802486 0.07274599 0.1662018257 58 59 60 61 62 631.00000000 0.16034032 0.14337335 0.11805892 0.13059078 0.05892084 0.1086926164 65 66 67 68 69 700.07024346 0.07721617 0.25915706 0.08887161 0.06631974 0.10330515 0.1943885671 72 73 74 75 76 770.12591828 0.21538400 0.05645115 0.08933216 0.16777903 0.07190036 0.1243535678 79 80 81 82 83 840.06735745 0.06233173 0.40499233 0.20574068 0.20315406 0.35602282 0.0881207685 86 87 88 89 90 910.13555308 0.09482733 0.24869622 0.06728598 0.57312772 0.08142621 0.1569444592 930.15864447 0.57312772$coefficients(Intercept) Weight Cylinders4 Cylinders5 Cylinders61 -0.8045874665 2.867170e-04 -3.820998e-03 -0.121186522 -0.0856524992 -0.1624020957 7.405395e-05 -3.377846e-02 -0.058135639 0.0325619093 0.0730227014 -1.000408e-04 2.635594e-02 -0.038987943 -0.1362840694 0.0154995743 8.165607e-06 5.679643e-03 0.005807148 0.0504326105 2.0624972203 -5.727657e-04 4.651265e-01 1.314202802 1.6890030616 0.1889725900 -8.408128e-05 3.552355e-02 -0.042386516 -0.0384837337 0.0288527501 -1.891425e-05 4.221544e-03 0.012091377 0.0080778108 -0.9237858418 3.777463e-06 -2.504289e-01 -0.282474268 -0.7780877529 0.0027522480 9.783189e-05 2.129655e-02 -0.007988299 0.01443211610 0.9903462340 -5.169747e-04 1.630209e-01 0.294911151 0.12997042411 -0.5182963206 1.916075e-04 -1.215727e-01 -0.226050823 -0.16152375412 -0.6387428727 2.494952e-04 -1.008869e-01 -0.179703222 -0.14388454813 -0.3568385025 7.917221e-05 -2.534541e-02 -0.028384831 -0.02939560714 -0.0077820700 -4.699458e-06 -1.266873e-03 0.041173344 0.05363113715 -0.2615585508 1.297214e-04 -5.490059e-02 -0.275540505 -0.22290957416 -0.0195241852 2.061693e-04 6.572061e-02 0.294616782 0.07426608717 0.0965040227 -1.534149e-04 1.527511e-02 -0.028420127 -0.11234860418 0.0048862795 -1.111273e-06 1.332650e-03 0.001477077 0.00100718919 -0.1837125526 1.943923e-04 -1.515756e-02 -0.122275191 0.01458811420 0.0080448668 -3.212441e-05 -2.747115e-03 0.002147238 -0.04826080821 0.3062320767 -7.003532e-05 1.382568e-01 0.212411378 0.36419235422 0.0834715351 -7.391740e-05 1.122255e-02 0.030230238 -0.03774485623 -0.0076656309 1.396550e-05 -4.020753e-02 -0.044659212 -0.05055497624 -1.5070278126 3.723597e-04 1.647077e-02 -0.161486560 -0.27875541525 -0.0239986724 1.966635e-05 -2.200355e-02 -0.039815491 -0.05183832226 -0.2726502980 7.668984e-05 -7.104259e-02 -0.070135093 -0.13877699927 -0.0237099021 -1.906594e-05 -1.449196e-02 -0.165127041 -0.18240719128 0.5989984194 -3.350192e-04 8.982947e-02 0.072939768 0.05194875029 0.0049978357 1.024575e-05 -4.596944e-02 -0.048846124 -0.05719541230 -0.0420784682 4.604021e-06 -9.761996e-03 -0.018154729 -0.05161381231 -0.1226019720 5.936642e-05 -4.859332e-02 -0.071029678 -0.07039649832 -1.2891791826 3.470986e-04 1.870320e-01 0.029725520 0.04749782933 0.5677503929 -2.038892e-04 6.741942e-02 0.117380014 0.07464421634 -0.0732129453 3.754795e-05 -1.228743e-02 -0.110181891 -0.11381247935 0.0194920033 -7.575835e-06 5.134183e-03 0.017360915 0.01539627536 1.6888356455 -4.377455e-04 4.524306e-01 0.411034679 0.90282391937 -0.4890085420 1.725038e-04 -1.049924e-01 -0.186804182 -0.42010739238 -0.0082739419 -1.137356e-04 -2.907676e-02 0.013409601 -0.08257216539 -1.0909018362 1.064695e-04 8.658188e-01 0.866130219 0.80647405540 -0.6733060595 1.783564e-04 -1.305062e-01 0.065871030 -0.12553382841 0.3690425668 -1.245558e-04 9.024714e-02 0.216243273 0.22893358842 0.6432124241 -7.951017e-05 -7.008503e-01 -0.653531527 -0.84710314043 0.2616446485 -1.975002e-04 9.041771e-02 0.187584888 0.13964034444 0.0454749520 -4.284837e-06 -5.453546e-02 -0.051589176 -0.06611678645 -2.2631327197 7.379870e-04 1.070445e-01 -0.204329361 -0.12826289246 -0.0612084384 2.238252e-05 -1.234131e-02 -0.011911444 -0.01736047647 0.8600843682 -2.923003e-04 1.777695e-01 -0.255446144 -0.11488695748 0.1775813222 -1.196361e-04 2.413830e-02 0.077055159 -0.01420350749 -0.1424954874 9.842541e-05 -2.377345e-02 -0.051500781 0.11300461950 0.2613474511 -1.665525e-05 8.367041e-02 0.117064766 0.30091321551 -0.5457545031 1.270106e-04 -1.351808e-01 -0.192894338 -0.17682682852 0.3111798506 -2.896481e-04 2.816237e-02 0.136852358 -0.00725060853 0.0297317368 1.296449e-05 -6.708602e-02 -0.069529496 -0.07563036754 0.0989545407 -1.357243e-05 -3.683573e-02 -0.028339562 -0.02514584155 0.1644148644 -1.347342e-04 1.507463e-01 0.272775865 0.35514425956 -1.0973102505 2.844224e-04 -2.939639e-01 -0.267067176 -0.58660411657 0.0000000000 0.000000e+00 0.000000e+00 0.000000000 0.00000000058 1.1181936467 -1.814925e-04 1.820092e-01 0.230407448 0.28178868059 -0.1289781075 2.595372e-05 -3.776833e-02 -0.058580136 -0.12606947360 0.4827651281 -1.458463e-04 9.396412e-02 -0.005593267 0.09926396561 -0.1929691299 1.326052e-04 -4.434766e-02 -0.106219857 -0.12433476262 0.0049978357 1.024575e-05 -4.596944e-02 -0.048846124 -0.05719541263 -0.3935296223 2.040809e-04 -7.524962e-02 -0.146355742 -0.01906464164 0.4603333737 -1.617410e-04 -5.546499e-02 0.010390154 -0.03528231965 0.3126987326 -1.960180e-04 1.168042e-01 0.223520593 0.21876288066 -0.1920212451 8.908026e-05 -4.283525e-02 -0.117606580 -0.03362225967 -0.8795466532 3.620658e-04 -1.815067e-01 -0.332837224 -0.50241909268 -0.0331296115 -3.321728e-05 2.875172e-02 0.062289524 0.06144206869 -0.1135318718 5.034205e-05 -2.126782e-02 0.029790905 0.02669504170 -0.0195241852 2.061693e-04 6.572061e-02 0.294616782 0.07426608771 0.0288527501 -1.891425e-05 4.221544e-03 0.012091377 0.00807781072 -0.2291016407 5.487125e-05 -6.613686e-02 -0.098852165 -0.05154947773 0.1700259290 7.628143e-06 -2.032259e-01 -0.198173180 -0.22410989374 0.5968477257 -1.921799e-04 9.263890e-02 0.150229991 0.15662864675 -0.0077820700 -4.699458e-06 -1.266873e-03 0.041173344 0.05363113776 -0.0194397858 2.531489e-05 -1.458165e-07 -0.009800589 -0.03589408377 0.0134907894 -1.033768e-05 1.558189e-03 0.006006815 0.00368440678 0.9077181399 -1.582828e-04 7.745093e-02 0.077205972 0.14105597479 0.2164417917 -3.971900e-05 -4.607492e-02 -0.024531503 -0.01264990280 0.9960541035 4.247826e-06 -7.839184e-01 -0.702085425 -0.79821913381 0.0007910652 -3.072859e-07 8.023023e-04 0.001256898 0.00075826182 -0.6435072296 -7.492359e-05 -1.735778e-01 -0.355994454 -0.11910199783 0.0611662403 1.159480e-05 -1.119647e-01 -0.121657673 -0.11700890584 -0.5769304812 3.253972e-04 -3.191547e-01 -0.437477397 -0.42395123585 1.0837148496 -4.307667e-04 2.461529e-01 0.572974426 0.54216721786 0.0083937926 -1.990781e-06 8.287336e-04 -0.045561514 -0.03780365587 -0.1545228365 9.611522e-05 -2.127841e-02 -0.171230178 -0.13708676488 0.2463906019 -2.892912e-04 3.477162e-01 0.438821017 0.35767479589 -0.6025253492 2.525728e-04 -1.370524e-01 1.172830299 -0.21166037790 -0.2820706112 3.173532e-04 -1.101740e-01 -0.261059565 -0.11891687691 1.4258537942 -6.533290e-04 2.630332e-01 0.890368685 1.14529155192 0.4060610493 -2.135821e-06 5.871214e-02 0.048538680 0.09410540793 -0.6025253492 2.525728e-04 -1.370524e-01 -1.878927238 -0.211660377Cylinders8 Cylindersrotary TypeLarge TypeMidsize TypeSmall1 -0.1124657876 -0.0651605878 -5.802887e-02 -0.0555471473 0.25283142692 0.0053388461 0.0047782307 -6.569650e-02 0.0350485943 0.02520411643 -0.1679122402 0.0274285066 2.008834e-01 0.1844628894 0.06743158144 0.0638568606 -0.0003503783 -9.564934e-03 0.0149006180 -0.00874309215 2.5938169745 0.8582948229 -2.399208e-01 -0.5792472372 -0.52850374646 -0.0288706903 0.0299679804 1.045061e-01 0.1382939842 -0.04012985997 -0.0312731330 0.0246836012 5.564636e-02 0.0035711688 -0.00416972388 -1.8340782811 0.0716558396 2.304687e-01 0.0032843291 0.33761722369 0.1847255512 -0.2306585282 1.114501e-01 -0.0803119855 -0.029840773710 1.1851421958 0.8654297998 4.409688e-01 0.0708134508 -0.204210472711 0.3843948456 0.1406061718 -3.010002e-01 0.0273414412 0.083777424612 -0.1597129689 -0.1864801897 6.450603e-02 0.0597885728 0.207632241613 -0.0586771076 -0.0646598581 1.706543e-01 0.1735883622 0.236156035114 -0.0028726461 -0.0993484475 -4.198827e-02 -0.0328695117 0.008249833315 -0.2068476225 -0.1445082313 1.225231e-01 0.1673204751 0.031295040616 0.2059222894 -0.1200505921 8.218720e-02 0.0002209106 0.017323567317 -0.3504899068 0.3446336843 -9.851809e-02 0.0158568288 0.063358121118 0.0120965218 -0.0020492335 6.525536e-03 0.0002012250 -0.000892920619 -0.0539420147 -0.1374351833 1.576257e-01 0.0201581755 -0.004147504920 -0.0070837751 0.0317471863 -1.531881e-01 0.0051020166 0.010930510821 0.5602808822 -0.0939068584 2.916889e-01 0.2079842274 0.071903613422 0.0126364571 0.0642138666 -1.824736e-01 0.0127807493 0.000978688223 -0.0590906405 -0.0349751702 -5.567345e-03 -0.0025732617 -0.022531325124 -0.5271125509 0.1602771709 -1.660813e-01 -0.0765130701 0.556489829325 -0.0681411476 0.0031024272 -6.907299e-02 -0.0610995775 -0.042984079026 -0.1735454433 -0.0706705707 -1.739837e-02 -0.0112946369 0.045222423227 -0.2193360665 0.0008241219 1.092126e-01 0.1738553921 0.004742851028 0.0830814596 0.1950801461 1.354514e-01 0.1170474131 -0.129913518429 -0.0675817916 -0.0375435877 -5.699613e-03 -0.0018561352 -0.029764600330 0.0331484828 -0.0113220048 -1.952427e-01 -0.0016275866 0.015833465831 -0.0814880252 -0.0547203065 -1.397635e-02 -0.0112820160 0.007746697332 -0.0305111798 0.1574388970 -9.111875e-02 -0.0694657561 0.550197839033 0.0753789673 0.1710615320 -1.462954e-01 -0.1345579924 -0.250791084034 -0.1921551895 -0.4405196059 1.130618e-01 0.0550822506 0.014285283835 0.0139101694 0.0258169696 -7.341174e-03 -0.0040191802 -0.001432328936 1.1438837591 0.4210260247 1.057460e-01 0.0605827133 -0.279514600337 -0.4363174667 -0.2224017015 7.276605e-02 -0.1577658535 0.108968150338 -0.5706613637 0.2470506317 -2.448941e-01 0.0200009992 0.029559311139 0.7628832511 0.8929585543 -2.839854e-02 -0.0150058474 0.062304416740 -0.4269483338 0.6476956209 -3.978519e-01 -0.2049708931 0.232683458941 0.2669874618 0.2216701222 -2.713083e-02 -0.0189484276 -0.059615623742 -1.0313086539 -0.4717065449 -5.947438e-02 0.0164415576 -0.618780490943 0.1137733941 0.1389371633 1.866498e-01 0.1973976445 0.105139574444 -0.0802417862 -0.0375174905 -4.849177e-03 0.0009183418 -0.046817960645 -0.2250554681 -0.0236009451 -1.620885e-01 -0.1443281442 0.799641390546 -0.0298791385 0.0117333041 -1.717830e-02 -0.0101575259 0.014962188347 0.0567064443 -0.0207407914 5.592524e-01 0.6766291378 -0.216320984548 -0.4128397633 0.1262494802 1.555317e-01 -0.0336491273 -0.027447202449 0.1227716704 -0.0185633712 -7.120767e-02 0.0510945769 0.009372714250 0.2753274562 -0.2227910135 1.638844e-02 0.0838038858 -0.052801468451 -0.3972662514 0.1137542901 -1.850157e-01 0.0563752358 0.130360105452 -0.6043582748 0.4122452714 -2.755341e-01 0.0529148176 -0.018132837353 -0.0823840936 -0.0629773704 -4.430653e-03 -0.0021608372 -0.053135903854 -0.0150792891 -0.0425585103 6.777594e-03 0.0030583353 -0.059117691155 0.4668348880 -0.0212547234 4.732189e-01 0.4185931034 0.294483852956 -0.7432312183 -0.2735589895 -6.870778e-02 -0.0393632338 0.181612839057 0.0000000000 0.0000000000 0.000000e+00 0.0000000000 0.000000000058 0.1945880055 -0.5587521455 -2.266734e-01 -0.3613221042 -0.550992375059 -0.0900361434 0.0807855154 -8.877433e-04 -0.0437027380 0.020323129260 0.2757970992 -0.3494459094 2.397384e-01 0.1279587545 -0.151273282061 0.1520532649 0.0495057257 6.424741e-02 -0.1224729549 -0.015232081162 -0.0675817916 -0.0375435877 -5.699613e-03 -0.0018561352 -0.029764600363 -0.0124737319 -0.1163136988 -6.666660e-02 0.0045716898 0.057365053264 -0.0495762572 0.0108982197 2.072756e-02 0.0311491661 -0.174477905365 0.2450971786 0.1014330960 2.438442e-01 0.2322886433 0.114561687566 -0.0137450945 -0.0933626778 -1.455145e-02 -0.0219051447 0.021076162067 -0.5159902331 -0.3502832221 3.148977e-02 -0.1793660556 0.171923435568 0.0601331294 0.0072908696 1.448763e-01 0.1417048477 0.126796767469 0.0205395611 -0.0166707782 -6.624376e-02 -0.0877281099 0.024423273070 0.2059222894 -0.1200505921 8.218720e-02 0.0002209106 0.017323567371 -0.0312731330 0.0246836012 5.564636e-02 0.0035711688 -0.004169723872 -0.0698149636 -0.0077907772 -5.798951e-02 -0.0404309294 0.029180450873 -0.2461674520 -0.1792254003 -8.946335e-03 -0.0005023396 -0.184921077374 0.2142676665 0.1219475973 -7.874021e-02 -0.0918428593 -0.230143914975 -0.0028726461 -0.0993484475 -4.198827e-02 -0.0328695117 0.008249833376 0.0016544356 -0.0670470508 3.751826e-02 -0.0342084452 -0.000368057377 -0.0256147452 0.0156400843 4.086022e-02 0.0019511571 -0.001754699378 0.2825081053 0.0902228220 -3.983641e-01 -0.4346234712 -0.604344137179 0.0159835202 -0.0629476770 1.898330e-02 0.0085089202 -0.107724374180 -0.8150304378 -0.7413746212 5.446384e-03 0.0101047426 0.013684503881 0.0006315229 0.0011374665 5.007436e-05 0.0001020962 0.000380297982 -0.1389697069 -0.2829444232 2.798773e-01 0.2855962270 0.283200776083 -0.1199642681 -0.1139380335 -3.874836e-03 -0.0029066043 0.005453797184 -0.4681723050 -0.3692610821 -6.915058e-02 -0.0611471408 -0.028677439985 0.5868282269 0.6138842050 -4.618245e-02 -0.0093232438 -0.168734836086 -0.0335385306 -0.0121341311 3.955944e-02 0.0530269621 -0.004951679087 -0.1199323644 -0.0903358174 7.132870e-02 0.0441402079 0.030584698888 0.3030076280 0.4897405972 2.110757e-02 0.0520618321 0.182885988989 -0.1751107919 -0.2847075342 -1.578805e-02 -0.1009325245 0.081671646890 0.0055450581 -0.2720115784 -2.803760e-01 -0.3305994053 -0.225490002791 1.1629492149 0.1111057651 -3.399076e-01 -0.2295981894 -0.303281481792 0.0465882510 -0.3782722178 -1.398749e-01 -0.2168631833 -0.267461209493 -0.1751107919 -0.2847075342 -1.578805e-02 -0.1009325245 0.0816716468TypeSporty TypeVan EngineSize DriveTrainFront DriveTrainRear1 0.0588316568 -0.1244451013 -0.0384310410 0.0770280182 0.03083091352 -0.0008119071 -0.0929376586 -0.0169359479 0.0241959908 -0.03393367553 0.1122278579 0.2291762722 0.0640824206 -0.0374592418 -0.00636805964 -0.0076600464 -0.0180881612 -0.0224320460 0.0058289643 -0.00196692095 -0.3020816254 -0.2058571702 -0.3622619462 -0.0332177591 -0.48961330136 0.0174438088 0.1203009860 0.0149164277 -0.0095259785 -0.01236041557 0.0006330938 0.0018693765 0.0107797571 -0.0019362039 -0.01342636318 0.0888020681 -0.0981347691 0.5308561510 -0.0605205490 0.06227918369 0.0084422208 0.0641063586 -0.1438112041 0.0132369251 0.123195298810 -0.0453797315 0.1992829759 0.2094701125 -0.0711059699 -0.586065654411 0.0248173290 -0.1726730349 0.0307556826 0.0513955297 -0.241813255712 0.1493980797 -0.0158201826 -0.0533221135 0.0282944654 0.022855002513 0.1994088698 0.1348657122 -0.0134379474 -0.0212986235 0.010355270914 0.0454481137 -0.0247086389 -0.0005370853 0.0136434594 0.075985546815 0.0737344548 0.0705529631 -0.0350342542 0.0366749177 0.002333405816 -0.0098606591 -0.6464182823 -0.1570311735 -0.3099924798 -0.243284194117 -0.0121432263 0.2179211370 0.2426878264 -0.2268810389 -0.300352650718 -0.0012645247 0.0023497958 -0.0011648194 -0.0007816983 0.003158879119 -0.0601680504 -0.0271883474 -0.1686877849 0.0224897952 0.037844321120 -0.0039938145 0.0181201352 0.0439331331 -0.0137111692 0.000088856021 0.1294650212 0.2558709492 -0.1869157355 -0.0403252374 0.103952478522 -0.0110221099 0.0377992374 0.0616023114 -0.0236300001 -0.002755427423 0.0036748958 -0.0109040520 0.0047056340 -0.0027760031 -0.007581530024 0.1217218160 -0.2001221968 0.1453646196 0.1092627610 -0.041926597925 -0.0473791084 -0.0661671214 0.0174623161 0.0138168014 -0.011359749826 0.0343625250 -0.1263789642 0.0185185704 0.0899765460 0.062867116027 0.0521314845 0.1121866729 0.0452354145 0.0036741989 -0.032855843028 -0.1357733641 0.3598998278 0.0635427842 0.1408150632 0.228969782529 0.0032709010 -0.0102098982 0.0072097840 -0.0046929662 -0.009759303630 -0.0031503060 0.0096427335 0.0191501496 -0.0072782279 0.018326944031 0.0124966732 -0.0309659093 -0.0029315971 0.0080704811 -0.003229117432 0.0842166724 -0.1426179532 -0.0047149618 0.1266243473 0.048802520333 -0.2007361705 -0.0700394295 0.0650345678 -0.0076553978 -0.032361340734 0.1985477388 0.1317049456 -0.0379303148 0.0476640032 0.255792893635 -0.0241684660 -0.0063797023 0.0015970165 -0.0082742198 -0.001284584736 -0.2213615898 0.8328871713 -0.1490208173 -0.6045260895 -0.427499786037 0.0832688361 0.0526955171 0.0412992657 0.0057199017 0.075053981438 0.0381452581 -0.0364723376 0.1718996509 -0.0083216767 -0.171126965439 0.0126715370 -0.1319040895 0.0157246728 -0.1238552960 -0.143399580140 -0.6152814178 -0.4391609078 0.1925710081 -0.1848270831 -0.125792322341 -0.2136693396 -0.0102756220 -0.0187378955 -0.0760535877 0.007905047342 0.0115250441 -0.0626784733 0.1853115582 -0.1341403576 -0.193753997543 0.1223234350 0.2339351557 0.0477222207 -0.0703208756 -0.013181029944 0.0012062101 -0.0056275300 0.0138113326 -0.0099328213 -0.014713800545 0.1593529911 -0.3154119193 -0.0734215883 0.2186169305 0.086356449346 -0.0178306744 -0.0229394143 0.0050172709 -0.0032569785 -0.004014029947 0.0870826598 0.5764940782 -0.0661850124 -0.0160346100 0.005823737448 0.0351028466 0.0519540796 0.0730561863 -0.0117874040 -0.087560053349 -0.0118615751 -0.1170935139 -0.0664392527 0.0351943834 -0.025650086250 -0.0881348868 0.0099122018 -0.1427997802 -0.0154102445 0.283435126151 0.0341259919 -0.1980471170 0.1301931475 0.0329557292 -0.139072682252 0.0198930304 0.0233944834 0.2437424291 -0.0398986993 -0.221652196353 0.0026357380 -0.0124859669 0.0032736381 -0.0076038099 -0.011178018454 -0.0052948316 0.0043390590 -0.0062558306 -0.0100922249 -0.003676445055 0.3245941919 0.4533108376 -0.1196342985 -0.0946588832 0.077825627056 0.1438282891 -0.5411631576 0.0968253310 0.3927869929 0.277765274957 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.000000000058 -0.5770947483 -0.1184054962 -0.1740228604 -0.0285545091 0.769303790259 0.0412280879 -0.0075198458 0.0438882586 0.0121450418 -0.125226237960 0.3533541160 0.2760694598 -0.1036620689 0.1001975219 0.070312494461 0.0813382295 -0.0073739718 -0.0680618001 0.0531536577 -0.233286514762 0.0032709010 -0.0102098982 0.0072097840 -0.0046929662 -0.009759303663 0.0180571278 -0.1370722536 -0.0731027259 0.0500357603 -0.003994566264 -0.0280219408 0.0596353403 0.0485330769 -0.0523499513 -0.038062525265 0.1445564205 0.2773146947 -0.0044527086 -0.0739571632 0.014572262366 0.0147554787 0.0493296285 -0.0390174812 0.0705967740 0.063463815967 0.1109162662 -0.0476703926 -0.0101172134 0.0463473545 0.083885595968 0.1228600624 0.1417644316 -0.0078297996 -0.0320462976 0.009321440369 -0.0117468402 -0.0753433644 -0.0087753330 0.0054190284 0.007617183370 -0.0098606591 -0.6464182823 -0.1570311735 -0.3099924798 -0.243284194171 0.0006330938 0.0018693765 0.0107797571 -0.0019362039 -0.013426363172 -0.0675185509 0.0151499809 -0.0006299133 0.1444639061 0.146377601073 0.0024427576 -0.0249870886 0.0183259078 -0.0314868930 -0.039150439374 -0.1684498617 -0.0211344382 0.0051450670 -0.0108665177 -0.000673338475 0.0454481137 -0.0247086389 -0.0005370853 0.0136434594 0.075985546876 0.0087561990 0.0294347022 -0.0243866906 0.0001777584 0.036146738077 0.0011372964 -0.0003003688 0.0071919929 -0.0007018973 -0.009690184078 -0.4998716808 -0.3342094594 -0.0381922269 0.0632770184 0.009809257479 -0.0142230621 0.0179025413 -0.0175009156 -0.0191510694 -0.001533350180 -0.0247650968 -0.1469466395 0.0130804686 -0.2728976699 -0.259216450281 -0.0001483293 -0.0004719821 0.0001778419 -0.0011917350 -0.001121804282 0.3679140434 0.7422456267 0.0018768183 0.7508948030 0.773001553183 0.0043841507 0.0024787823 0.0002320259 0.0183666140 0.014519063384 0.0640691059 -0.1711824885 -0.0312673044 0.0349340607 -0.019255033085 -0.4756750417 0.0452676883 0.0298336291 -0.1959168864 -0.013638161486 0.0135669048 0.0363260497 -0.0012178976 0.0026468538 -0.002479987887 0.0376963721 0.1229412256 -0.0225447495 -0.0488081493 -0.041783108288 -0.0360445039 0.1399780291 0.1137882315 -0.0178410448 -0.010513272289 0.0609817970 0.1720567027 -0.0724262979 0.1875627215 0.189207077390 -0.2273870236 -0.3709143259 -0.1506696521 0.1197628934 0.058602332591 0.4164006880 -0.1004183249 0.0323442452 0.1231599812 -0.104020406092 -0.2996222296 -0.1090340253 -0.1173564279 0.0035664196 0.430579957493 0.0609817970 0.1720567027 -0.0724262979 0.1875627215 0.1892070773$sigma1 2 3 4 5 6 7 83.591432 3.594883 3.598562 3.600558 3.522694 3.598166 3.600799 3.5823639 10 11 12 13 14 15 163.590729 3.528259 3.589350 3.596037 3.584177 3.600028 3.593696 3.58054717 18 19 20 21 22 23 243.590040 3.601220 3.599441 3.598460 3.584656 3.597078 3.600671 3.55372525 26 27 28 29 30 31 323.599688 3.599193 3.595214 3.598433 3.600406 3.596419 3.601044 3.51864933 34 35 36 37 38 39 403.587115 3.592663 3.601139 3.501762 3.560763 3.588001 3.592963 3.51467041 42 43 44 45 46 47 483.595497 3.334292 3.589110 3.599718 3.471882 3.601133 3.521852 3.59412249 50 51 52 53 54 55 563.588734 3.589710 3.583459 3.581755 3.599157 3.599895 3.528075 3.55957857 58 59 60 61 62 63 643.601231 3.523963 3.598459 3.571771 3.582319 3.600406 3.596626 3.59296065 66 67 68 69 70 71 723.583325 3.600828 3.569987 3.592482 3.599979 3.580547 3.600799 3.59976873 74 75 76 77 78 79 803.579302 3.593475 3.600028 3.598895 3.600991 3.495965 3.597794 3.59422981 82 83 84 85 86 87 883.601231 3.563077 3.601124 3.585986 3.575773 3.600658 3.599786 3.56395489 90 91 92 933.594056 3.566216 3.484273 3.578056 3.594056$wt.res1 2 3 4 52.218439708 1.807326787 -1.093991760 0.585986462 -5.6845892706 7 8 9 101.233522386 0.457950438 2.515990067 -2.287803728 5.53596062511 12 13 14 152.178905651 -1.596117514 -2.967297860 0.745175851 1.93388282416 17 18 19 20-3.035594591 2.195009903 0.072527577 -0.753360641 -1.15505962121 22 23 24 25-2.847828869 -1.410703414 -0.540252474 4.877197398 0.89071564026 27 28 29 30-0.968642103 1.731771561 -0.993218102 -0.656454198 -1.52995069331 32 33 34 35-0.298424469 6.510112647 2.683267748 1.992954455 -0.21407942336 37 38 39 406.735053083 -4.545792145 -2.399183444 -1.714795692 -6.47293095441 42 43 44 45-1.671169308 -11.585332803 -2.485888781 -0.888857647 8.06807102546 47 48 49 50-0.216046323 6.246829383 -1.747619081 2.530823032 2.31410662851 52 53 54 552.974532942 -2.887230686 -1.041442666 -0.835536301 -6.10229135356 57 58 59 60-4.376058028 0.000000000 5.966190371 -1.147443467 3.78819830661 62 63 64 65-3.015807719 -0.656454198 1.508247858 -2.064017840 -3.02346226866 67 68 69 700.407243898 -3.964783523 -2.127186213 -0.789242889 -3.03559459171 72 73 74 750.457950438 -0.797900840 -3.382338495 1.978150290 0.74517585176 77 78 79 80-1.096455031 0.341748714 7.324729228 -1.336726492 1.51931399581 82 83 84 850.005901292 -4.095330927 0.195481697 -2.773676266 -3.48737543986 87 88 89 900.536312040 0.775871729 4.379791779 1.302710701 4.21322876191 92 937.334576566 3.283113507 -1.302710701Potentially influential observations oflm(formula = 1000/MPG.city ~ Weight + Cylinders + Type + EngineSize + DriveTrain, data = Cars93) :dfb.1_ dfb.Wght dfb.Cyl4 dfb.Cyl5 dfb.Cyl6 dfb.Cyl8 dfb.Cyln dfb.TypL8 -0.16 0.00 -0.10 -0.07 -0.24 -0.44 0.01 0.1219 -0.03 0.09 -0.01 -0.03 0.00 -0.01 -0.03 0.0828 0.11 -0.15 0.04 0.02 0.02 0.02 0.04 0.0739 -0.19 0.05 0.34 0.21 0.25 0.18 0.18 -0.0142 0.12 -0.04 -0.30 -0.17 -0.28 -0.26 -0.11 -0.0357 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.0066 -0.03 0.04 -0.02 -0.03 -0.01 0.00 -0.02 -0.0180 0.18 0.00 -0.31 -0.17 -0.24 -0.19 -0.15 0.0083 0.01 0.01 -0.04 -0.03 -0.04 -0.03 -0.02 0.0087 -0.03 0.04 -0.01 -0.04 -0.04 -0.03 -0.02 0.0489 -0.11 0.11 -0.05 0.28 -0.06 -0.04 -0.06 -0.0193 -0.11 0.11 -0.05 -0.45 -0.06 -0.04 -0.06 -0.01dfb.TypM dfb.TypSm dfb.TypSp dfb.TypV dfb.EngS dfb.DrTF dfb.DrTR dffit8 0.00 0.21 0.06 -0.04 0.47 -0.04 0.03 0.7319 0.01 0.00 -0.04 -0.01 -0.15 0.01 0.02 -0.2428 0.08 -0.08 -0.09 0.16 0.06 0.09 0.12 -0.2639 -0.01 0.04 0.01 -0.06 0.01 -0.08 -0.08 -0.4442 0.01 -0.42 0.01 -0.03 0.18 -0.10 -0.11 -0.8957 0.00 0.00 0.00 0.00 0.00 0.00 0.00 NaN66 -0.02 0.01 0.01 0.02 -0.03 0.05 0.03 0.0880 0.01 0.01 -0.02 -0.07 0.01 -0.18 -0.14 0.4583 0.00 0.00 0.00 0.00 0.00 0.01 0.01 0.0587 0.03 0.02 0.03 0.06 -0.02 -0.03 -0.02 0.1489 -0.07 0.05 0.04 0.08 -0.06 0.12 0.10 0.6493 -0.07 0.05 0.04 0.08 -0.06 0.12 0.10 -0.64cov.r cook.d hat8 1.71_* 0.04 0.3919 2.09_* 0.00 0.4328 1.86_* 0.00 0.3639 1.76_* 0.01 0.3642 0.13_* 0.05 0.0657 NaN NaN 1.00_*66 1.63_* 0.00 0.2680 1.92_* 0.01 0.4083 1.88_* 0.00 0.3687 1.60_* 0.00 0.2589 2.68_* 0.03 0.57_*93 2.68_* 0.03 0.57_*> ## only last two cols in row 57 should be influential>>> ## PR#6640 Zero weights in plot.lm> if(require(MASS)) {+ fm1 <- lm(time~dist, data=hills, weights=c(0,0,rep(1,33)))+ plot(fm1)+ }> ## gave warnings in 1.8.1>>> ## PR#7829 model.tables & replications> if(require(MASS)) {+ oats.aov <- aov(Y ~ B + V + N + V:N, data=oats[-1,])+ model.tables(oats.aov, "means", cterms=c("N", "V:N"))+ }Tables of meansGrand mean103.8732N0.0cwt 0.2cwt 0.4cwt 0.6cwt78.74 98.51 113.8 123rep 17.00 18.00 18.0 18V:NNV 0.0cwt 0.2cwt 0.4cwt 0.6cwtGolden.rain 79.53 98.03 114.20 124.37rep 6.00 6.00 6.00 6.00Marvellous 86.20 108.03 116.70 126.37rep 6.00 6.00 6.00 6.00Victory 69.77 89.20 110.37 118.03rep 5.00 6.00 6.00 6.00> ## wrong printed output in 2.1.0>>> ## drop1 on weighted lm() fits> if(require(MASS)) {+ hills.lm <- lm(time ~ 0 + dist + climb, data=hills, weights=1/dist^2)+ print(drop1(hills.lm))+ print(stats:::drop1.default(hills.lm))+ hills.lm2 <- lm(time/dist ~ 1 + I(climb/dist), data=hills)+ drop1(hills.lm2)+ }Single term deletionsModel:time ~ 0 + dist + climbDf Sum of Sq RSS AIC<none> 442.22 92.776dist 1 330.92 773.14 110.329climb 1 9.73 451.95 91.538Single term deletionsModel:time ~ 0 + dist + climbDf AIC<none> 92.776dist 1 110.329climb 1 91.538Single term deletionsModel:time/dist ~ 1 + I(climb/dist)Df Sum of Sq RSS AIC<none> 442.22 92.776I(climb/dist) 1 9.7331 451.95 91.538> ## quoted unweighted RSS etc in 2.2.1>>> ## tests of ISO C99 compliance (Windows fails without a workaround)> sprintf("%g", 123456789)[1] "1.23457e+08"> sprintf("%8g", 123456789)[1] "1.23457e+08"> sprintf("%9.7g", 123456789)[1] "1.234568e+08"> sprintf("%10.9g", 123456789)[1] " 123456789"> sprintf("%g", 12345.6789)[1] "12345.7"> sprintf("%10.9g", 12345.6789)[1] "12345.6789"> sprintf("%10.7g", 12345.6789)[1] " 12345.68"> sprintf("%.7g", 12345.6789)[1] "12345.68"> sprintf("%.5g", 12345.6789)[1] "12346"> sprintf("%.4g", 12345.6789)[1] "1.235e+04"> sprintf("%9.4g", 12345.6789)[1] "1.235e+04"> sprintf("%10.4g", 12345.6789)[1] " 1.235e+04"> ## Windows used e+008 etc prior to 2.3.0>>> ## weighted glm() fits> if(require(MASS)) {+ hills.glm <- glm(time ~ 0 + dist + climb, data=hills, weights=1/dist^2)+ print(AIC(hills.glm))+ print(extractAIC(hills.glm))+ print(drop1(hills.glm))+ stats:::drop1.default(hills.glm)+ }[1] 322.2318[1] 2.0000 322.2318Single term deletionsModel:time ~ 0 + dist + climbDf Deviance AIC<none> 442.22 322.23dist 1 773.14 339.78climb 1 451.95 320.99Single term deletionsModel:time ~ 0 + dist + climbDf AIC<none> 322.23dist 1 339.78climb 1 320.99> ## wrong AIC() and drop1 prior to 2.3.0.>> ## calculating no of signif digits> print(1.001, digits=16)[1] 1.001> ## 2.4.1 gave 1.001000000000000> ## 2.5.0 errs on the side of caution.>>> ## as.matrix.data.frame with coercion> if(require("survival")) {+ soa <- Surv(1:5, c(0, 0, 1, 0, 1))+ df.soa <- data.frame(soa)+ print(as.matrix(df.soa)) # numeric result+ df.soac <- data.frame(soa, letters[1:5])+ print(as.matrix(df.soac)) # character result+ detach("package:survival", unload = TRUE)+ }Loading required package: survivalsoa.time soa.status[1,] 1 0[2,] 2 0[3,] 3 1[4,] 4 0[5,] 5 1soa letters.1.5.[1,] "1+" "a"[2,] "2+" "b"[3,] "3 " "c"[4,] "4+" "d"[5,] "5 " "e"> ## failed in 2.8.1>> ## wish of PR#13505> npk.aov <- aov(yield ~ block + N * P + K, npk)> foo <- proj(npk.aov)> cbind(npk, foo)block N P K yield (Intercept) block N P K1 1 0 1 1 49.5 54.875 -0.850 -2.808333 -0.5916667 -1.9916672 1 1 1 0 62.8 54.875 -0.850 2.808333 -0.5916667 1.9916673 1 0 0 0 46.8 54.875 -0.850 -2.808333 0.5916667 1.9916674 1 1 0 1 57.0 54.875 -0.850 2.808333 0.5916667 -1.9916675 2 1 0 0 59.8 54.875 2.575 2.808333 0.5916667 1.9916676 2 1 1 1 58.5 54.875 2.575 2.808333 -0.5916667 -1.9916677 2 0 0 1 55.5 54.875 2.575 -2.808333 0.5916667 -1.9916678 2 0 1 0 56.0 54.875 2.575 -2.808333 -0.5916667 1.9916679 3 0 1 0 62.8 54.875 5.900 -2.808333 -0.5916667 1.99166710 3 1 1 1 55.8 54.875 5.900 2.808333 -0.5916667 -1.99166711 3 1 0 0 69.5 54.875 5.900 2.808333 0.5916667 1.99166712 3 0 0 1 55.0 54.875 5.900 -2.808333 0.5916667 -1.99166713 4 1 0 0 62.0 54.875 -4.750 2.808333 0.5916667 1.99166714 4 1 1 1 48.8 54.875 -4.750 2.808333 -0.5916667 -1.99166715 4 0 0 1 45.5 54.875 -4.750 -2.808333 0.5916667 -1.99166716 4 0 1 0 44.2 54.875 -4.750 -2.808333 -0.5916667 1.99166717 5 1 1 0 52.0 54.875 -4.350 2.808333 -0.5916667 1.99166718 5 0 0 0 51.5 54.875 -4.350 -2.808333 0.5916667 1.99166719 5 1 0 1 49.8 54.875 -4.350 2.808333 0.5916667 -1.99166720 5 0 1 1 48.8 54.875 -4.350 -2.808333 -0.5916667 -1.99166721 6 1 0 1 57.2 54.875 1.475 2.808333 0.5916667 -1.99166722 6 1 1 0 59.0 54.875 1.475 2.808333 -0.5916667 1.99166723 6 0 1 1 53.2 54.875 1.475 -2.808333 -0.5916667 -1.99166724 6 0 0 0 56.0 54.875 1.475 -2.808333 0.5916667 1.991667N:P Residuals1 0.9416667 -0.07500002 -0.9416667 5.50833333 -0.9416667 -6.05833334 0.9416667 0.62500005 0.9416667 -3.98333336 -0.9416667 1.76666677 -0.9416667 3.20000008 0.9416667 -0.98333339 0.9416667 2.491666710 -0.9416667 -4.258333311 0.9416667 2.391666712 -0.9416667 -0.625000013 0.9416667 5.541666714 -0.9416667 -0.608333315 -0.9416667 0.525000016 0.9416667 -5.458333317 -0.9416667 -1.791666718 -0.9416667 2.141666719 0.9416667 -3.075000020 0.9416667 2.725000021 0.9416667 -1.500000022 -0.9416667 -0.616666723 0.9416667 1.300000024 -0.9416667 0.8166667> ## failed in R < 2.10.0>>> if(suppressMessages(require("Matrix"))) {+ print(cS. <- contr.SAS(5, sparse = TRUE))+ stopifnot(all(contr.SAS(5) == cS.),+ all(contr.helmert(5, sparse = TRUE) == contr.helmert(5)))++ x1 <- x2 <- c('a','b','a','b','c')+ x3 <- x2; x3[4:5] <- x2[5:4]+ print(xtabs(~ x1 + x2, sparse= TRUE, exclude = 'c'))+ print(xtabs(~ x1 + x3, sparse= TRUE, exclude = 'c'))+ detach("package:Matrix")+ ## failed in R <= 2.13.1+ }5 x 4 sparse Matrix of class "dgCMatrix"1 2 3 41 1 . . .2 . 1 . .3 . . 1 .4 . . . 15 . . . .2 x 2 sparse Matrix of class "dgCMatrix"x2x1 a ba 2 .b . 22 x 2 sparse Matrix of class "dgCMatrix"x3x1 a ba 2 .b . 1>> ## regression tests for dimnames (broken on 2009-07-31)> contr.sum(4)[,1] [,2] [,3]1 1 0 02 0 1 03 0 0 14 -1 -1 -1> contr.helmert(4)[,1] [,2] [,3]1 -1 -1 -12 1 -1 -13 0 2 -14 0 0 3> contr.sum(2) # needed drop=FALSE at one point.[,1]1 12 -1>> ## xtabs did not exclude levels from factors> x1 <- c('a','b','a','b','c', NA)> x2 <- factor(x1, exclude=NULL)> print(xtabs(~ x1 + x2, na.action = na.pass))x2x1 a b c <NA>a 2 0 0 0b 0 2 0 0c 0 0 1 0> print(xtabs(~ x1 + x2, exclude = 'c', na.action = na.pass))x2x1 a b <NA>a 2 0 0b 0 2 0<NA> 0 0 1>>> ## median should work by default for a suitable S4 class.> ## adapted from adaptsmoFMRI> if(suppressMessages(require("Matrix"))) {+ x <- matrix(c(1,2,3,4))+ print(median(x))+ print(median(as(x, "dgeMatrix")))+ detach("package:Matrix")+ }[1] 2.5[1] 2.5>> ## Various arguments were not duplicated: PR#15352 to 15354> x <- 5> y <- 2> f <- function (y) x> numericDeriv(f(y),"y")[1] 5attr(,"gradient")[,1][1,] 0> x[1] 5>> a<-list(1,2)> b<-rep.int(a,c(2,2))> b[[1]][1]<-9> a[[1]][1] 1>> a <- numeric(1)> x <- mget("a",as.environment(1))> x$a[1] 0> a[1] <- 9> x$a[1] 0>>> ## needs MASS installed> ## PR#2586 labelling in alias()> if(require("MASS")) {+ Y <- c(0,1,2)+ X1 <- c(0,1,0)+ X2 <- c(0,1,0)+ X3 <- c(0,0,1)+ print(res <- alias(lm(Y ~ X1 + X2 + X3)))+ stopifnot(identical(rownames(res[[2]]), "X2"))+ }Model :Y ~ X1 + X2 + X3Complete :(Intercept) X1 X3X2 0 1 0> ## the error was in lm.(w)fit>> if(require("Matrix")) {+ m1 <- m2 <- m <- matrix(1:12, 3,4)+ dimnames(m2) <- list(LETTERS[1:3],+ letters[1:4])+ dimnames(m1) <- list(NULL,letters[1:4])+ M <- Matrix(m)+ M1 <- Matrix(m1)+ M2 <- Matrix(m2)+ ## Now, with a new ideal cbind(), rbind():+ print(cbind(M, M1))+ stopifnot(identical(cbind (M, M1),+ cbind2(M, M1)))+ rm(M,M1,M2)+ detach("package:Matrix", unload=TRUE)+ }##{Matrix}Loading required package: Matrix3 x 8 Matrix of class "dgeMatrix"a b c d[1,] 1 4 7 10 1 4 7 10[2,] 2 5 8 11 2 5 8 11[3,] 3 6 9 12 3 6 9 12>>> ## Invalid UTF-8 strings> x <- c("Jetz", "no", "chli", "z\xc3\xbcrit\xc3\xbc\xc3\xbctsch:",+ "(noch", "ein", "bi\xc3\x9fchen", "Z\xc3\xbc", "deutsch)",+ "\xfa\xb4\xbf\xbf\x9f")> lapply(x, utf8ToInt)[[1]][1] 74 101 116 122[[2]][1] 110 111[[3]][1] 99 104 108 105[[4]][1] 122 252 114 105 116 252 252 116 115 99 104 58[[5]][1] 40 110 111 99 104[[6]][1] 101 105 110[[7]][1] 98 105 223 99 104 101 110[[8]][1] 90 252[[9]][1] 100 101 117 116 115 99 104 41[[10]][1] NA> Encoding(x) <- "UTF-8"> nchar(x, "b")[1] 4 2 4 15 5 3 8 3 8 5> try(nchar(x, "c"))Error in nchar(x, "c") : invalid multibyte string, element 10> try(nchar(x, "w"))Error in nchar(x, "w") : invalid multibyte string, element 10> nchar(x, "c", allowNA = TRUE)[1] 4 2 4 12 5 3 7 2 8 NA> nchar(x, "w", allowNA = TRUE)[1] 4 2 4 12 5 3 7 2 8 NA> ## Results differed by platform, but some gave incorrect results on string 10.>>> ## str() on large strings (in multibyte locales; changing locale may not work everywhere> oloc <- Sys.getlocale("LC_CTYPE")> mbyte.lc <- {+ if(.Platform$OS.type == "windows")+ "English_United States.28605"+ else if(grepl("[.]UTF-8$", oloc, ignore.case=TRUE)) # typically nowadays+ oloc+ else+ "en_US.UTF-8" # or rather "C.UTF-8" or from system("locale -a | fgrep .utf8")+ }> identical(Sys.setlocale("LC_CTYPE", mbyte.lc), mbyte.lc) # "ok" if not[1] TRUE> cc <- "J\xf6reskog" # valid in "latin-1"; invalid multibyte string in UTF-8> .tmp <- capture.output(+ str(cc) # failed in some R-devel versions+ )> stopifnot(grepl("chr \"J.*reskog\"", .tmp))> nchar(L <- strrep(paste(LETTERS, collapse="."), 100000), type="b")# 5.1 M[1] 5100000> stopifnot(system.time( str(L) )[[1L]] < 0.10) # Sparc Solaris needed 0.052chr "A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.ZA.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.ZA.B.C.D.E"| __truncated__> if(mbyte.lc != oloc) Sys.setlocale("LC_CTYPE", oloc)[1] "C"> ## needed 1.6 sec in (some) R <= 3.3.0 in a multibyte locale>> if(require("Matrix", .Library)) {+ M <- Matrix(diag(1:10), sparse=TRUE) # a "dsCMatrix"+ setClass("TestM", slots = c(M='numeric'))+ setMethod("+", c("TestM","TestM"), function(e1,e2) {+ e1@M + e2@M+ })+ M+M # works the first time+ M+M # was error "object '.Generic' not found"+ ##+ stopifnot(+ identical(pmin(2,M), pmin(2, as.matrix(M))),+ identical(as.matrix(pmax(M, 7)), pmax(as.matrix(M), 7))+ )+ rm(M)+ detach("package:Matrix", unload=TRUE)+ }##{Matrix}Loading required package: Matrix<sparse>[ <logic> ] : .M.sub.i.logical() maybe inefficient>