Package: r-cran-misctools / 0.6-28-1

skip_ecdat_test.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Author: Andreas Tille <[email protected]>
Last-Update: Mon, 23 Jun 2014 09:24:05  0200
Description:  The colMediansTest needs data from the Ecdat package from
   http://cran.r-project.org/web/packages/Ecdat/
 that in turn needs another package to maintain these data.  Since we
 need to cut the chain of dependencies that are just packaged to run
 sensible tests this test is left out.  If you install these data
 manually or perhaps use the inofficial and incomplete packaging at
   svn://anonscm.debian.org/debian-science/packages/R/trunk/packages/r-cran-ecdat/trunk/
 this patch can be droped for local tests

--- miscTools.orig/tests/colMediansTest.R
    miscTools/tests/colMediansTest.R
@@ -13,29  13,3 @@
 all.equal( cm1, rowMedians( t( m ) ) )
 all.equal( rm1, colMedians( t( m ) ) )
 
-
-## data.frame
-data( "Electricity", package = "Ecdat" )
-Electricity <- Electricity[ 1:20, ]
-
-cm2 <- colMedians( Electricity )
-print( cm2 )
-
-rm2 <- rowMedians( Electricity )
-print( rm2 )
-
-all.equal( cm2, rowMedians( t( Electricity ) ) )
-all.equal( rm2, colMedians( t( Electricity ) ) )
-
-# array (3 dimensions)
-a3 <- array( 1:24, dim = c(4,3,2),
-   dimnames = list( c("a","b","c","d"), c("A","B","C"), c("x","y") ) )
-colMedians( a3 )
-all.equal( median( a3[ , "B", "y" ] ), colMedians( a3 )[ "B", "y" ] )
-
-# array (4 dimensions)
-a4 <- array( 1:120, dim = c(5,4,3,2),
-   dimnames = list( c("a","b","c","d","e"), c("A","B","C","D"),
-   c("x","y","z"), c("Y","Z") ) )
-colMedians( a4 )
-all.equal( median( a4[ , "B", "x", "Z" ] ), colMedians( a4 )[ "B", "x", "Z" ] )
--- miscTools.orig/tests/colMediansTest.Rout.save
    miscTools/tests/colMediansTest.Rout.save
@@ -36,63  36,3 @@
 [1] TRUE
 > 
 > 
-> ## data.frame
-> data( "Electricity", package = "Ecdat" )
-> Electricity <- Electricity[ 1:20, ]
-> 
-> cm2 <- colMedians( Electricity )
-> print( cm2 )
-      cost          q         pl         sl         pk         sk         pf 
-   3.09655  422.50000 7794.10000    0.21090   69.26100    0.24415   25.95070 
-        sf 
-   0.59860 
-> 
-> rm2 <- rowMedians( Electricity )
-> print( rm2 )
-       1        2        3        4        5        6        7        8 
- 4.20985 12.05485 25.04895 14.64980 20.72935 18.42610 16.34295  7.24435 
-       9       10       11       12       13       14       15       16 
-11.32520  8.27460 14.17730 13.01815 22.80935 17.95680 14.06405 15.67750 
-      17       18       19       20 
-15.49855 12.44370 15.61920 21.87700 
-> 
-> all.equal( cm2, rowMedians( t( Electricity ) ) )
-[1] TRUE
-> all.equal( rm2, colMedians( t( Electricity ) ) )
-[1] TRUE
-> 
-> # array (3 dimensions)
-> a3 <- array( 1:24, dim = c(4,3,2),
-     dimnames = list( c("a","b","c","d"), c("A","B","C"), c("x","y") ) )
-> colMedians( a3 )
-     x    y
-A  2.5 14.5
-B  6.5 18.5
-C 10.5 22.5
-> all.equal( median( a3[ , "B", "y" ] ), colMedians( a3 )[ "B", "y" ] )
-[1] TRUE
-> 
-> # array (4 dimensions)
-> a4 <- array( 1:120, dim = c(5,4,3,2),
-     dimnames = list( c("a","b","c","d","e"), c("A","B","C","D"),
-     c("x","y","z"), c("Y","Z") ) )
-> colMedians( a4 )
-, , Y
-
-   x  y  z
-A  3 23 43
-B  8 28 48
-C 13 33 53
-D 18 38 58
-
-, , Z
-
-   x  y   z
-A 63 83 103
-B 68 88 108
-C 73 93 113
-D 78 98 118
-
-> all.equal( median( a4[ , "B", "x", "Z" ] ), colMedians( a4 )[ "B", "x", "Z" ] )
-[1] TRUE
->