| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-12-11 11:35 -0500 (Thu, 11 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4872 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4580 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 253/2331 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-12-10 23:04:51 -0500 (Wed, 10 Dec 2025) |
| EndedAt: 2025-12-10 23:05:17 -0500 (Wed, 10 Dec 2025) |
| EllapsedTime: 26.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.258 0.044 0.288
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6 1048392 56 639317 34.2
Vcells 885623 6.8 8388608 64 2082728 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Wed Dec 10 23:05:07 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Wed Dec 10 23:05:07 2025"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x615f2ad9f5e0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Wed Dec 10 23:05:08 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Wed Dec 10 23:05:08 2025"
>
> ColMode(tmp2)
<pointer: 0x615f2ad9f5e0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.40548457 -0.93585760 -0.8231939 0.8941408
[2,] -0.21420227 0.02418701 1.6996222 0.4892309
[3,] -0.04028607 -1.08661166 0.9504464 0.1179102
[4,] -0.65478744 -0.29536171 0.2158986 -0.3469138
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.40548457 0.93585760 0.8231939 0.8941408
[2,] 0.21420227 0.02418701 1.6996222 0.4892309
[3,] 0.04028607 1.08661166 0.9504464 0.1179102
[4,] 0.65478744 0.29536171 0.2158986 0.3469138
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0202537 0.9673973 0.9073004 0.9455902
[2,] 0.4628199 0.1555217 1.3036956 0.6994504
[3,] 0.2007139 1.0424067 0.9749084 0.3433806
[4,] 0.8091894 0.5434719 0.4646489 0.5889939
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.60802 35.60983 34.89620 35.35004
[2,] 29.84240 26.57940 39.73658 32.48374
[3,] 27.04743 36.51068 35.69953 28.55172
[4,] 33.74668 30.73008 29.86239 31.23685
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x615f2a92a840>
> exp(tmp5)
<pointer: 0x615f2a92a840>
> log(tmp5,2)
<pointer: 0x615f2a92a840>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.5735
> Min(tmp5)
[1] 53.24151
> mean(tmp5)
[1] 72.55548
> Sum(tmp5)
[1] 14511.1
> Var(tmp5)
[1] 869.2597
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.69473 70.63656 71.20066 69.34100 66.62252 72.25033 70.04221 69.32902
[9] 72.13370 70.30403
> rowSums(tmp5)
[1] 1873.895 1412.731 1424.013 1386.820 1332.450 1445.007 1400.844 1386.580
[9] 1442.674 1406.081
> rowVars(tmp5)
[1] 7885.38631 107.65151 72.57710 32.33782 69.14561 85.18330
[7] 66.47467 67.29853 105.37269 65.57109
> rowSd(tmp5)
[1] 88.799698 10.375525 8.519220 5.686635 8.315384 9.229480 8.153200
[8] 8.203568 10.265120 8.097598
> rowMax(tmp5)
[1] 469.57354 92.45555 89.51957 84.41861 80.57282 85.55344 85.73029
[8] 83.63242 88.50946 82.60000
> rowMin(tmp5)
[1] 58.42010 53.39231 56.29567 61.45989 53.24151 56.69464 59.23322 53.97721
[9] 54.51026 56.73159
>
> colMeans(tmp5)
[1] 106.42547 67.25839 71.58681 67.21625 71.53904 68.98366 70.11973
[8] 74.20293 68.43651 72.75321 72.03054 67.87064 71.53643 70.66534
[15] 73.10693 72.08057 71.47593 72.84151 72.36953 68.61010
> colSums(tmp5)
[1] 1064.2547 672.5839 715.8681 672.1625 715.3904 689.8366 701.1973
[8] 742.0293 684.3651 727.5321 720.3054 678.7064 715.3643 706.6534
[15] 731.0693 720.8057 714.7593 728.4151 723.6953 686.1010
> colVars(tmp5)
[1] 16330.39702 63.02391 118.30472 54.35011 85.39104 56.02223
[7] 74.86803 138.90420 100.43727 13.49404 98.30060 47.95425
[13] 69.87390 76.02446 93.45945 87.52720 53.69118 68.09290
[19] 140.21785 18.47928
> colSd(tmp5)
[1] 127.790442 7.938760 10.876798 7.372252 9.240727 7.484800
[7] 8.652631 11.785762 10.021840 3.673423 9.914666 6.924901
[13] 8.359061 8.719200 9.667443 9.355597 7.327426 8.251843
[19] 11.841362 4.298754
> colMax(tmp5)
[1] 469.57354 75.99219 88.47777 81.48210 86.56268 81.72184 83.44362
[8] 92.45555 84.52985 76.36969 85.73029 80.76311 86.08658 82.36345
[15] 89.51957 87.69140 80.68386 82.86283 88.50946 76.94075
> colMin(tmp5)
[1] 56.29567 55.32155 53.24151 56.82706 57.23622 60.56953 53.97721 56.73159
[9] 53.39231 65.91100 55.45993 58.42010 56.69464 60.45689 61.44967 60.24752
[17] 59.77826 58.21796 54.88001 62.07489
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 93.69473 NA 71.20066 69.34100 66.62252 72.25033 70.04221 69.32902
[9] 72.13370 70.30403
> rowSums(tmp5)
[1] 1873.895 NA 1424.013 1386.820 1332.450 1445.007 1400.844 1386.580
[9] 1442.674 1406.081
> rowVars(tmp5)
[1] 7885.38631 105.11268 72.57710 32.33782 69.14561 85.18330
[7] 66.47467 67.29853 105.37269 65.57109
> rowSd(tmp5)
[1] 88.799698 10.252448 8.519220 5.686635 8.315384 9.229480 8.153200
[8] 8.203568 10.265120 8.097598
> rowMax(tmp5)
[1] 469.57354 NA 89.51957 84.41861 80.57282 85.55344 85.73029
[8] 83.63242 88.50946 82.60000
> rowMin(tmp5)
[1] 58.42010 NA 56.29567 61.45989 53.24151 56.69464 59.23322 53.97721
[9] 54.51026 56.73159
>
> colMeans(tmp5)
[1] 106.42547 67.25839 NA 67.21625 71.53904 68.98366 70.11973
[8] 74.20293 68.43651 72.75321 72.03054 67.87064 71.53643 70.66534
[15] 73.10693 72.08057 71.47593 72.84151 72.36953 68.61010
> colSums(tmp5)
[1] 1064.2547 672.5839 NA 672.1625 715.3904 689.8366 701.1973
[8] 742.0293 684.3651 727.5321 720.3054 678.7064 715.3643 706.6534
[15] 731.0693 720.8057 714.7593 728.4151 723.6953 686.1010
> colVars(tmp5)
[1] 16330.39702 63.02391 NA 54.35011 85.39104 56.02223
[7] 74.86803 138.90420 100.43727 13.49404 98.30060 47.95425
[13] 69.87390 76.02446 93.45945 87.52720 53.69118 68.09290
[19] 140.21785 18.47928
> colSd(tmp5)
[1] 127.790442 7.938760 NA 7.372252 9.240727 7.484800
[7] 8.652631 11.785762 10.021840 3.673423 9.914666 6.924901
[13] 8.359061 8.719200 9.667443 9.355597 7.327426 8.251843
[19] 11.841362 4.298754
> colMax(tmp5)
[1] 469.57354 75.99219 NA 81.48210 86.56268 81.72184 83.44362
[8] 92.45555 84.52985 76.36969 85.73029 80.76311 86.08658 82.36345
[15] 89.51957 87.69140 80.68386 82.86283 88.50946 76.94075
> colMin(tmp5)
[1] 56.29567 55.32155 NA 56.82706 57.23622 60.56953 53.97721 56.73159
[9] 53.39231 65.91100 55.45993 58.42010 56.69464 60.45689 61.44967 60.24752
[17] 59.77826 58.21796 54.88001 62.07489
>
> Max(tmp5,na.rm=TRUE)
[1] 469.5735
> Min(tmp5,na.rm=TRUE)
[1] 53.24151
> mean(tmp5,na.rm=TRUE)
[1] 72.50447
> Sum(tmp5,na.rm=TRUE)
[1] 14428.39
> Var(tmp5,na.rm=TRUE)
[1] 873.1269
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.69473 70.00130 71.20066 69.34100 66.62252 72.25033 70.04221 69.32902
[9] 72.13370 70.30403
> rowSums(tmp5,na.rm=TRUE)
[1] 1873.895 1330.025 1424.013 1386.820 1332.450 1445.007 1400.844 1386.580
[9] 1442.674 1406.081
> rowVars(tmp5,na.rm=TRUE)
[1] 7885.38631 105.11268 72.57710 32.33782 69.14561 85.18330
[7] 66.47467 67.29853 105.37269 65.57109
> rowSd(tmp5,na.rm=TRUE)
[1] 88.799698 10.252448 8.519220 5.686635 8.315384 9.229480 8.153200
[8] 8.203568 10.265120 8.097598
> rowMax(tmp5,na.rm=TRUE)
[1] 469.57354 92.45555 89.51957 84.41861 80.57282 85.55344 85.73029
[8] 83.63242 88.50946 82.60000
> rowMin(tmp5,na.rm=TRUE)
[1] 58.42010 53.39231 56.29567 61.45989 53.24151 56.69464 59.23322 53.97721
[9] 54.51026 56.73159
>
> colMeans(tmp5,na.rm=TRUE)
[1] 106.42547 67.25839 70.35129 67.21625 71.53904 68.98366 70.11973
[8] 74.20293 68.43651 72.75321 72.03054 67.87064 71.53643 70.66534
[15] 73.10693 72.08057 71.47593 72.84151 72.36953 68.61010
> colSums(tmp5,na.rm=TRUE)
[1] 1064.2547 672.5839 633.1616 672.1625 715.3904 689.8366 701.1973
[8] 742.0293 684.3651 727.5321 720.3054 678.7064 715.3643 706.6534
[15] 731.0693 720.8057 714.7593 728.4151 723.6953 686.1010
> colVars(tmp5,na.rm=TRUE)
[1] 16330.39702 63.02391 115.91960 54.35011 85.39104 56.02223
[7] 74.86803 138.90420 100.43727 13.49404 98.30060 47.95425
[13] 69.87390 76.02446 93.45945 87.52720 53.69118 68.09290
[19] 140.21785 18.47928
> colSd(tmp5,na.rm=TRUE)
[1] 127.790442 7.938760 10.766596 7.372252 9.240727 7.484800
[7] 8.652631 11.785762 10.021840 3.673423 9.914666 6.924901
[13] 8.359061 8.719200 9.667443 9.355597 7.327426 8.251843
[19] 11.841362 4.298754
> colMax(tmp5,na.rm=TRUE)
[1] 469.57354 75.99219 88.47777 81.48210 86.56268 81.72184 83.44362
[8] 92.45555 84.52985 76.36969 85.73029 80.76311 86.08658 82.36345
[15] 89.51957 87.69140 80.68386 82.86283 88.50946 76.94075
> colMin(tmp5,na.rm=TRUE)
[1] 56.29567 55.32155 53.24151 56.82706 57.23622 60.56953 53.97721 56.73159
[9] 53.39231 65.91100 55.45993 58.42010 56.69464 60.45689 61.44967 60.24752
[17] 59.77826 58.21796 54.88001 62.07489
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.69473 NaN 71.20066 69.34100 66.62252 72.25033 70.04221 69.32902
[9] 72.13370 70.30403
> rowSums(tmp5,na.rm=TRUE)
[1] 1873.895 0.000 1424.013 1386.820 1332.450 1445.007 1400.844 1386.580
[9] 1442.674 1406.081
> rowVars(tmp5,na.rm=TRUE)
[1] 7885.38631 NA 72.57710 32.33782 69.14561 85.18330
[7] 66.47467 67.29853 105.37269 65.57109
> rowSd(tmp5,na.rm=TRUE)
[1] 88.799698 NA 8.519220 5.686635 8.315384 9.229480 8.153200
[8] 8.203568 10.265120 8.097598
> rowMax(tmp5,na.rm=TRUE)
[1] 469.57354 NA 89.51957 84.41861 80.57282 85.55344 85.73029
[8] 83.63242 88.50946 82.60000
> rowMin(tmp5,na.rm=TRUE)
[1] 58.42010 NA 56.29567 61.45989 53.24151 56.69464 59.23322 53.97721
[9] 54.51026 56.73159
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.34907 68.58470 NaN 67.17243 71.63192 69.33850 69.69469
[8] 72.17486 70.10809 73.41968 72.29417 68.10586 69.91974 71.53163
[15] 73.56756 73.39536 71.33870 72.14196 70.80891 68.44464
> colSums(tmp5,na.rm=TRUE)
[1] 1002.1416 617.2623 0.0000 604.5518 644.6873 624.0465 627.2522
[8] 649.5738 630.9728 660.7771 650.6475 612.9527 629.2777 643.7846
[15] 662.1080 660.5582 642.0483 649.2777 637.2802 616.0018
> colVars(tmp5,na.rm=TRUE)
[1] 18098.97576 51.11187 NA 61.12227 95.96785 61.60852
[7] 82.19415 109.99527 81.55749 10.18371 109.80633 53.32609
[13] 49.20441 77.08495 102.75486 79.02071 60.19073 71.09912
[19] 130.34512 20.48122
> colSd(tmp5,na.rm=TRUE)
[1] 134.532434 7.149257 NA 7.818073 9.796318 7.849110
[7] 9.066099 10.487863 9.030918 3.191192 10.478851 7.302472
[13] 7.014586 8.779804 10.136807 8.889360 7.758269 8.432029
[19] 11.416879 4.525618
> colMax(tmp5,na.rm=TRUE)
[1] 469.57354 75.99219 -Inf 81.48210 86.56268 81.72184 83.44362
[8] 83.77541 84.52985 76.36969 85.73029 80.76311 82.58287 82.36345
[15] 89.51957 87.69140 80.68386 82.86283 88.50946 76.94075
> colMin(tmp5,na.rm=TRUE)
[1] 56.29567 55.61386 Inf 56.82706 57.23622 60.56953 53.97721 56.73159
[9] 54.51026 65.91100 55.45993 58.42010 56.69464 60.45689 61.44967 61.36905
[17] 59.77826 58.21796 54.88001 62.07489
>
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col <- 1
> cat(which.row," ",which.col,"\n")
3 1
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> rowVars(tmp5,na.rm=TRUE)
[1] 243.1002 319.0038 134.7096 119.7997 88.7220 309.1423 130.5921 267.3026
[9] 146.4220 242.6192
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 243.1002 319.0038 134.7096 119.7997 88.7220 309.1423 130.5921 267.3026
[9] 146.4220 242.6192
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -2.842171e-14 -1.136868e-13 -1.136868e-13 8.526513e-14 -7.105427e-14
[6] 4.263256e-14 2.842171e-14 -8.526513e-14 -7.105427e-14 -2.842171e-14
[11] 8.526513e-14 -5.684342e-14 2.273737e-13 -1.421085e-13 8.526513e-14
[16] 2.842171e-14 -2.273737e-13 -5.684342e-14 -5.684342e-14 9.947598e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 11
9 7
6 9
10 3
7 12
4 19
1 8
9 7
5 10
4 20
2 1
5 16
3 2
2 2
9 19
4 4
7 5
3 4
8 13
9 4
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.260882
> Min(tmp)
[1] -2.651792
> mean(tmp)
[1] -0.07867525
> Sum(tmp)
[1] -7.867525
> Var(tmp)
[1] 0.9985259
>
> rowMeans(tmp)
[1] -0.07867525
> rowSums(tmp)
[1] -7.867525
> rowVars(tmp)
[1] 0.9985259
> rowSd(tmp)
[1] 0.9992627
> rowMax(tmp)
[1] 2.260882
> rowMin(tmp)
[1] -2.651792
>
> colMeans(tmp)
[1] 1.155094475 -0.142289387 -0.053702762 1.299780576 -0.280604568
[6] 0.642478923 1.038362877 0.694518075 0.065601252 1.072584899
[11] 0.933879693 -1.780853922 -0.776525434 -1.390774618 -0.494362207
[16] -0.412666059 -0.400364024 -0.140554258 -1.511697516 0.401844913
[21] -0.550308444 0.474645914 2.260881519 -0.164930943 -0.329481642
[26] 0.980009037 0.580013541 0.051047307 -1.049448781 -1.889552120
[31] 0.706074893 -0.530048395 0.258945079 1.292245756 0.136785237
[36] 1.730319410 -0.758437549 -0.741488298 0.084272541 -0.397120114
[41] -0.103452244 0.094699420 0.231163276 -0.895696192 0.822093776
[46] -1.670162965 1.048647313 0.147340269 -1.154698137 1.312607909
[51] -2.301041718 -0.445617717 -2.067722241 0.193258923 0.581403099
[56] 0.936243059 -2.651792402 0.061694731 0.631898708 -0.698485202
[61] 1.270105491 0.337554474 -0.559183281 0.712986096 1.814245082
[66] -0.391177715 1.679149611 -0.166029659 0.696474576 1.361634315
[71] -0.919529739 -0.431989173 -0.478125619 -1.616096891 1.586277525
[76] -0.113108600 -1.926474778 0.508314788 -0.754862914 -1.617343655
[81] -0.368567814 -0.767333718 0.778644301 -0.009583018 0.741151360
[86] -1.792123611 -0.379666769 0.010981319 -0.599864367 -0.681554474
[91] 0.191428613 -0.258404606 -0.397683793 -0.005921476 0.026378180
[96] 1.447322491 -0.832363034 0.268614946 -1.834724263 -0.533632090
> colSums(tmp)
[1] 1.155094475 -0.142289387 -0.053702762 1.299780576 -0.280604568
[6] 0.642478923 1.038362877 0.694518075 0.065601252 1.072584899
[11] 0.933879693 -1.780853922 -0.776525434 -1.390774618 -0.494362207
[16] -0.412666059 -0.400364024 -0.140554258 -1.511697516 0.401844913
[21] -0.550308444 0.474645914 2.260881519 -0.164930943 -0.329481642
[26] 0.980009037 0.580013541 0.051047307 -1.049448781 -1.889552120
[31] 0.706074893 -0.530048395 0.258945079 1.292245756 0.136785237
[36] 1.730319410 -0.758437549 -0.741488298 0.084272541 -0.397120114
[41] -0.103452244 0.094699420 0.231163276 -0.895696192 0.822093776
[46] -1.670162965 1.048647313 0.147340269 -1.154698137 1.312607909
[51] -2.301041718 -0.445617717 -2.067722241 0.193258923 0.581403099
[56] 0.936243059 -2.651792402 0.061694731 0.631898708 -0.698485202
[61] 1.270105491 0.337554474 -0.559183281 0.712986096 1.814245082
[66] -0.391177715 1.679149611 -0.166029659 0.696474576 1.361634315
[71] -0.919529739 -0.431989173 -0.478125619 -1.616096891 1.586277525
[76] -0.113108600 -1.926474778 0.508314788 -0.754862914 -1.617343655
[81] -0.368567814 -0.767333718 0.778644301 -0.009583018 0.741151360
[86] -1.792123611 -0.379666769 0.010981319 -0.599864367 -0.681554474
[91] 0.191428613 -0.258404606 -0.397683793 -0.005921476 0.026378180
[96] 1.447322491 -0.832363034 0.268614946 -1.834724263 -0.533632090
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] 1.155094475 -0.142289387 -0.053702762 1.299780576 -0.280604568
[6] 0.642478923 1.038362877 0.694518075 0.065601252 1.072584899
[11] 0.933879693 -1.780853922 -0.776525434 -1.390774618 -0.494362207
[16] -0.412666059 -0.400364024 -0.140554258 -1.511697516 0.401844913
[21] -0.550308444 0.474645914 2.260881519 -0.164930943 -0.329481642
[26] 0.980009037 0.580013541 0.051047307 -1.049448781 -1.889552120
[31] 0.706074893 -0.530048395 0.258945079 1.292245756 0.136785237
[36] 1.730319410 -0.758437549 -0.741488298 0.084272541 -0.397120114
[41] -0.103452244 0.094699420 0.231163276 -0.895696192 0.822093776
[46] -1.670162965 1.048647313 0.147340269 -1.154698137 1.312607909
[51] -2.301041718 -0.445617717 -2.067722241 0.193258923 0.581403099
[56] 0.936243059 -2.651792402 0.061694731 0.631898708 -0.698485202
[61] 1.270105491 0.337554474 -0.559183281 0.712986096 1.814245082
[66] -0.391177715 1.679149611 -0.166029659 0.696474576 1.361634315
[71] -0.919529739 -0.431989173 -0.478125619 -1.616096891 1.586277525
[76] -0.113108600 -1.926474778 0.508314788 -0.754862914 -1.617343655
[81] -0.368567814 -0.767333718 0.778644301 -0.009583018 0.741151360
[86] -1.792123611 -0.379666769 0.010981319 -0.599864367 -0.681554474
[91] 0.191428613 -0.258404606 -0.397683793 -0.005921476 0.026378180
[96] 1.447322491 -0.832363034 0.268614946 -1.834724263 -0.533632090
> colMin(tmp)
[1] 1.155094475 -0.142289387 -0.053702762 1.299780576 -0.280604568
[6] 0.642478923 1.038362877 0.694518075 0.065601252 1.072584899
[11] 0.933879693 -1.780853922 -0.776525434 -1.390774618 -0.494362207
[16] -0.412666059 -0.400364024 -0.140554258 -1.511697516 0.401844913
[21] -0.550308444 0.474645914 2.260881519 -0.164930943 -0.329481642
[26] 0.980009037 0.580013541 0.051047307 -1.049448781 -1.889552120
[31] 0.706074893 -0.530048395 0.258945079 1.292245756 0.136785237
[36] 1.730319410 -0.758437549 -0.741488298 0.084272541 -0.397120114
[41] -0.103452244 0.094699420 0.231163276 -0.895696192 0.822093776
[46] -1.670162965 1.048647313 0.147340269 -1.154698137 1.312607909
[51] -2.301041718 -0.445617717 -2.067722241 0.193258923 0.581403099
[56] 0.936243059 -2.651792402 0.061694731 0.631898708 -0.698485202
[61] 1.270105491 0.337554474 -0.559183281 0.712986096 1.814245082
[66] -0.391177715 1.679149611 -0.166029659 0.696474576 1.361634315
[71] -0.919529739 -0.431989173 -0.478125619 -1.616096891 1.586277525
[76] -0.113108600 -1.926474778 0.508314788 -0.754862914 -1.617343655
[81] -0.368567814 -0.767333718 0.778644301 -0.009583018 0.741151360
[86] -1.792123611 -0.379666769 0.010981319 -0.599864367 -0.681554474
[91] 0.191428613 -0.258404606 -0.397683793 -0.005921476 0.026378180
[96] 1.447322491 -0.832363034 0.268614946 -1.834724263 -0.533632090
> colMedians(tmp)
[1] 1.155094475 -0.142289387 -0.053702762 1.299780576 -0.280604568
[6] 0.642478923 1.038362877 0.694518075 0.065601252 1.072584899
[11] 0.933879693 -1.780853922 -0.776525434 -1.390774618 -0.494362207
[16] -0.412666059 -0.400364024 -0.140554258 -1.511697516 0.401844913
[21] -0.550308444 0.474645914 2.260881519 -0.164930943 -0.329481642
[26] 0.980009037 0.580013541 0.051047307 -1.049448781 -1.889552120
[31] 0.706074893 -0.530048395 0.258945079 1.292245756 0.136785237
[36] 1.730319410 -0.758437549 -0.741488298 0.084272541 -0.397120114
[41] -0.103452244 0.094699420 0.231163276 -0.895696192 0.822093776
[46] -1.670162965 1.048647313 0.147340269 -1.154698137 1.312607909
[51] -2.301041718 -0.445617717 -2.067722241 0.193258923 0.581403099
[56] 0.936243059 -2.651792402 0.061694731 0.631898708 -0.698485202
[61] 1.270105491 0.337554474 -0.559183281 0.712986096 1.814245082
[66] -0.391177715 1.679149611 -0.166029659 0.696474576 1.361634315
[71] -0.919529739 -0.431989173 -0.478125619 -1.616096891 1.586277525
[76] -0.113108600 -1.926474778 0.508314788 -0.754862914 -1.617343655
[81] -0.368567814 -0.767333718 0.778644301 -0.009583018 0.741151360
[86] -1.792123611 -0.379666769 0.010981319 -0.599864367 -0.681554474
[91] 0.191428613 -0.258404606 -0.397683793 -0.005921476 0.026378180
[96] 1.447322491 -0.832363034 0.268614946 -1.834724263 -0.533632090
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.155094 -0.1422894 -0.05370276 1.299781 -0.2806046 0.6424789 1.038363
[2,] 1.155094 -0.1422894 -0.05370276 1.299781 -0.2806046 0.6424789 1.038363
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.6945181 0.06560125 1.072585 0.9338797 -1.780854 -0.7765254 -1.390775
[2,] 0.6945181 0.06560125 1.072585 0.9338797 -1.780854 -0.7765254 -1.390775
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.4943622 -0.4126661 -0.400364 -0.1405543 -1.511698 0.4018449 -0.5503084
[2,] -0.4943622 -0.4126661 -0.400364 -0.1405543 -1.511698 0.4018449 -0.5503084
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.4746459 2.260882 -0.1649309 -0.3294816 0.980009 0.5800135 0.05104731
[2,] 0.4746459 2.260882 -0.1649309 -0.3294816 0.980009 0.5800135 0.05104731
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.049449 -1.889552 0.7060749 -0.5300484 0.2589451 1.292246 0.1367852
[2,] -1.049449 -1.889552 0.7060749 -0.5300484 0.2589451 1.292246 0.1367852
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.730319 -0.7584375 -0.7414883 0.08427254 -0.3971201 -0.1034522 0.09469942
[2,] 1.730319 -0.7584375 -0.7414883 0.08427254 -0.3971201 -0.1034522 0.09469942
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.2311633 -0.8956962 0.8220938 -1.670163 1.048647 0.1473403 -1.154698
[2,] 0.2311633 -0.8956962 0.8220938 -1.670163 1.048647 0.1473403 -1.154698
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.312608 -2.301042 -0.4456177 -2.067722 0.1932589 0.5814031 0.9362431
[2,] 1.312608 -2.301042 -0.4456177 -2.067722 0.1932589 0.5814031 0.9362431
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -2.651792 0.06169473 0.6318987 -0.6984852 1.270105 0.3375545 -0.5591833
[2,] -2.651792 0.06169473 0.6318987 -0.6984852 1.270105 0.3375545 -0.5591833
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.7129861 1.814245 -0.3911777 1.67915 -0.1660297 0.6964746 1.361634
[2,] 0.7129861 1.814245 -0.3911777 1.67915 -0.1660297 0.6964746 1.361634
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.9195297 -0.4319892 -0.4781256 -1.616097 1.586278 -0.1131086 -1.926475
[2,] -0.9195297 -0.4319892 -0.4781256 -1.616097 1.586278 -0.1131086 -1.926475
[,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.5083148 -0.7548629 -1.617344 -0.3685678 -0.7673337 0.7786443
[2,] 0.5083148 -0.7548629 -1.617344 -0.3685678 -0.7673337 0.7786443
[,84] [,85] [,86] [,87] [,88] [,89]
[1,] -0.009583018 0.7411514 -1.792124 -0.3796668 0.01098132 -0.5998644
[2,] -0.009583018 0.7411514 -1.792124 -0.3796668 0.01098132 -0.5998644
[,90] [,91] [,92] [,93] [,94] [,95]
[1,] -0.6815545 0.1914286 -0.2584046 -0.3976838 -0.005921476 0.02637818
[2,] -0.6815545 0.1914286 -0.2584046 -0.3976838 -0.005921476 0.02637818
[,96] [,97] [,98] [,99] [,100]
[1,] 1.447322 -0.832363 0.2686149 -1.834724 -0.5336321
[2,] 1.447322 -0.832363 0.2686149 -1.834724 -0.5336321
>
>
> Max(tmp2)
[1] 2.571405
> Min(tmp2)
[1] -2.737896
> mean(tmp2)
[1] 0.07475466
> Sum(tmp2)
[1] 7.475466
> Var(tmp2)
[1] 0.9450352
>
> rowMeans(tmp2)
[1] 0.097226544 2.571405428 1.405857176 0.472097475 -1.183998216
[6] -0.440952599 -1.049749230 1.522583679 -0.868687336 0.713237328
[11] 0.878521450 -1.238163266 0.632044369 1.523943943 -0.212831361
[16] 0.211502167 0.731340091 -0.385126896 -0.944779524 -1.706673320
[21] 1.328210863 0.079844240 0.364375749 -0.596589447 -1.267410640
[26] -0.846695888 0.466831991 -0.218547115 0.285588470 0.308050078
[31] -0.347264604 -0.050239717 -0.708653994 -1.734161517 2.083594248
[36] 0.491931364 0.257716211 -0.164334983 0.065023498 0.515039466
[41] 0.414901051 0.036172093 0.856781590 -1.022658832 1.086381815
[46] -2.117914503 0.004068901 -0.490867165 -0.325565446 -0.590291318
[51] -0.478384855 0.219211292 0.409229350 0.197214396 -0.517790212
[56] 1.299075011 0.403232490 -0.512884332 0.635215333 0.597027788
[61] -0.448771587 -0.625280513 -0.186055203 -0.239248422 1.521882427
[66] -0.935960532 -2.737896034 0.276236851 -0.874436695 0.680931132
[71] -0.639134670 1.383135818 2.349805060 0.191505576 -0.098296778
[76] -0.637856799 1.284358110 -0.390527007 0.495773932 -0.836259899
[81] -0.134348049 -0.526704028 -1.754284837 1.076581623 1.597106451
[86] -0.185713966 -0.094681699 -0.661198891 0.688067515 -0.478075237
[91] 1.551003527 -1.145263675 0.393783681 1.261582984 1.255702802
[96] 1.138637358 -0.131288061 1.670779154 0.125707579 -0.849093872
> rowSums(tmp2)
[1] 0.097226544 2.571405428 1.405857176 0.472097475 -1.183998216
[6] -0.440952599 -1.049749230 1.522583679 -0.868687336 0.713237328
[11] 0.878521450 -1.238163266 0.632044369 1.523943943 -0.212831361
[16] 0.211502167 0.731340091 -0.385126896 -0.944779524 -1.706673320
[21] 1.328210863 0.079844240 0.364375749 -0.596589447 -1.267410640
[26] -0.846695888 0.466831991 -0.218547115 0.285588470 0.308050078
[31] -0.347264604 -0.050239717 -0.708653994 -1.734161517 2.083594248
[36] 0.491931364 0.257716211 -0.164334983 0.065023498 0.515039466
[41] 0.414901051 0.036172093 0.856781590 -1.022658832 1.086381815
[46] -2.117914503 0.004068901 -0.490867165 -0.325565446 -0.590291318
[51] -0.478384855 0.219211292 0.409229350 0.197214396 -0.517790212
[56] 1.299075011 0.403232490 -0.512884332 0.635215333 0.597027788
[61] -0.448771587 -0.625280513 -0.186055203 -0.239248422 1.521882427
[66] -0.935960532 -2.737896034 0.276236851 -0.874436695 0.680931132
[71] -0.639134670 1.383135818 2.349805060 0.191505576 -0.098296778
[76] -0.637856799 1.284358110 -0.390527007 0.495773932 -0.836259899
[81] -0.134348049 -0.526704028 -1.754284837 1.076581623 1.597106451
[86] -0.185713966 -0.094681699 -0.661198891 0.688067515 -0.478075237
[91] 1.551003527 -1.145263675 0.393783681 1.261582984 1.255702802
[96] 1.138637358 -0.131288061 1.670779154 0.125707579 -0.849093872
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] 0.097226544 2.571405428 1.405857176 0.472097475 -1.183998216
[6] -0.440952599 -1.049749230 1.522583679 -0.868687336 0.713237328
[11] 0.878521450 -1.238163266 0.632044369 1.523943943 -0.212831361
[16] 0.211502167 0.731340091 -0.385126896 -0.944779524 -1.706673320
[21] 1.328210863 0.079844240 0.364375749 -0.596589447 -1.267410640
[26] -0.846695888 0.466831991 -0.218547115 0.285588470 0.308050078
[31] -0.347264604 -0.050239717 -0.708653994 -1.734161517 2.083594248
[36] 0.491931364 0.257716211 -0.164334983 0.065023498 0.515039466
[41] 0.414901051 0.036172093 0.856781590 -1.022658832 1.086381815
[46] -2.117914503 0.004068901 -0.490867165 -0.325565446 -0.590291318
[51] -0.478384855 0.219211292 0.409229350 0.197214396 -0.517790212
[56] 1.299075011 0.403232490 -0.512884332 0.635215333 0.597027788
[61] -0.448771587 -0.625280513 -0.186055203 -0.239248422 1.521882427
[66] -0.935960532 -2.737896034 0.276236851 -0.874436695 0.680931132
[71] -0.639134670 1.383135818 2.349805060 0.191505576 -0.098296778
[76] -0.637856799 1.284358110 -0.390527007 0.495773932 -0.836259899
[81] -0.134348049 -0.526704028 -1.754284837 1.076581623 1.597106451
[86] -0.185713966 -0.094681699 -0.661198891 0.688067515 -0.478075237
[91] 1.551003527 -1.145263675 0.393783681 1.261582984 1.255702802
[96] 1.138637358 -0.131288061 1.670779154 0.125707579 -0.849093872
> rowMin(tmp2)
[1] 0.097226544 2.571405428 1.405857176 0.472097475 -1.183998216
[6] -0.440952599 -1.049749230 1.522583679 -0.868687336 0.713237328
[11] 0.878521450 -1.238163266 0.632044369 1.523943943 -0.212831361
[16] 0.211502167 0.731340091 -0.385126896 -0.944779524 -1.706673320
[21] 1.328210863 0.079844240 0.364375749 -0.596589447 -1.267410640
[26] -0.846695888 0.466831991 -0.218547115 0.285588470 0.308050078
[31] -0.347264604 -0.050239717 -0.708653994 -1.734161517 2.083594248
[36] 0.491931364 0.257716211 -0.164334983 0.065023498 0.515039466
[41] 0.414901051 0.036172093 0.856781590 -1.022658832 1.086381815
[46] -2.117914503 0.004068901 -0.490867165 -0.325565446 -0.590291318
[51] -0.478384855 0.219211292 0.409229350 0.197214396 -0.517790212
[56] 1.299075011 0.403232490 -0.512884332 0.635215333 0.597027788
[61] -0.448771587 -0.625280513 -0.186055203 -0.239248422 1.521882427
[66] -0.935960532 -2.737896034 0.276236851 -0.874436695 0.680931132
[71] -0.639134670 1.383135818 2.349805060 0.191505576 -0.098296778
[76] -0.637856799 1.284358110 -0.390527007 0.495773932 -0.836259899
[81] -0.134348049 -0.526704028 -1.754284837 1.076581623 1.597106451
[86] -0.185713966 -0.094681699 -0.661198891 0.688067515 -0.478075237
[91] 1.551003527 -1.145263675 0.393783681 1.261582984 1.255702802
[96] 1.138637358 -0.131288061 1.670779154 0.125707579 -0.849093872
>
> colMeans(tmp2)
[1] 0.07475466
> colSums(tmp2)
[1] 7.475466
> colVars(tmp2)
[1] 0.9450352
> colSd(tmp2)
[1] 0.9721292
> colMax(tmp2)
[1] 2.571405
> colMin(tmp2)
[1] -2.737896
> colMedians(tmp2)
[1] 0.0505978
> colRanges(tmp2)
[,1]
[1,] -2.737896
[2,] 2.571405
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.9384564 -2.4571063 -1.0021530 4.8506045 2.2688687 4.8913050
[7] 0.7831273 -0.6589322 -0.7416719 1.2420553
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2705240
[2,] -0.5411216
[3,] -0.2285464
[4,] 0.6002179
[5,] 2.9191736
>
> rowApply(tmp,sum)
[1] -2.4330327 0.1798979 0.9288404 3.7485796 0.8013178 2.1264553
[7] 3.4391250 -6.6741156 0.3129727 7.6845135
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 3 10 2 8 5 5 4 9 1
[2,] 1 7 5 8 6 3 7 6 1 2
[3,] 4 4 6 10 3 2 2 3 8 4
[4,] 10 10 7 1 1 9 6 9 5 7
[5,] 7 9 1 4 5 8 9 8 4 5
[6,] 8 6 3 3 10 10 8 2 3 9
[7,] 9 8 2 7 2 6 10 1 7 6
[8,] 5 5 9 9 9 4 1 7 2 3
[9,] 2 1 8 5 7 7 3 5 10 8
[10,] 6 2 4 6 4 1 4 10 6 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -4.16150704 -0.38783193 -1.31192488 -1.20193388 0.07283615 -0.95857061
[7] 4.20802673 1.95772593 -3.60962489 -0.70328372 -3.00925607 -1.24387174
[13] 2.58824377 3.44541419 -5.06452376 -3.50525020 0.31766465 -1.07647033
[19] -0.15572787 4.55568617
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.2218187
[2,] -0.9374888
[3,] -0.7314492
[4,] -0.6000537
[5,] 0.3293033
>
> rowApply(tmp,sum)
[1] -5.1744736 -1.1265433 0.9236607 -8.2466265 4.3798034
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 14 2 2 6 4
[2,] 8 11 3 20 12
[3,] 6 12 12 11 6
[4,] 5 20 7 2 5
[5,] 16 13 9 8 9
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.3293033 -0.50874100 -0.9160726 -1.0399904 0.544424505 -0.1908672
[2,] -2.2218187 0.01492332 0.1940741 2.1186941 0.201465637 -1.2366941
[3,] -0.9374888 -0.74400280 0.1568427 -0.2334676 -0.101766457 -1.3302347
[4,] -0.7314492 0.79541511 -0.4797629 -1.7622061 -0.580432729 0.7841755
[5,] -0.6000537 0.05457344 -0.2670061 -0.2849639 0.009145193 1.0150499
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.4105966 -0.44265376 -2.2431168 0.1066654 -2.1754154 -0.12293633
[2,] 1.7904559 1.10486069 -0.2403008 -1.0620244 -0.5425301 -0.64452493
[3,] 0.8104813 -0.13568970 0.3523502 0.3108353 -0.2394765 0.57806222
[4,] -0.6467421 0.03992827 -0.4942281 -1.4310857 0.1711720 -1.09882408
[5,] 0.8432351 1.39128042 -0.9843295 1.3723256 -0.2230061 0.04435139
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.59639302 -0.1521728 -0.6356498 -1.95364371 0.83302768 -1.1752992
[2,] 2.07441400 0.8635345 -1.1477550 -2.37342429 0.45082781 -1.5995126
[3,] -0.45845408 0.7605611 -0.5371336 0.58440204 -0.04708246 1.6648187
[4,] 0.35206440 0.4704363 -1.2129022 0.25627212 0.25718016 -0.5239041
[5,] 0.02382643 1.5030550 -1.5310831 -0.01885635 -1.17628854 0.5574269
[,19] [,20]
[1,] 0.33790959 2.2237652
[2,] 1.34468452 -0.2158930
[3,] -0.06496135 0.5350653
[4,] -2.10317488 -0.3085583
[5,] 0.32981425 2.3213070
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.020308 -1.230785 1.064716 -0.4532034 0.5587288 -1.410371 0.2505447
col8 col9 col10 col11 col12 col13 col14
row1 -0.4141437 -0.4843652 -3.185163 -1.102863 -0.898475 0.1748548 -1.07089
col15 col16 col17 col18 col19 col20
row1 0.2575734 0.2473895 -1.422482 -0.5541838 -0.8817644 -1.833933
> tmp[,"col10"]
col10
row1 -3.18516265
row2 0.33307356
row3 -0.06951501
row4 3.12793514
row5 -1.74820811
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.020308 -1.2307845 1.064716 -0.4532034 0.5587288 -1.410371 0.25054467
row5 1.286014 -0.5636349 -1.074860 0.8087938 0.5798894 2.258013 0.09078278
col8 col9 col10 col11 col12 col13 col14
row1 -0.4141437 -0.4843652 -3.185163 -1.102863 -0.8984750 0.1748548 -1.070890
row5 -0.6077462 -0.3346169 -1.748208 1.157392 0.6837553 0.8046291 1.268201
col15 col16 col17 col18 col19 col20
row1 0.2575734 0.24738948 -1.4224824 -0.5541838 -0.8817644 -1.833933
row5 -0.4444500 0.09154792 -0.8386311 -0.8699076 -0.8613920 -1.401650
> tmp[,c("col6","col20")]
col6 col20
row1 -1.4103711 -1.8339328
row2 -0.8212756 1.3968862
row3 -1.2029578 0.5822585
row4 0.0627726 -0.8925972
row5 2.2580133 -1.4016501
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.410371 -1.833933
row5 2.258013 -1.401650
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.18778 50.53398 48.74564 50.71047 51.37719 105.9132 49.76309 50.77707
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.66582 49.89496 50.43681 49.95029 52.40587 49.26223 50.73239 49.72996
col17 col18 col19 col20
row1 50.31412 49.54632 50.06123 104.4994
> tmp[,"col10"]
col10
row1 49.89496
row2 28.49312
row3 29.61141
row4 31.28303
row5 49.69142
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.18778 50.53398 48.74564 50.71047 51.37719 105.9132 49.76309 50.77707
row5 50.55307 49.78095 50.82265 49.27827 49.50900 103.9064 49.49914 50.47132
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.66582 49.89496 50.43681 49.95029 52.40587 49.26223 50.73239 49.72996
row5 47.79397 49.69142 49.21158 49.91565 49.03869 49.82264 50.46881 50.62570
col17 col18 col19 col20
row1 50.31412 49.54632 50.06123 104.4994
row5 49.83587 49.48283 50.13756 104.3020
> tmp[,c("col6","col20")]
col6 col20
row1 105.91321 104.49945
row2 74.49662 75.73955
row3 75.27015 75.72592
row4 74.62677 73.31378
row5 103.90644 104.30197
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.9132 104.4994
row5 103.9064 104.3020
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.9132 104.4994
row5 103.9064 104.3020
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.6782375
[2,] 0.2876505
[3,] -0.4179132
[4,] 0.8035204
[5,] 0.6561503
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.46715669 0.6909691
[2,] -1.11497300 1.2700046
[3,] -0.03633910 -0.9979111
[4,] -1.11217693 -0.1258670
[5,] -0.09792117 -0.2178144
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.6801876 -0.3850136
[2,] 0.6477257 -1.2341890
[3,] -1.3639447 0.2144883
[4,] -0.2137176 1.2122360
[5,] 0.4218961 -1.4143169
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.6801876
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.6801876
[2,] 0.6477257
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 0.2510642 -1.1650437 -0.6194735 0.4599019 -0.4303795 0.2115256
row1 -1.1561174 0.7793623 -2.0770840 0.4257995 -0.8965178 0.9505101
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.60187782 1.4275432 2.0715406 -0.23495664 -0.3913157 -1.038841
row1 -0.07007768 -0.9700921 0.1108444 0.03924477 1.0623344 -1.836262
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 1.2107626 0.2215306 1.2142104 -0.8910046 0.7333159 -0.02601116 0.6988431
row1 -0.1849684 1.3224036 -0.3230357 0.0533856 0.7585117 -2.15960650 0.4611253
[,20]
row3 0.1504575
row1 1.1467521
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.4656389 -1.560907 0.5343559 -1.216584 0.8104728 0.6663979 0.4803029
[,8] [,9] [,10]
row2 0.07827835 0.8381522 -0.5710235
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.4155865 0.2848419 0.5205057 0.7249222 0.7307127 -0.5765371 -2.001302
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -1.036557 -0.9531039 0.5444311 1.378916 1.060277 -1.131785 1.107404
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.5498876 0.4924302 1.896951 -0.2581271 0.7480144 -0.9517109
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> colnames(tmp) <- NULL
> rownames(tmp) <- NULL
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
> dimnames(tmp) <- NULL
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
> dimnames(tmp) <- NULL
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
NULL
>
> dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE)))
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
>
> ###
> ### Testing logical indexing
> ###
> ###
>
> tmp <- createBufferedMatrix(230,15)
> tmp[1:230,1:15] <- rnorm(230*15)
> x <-tmp[1:230,1:15]
>
> for (rep in 1:10){
+ which.cols <- sample(c(TRUE,FALSE),15,replace=T)
+ which.rows <- sample(c(TRUE,FALSE),230,replace=T)
+
+ if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){
+ stop("No agreement when logical indexing\n")
+ }
+
+ if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] == x[,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix cols\n")
+ }
+ if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] == x[which.rows,])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows\n")
+ }
+
+
+ if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]== x[which.rows,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n")
+ }
+ }
>
>
> ##
> ## Test the ReadOnlyMode
> ##
>
> ReadOnlyMode(tmp)
<pointer: 0x615f2ba42a50>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d9652d87d5"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d93e5e7453"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d967124e6f"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d932edab9f"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d913773fae"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d953de1f50"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d967b93cd3"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d956f4b1c1"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d925cce2f1"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d96ee49b3c"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d9183e5cd9"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d95d66e485"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d9b05a0f"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d95c2db1c3"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2497d96cb2e4ef"
>
>
> ### testing coercion functions
> ###
>
> tmp <- as(tmp,"matrix")
> tmp <- as(tmp,"BufferedMatrix")
>
>
>
> ### testing whether can move storage from one location to another
>
> MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE)
<pointer: 0x615f2bdac3b0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x615f2bdac3b0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x615f2bdac3b0>
> rowMedians(tmp)
[1] 0.2083837416 0.0173926089 -0.1378463596 0.1491740084 -0.3591330771
[6] -0.1064827506 0.2869005219 -0.1934911551 -0.5223459272 -0.0411159417
[11] -0.6743691683 0.3671163762 0.5129520703 0.0203345227 0.1110405378
[16] -0.3869651376 -0.0770672125 0.0389797730 0.1404774447 0.2939932678
[21] -0.1468900423 -0.0557788124 -0.0223674639 -0.1534116628 0.3853195350
[26] -0.2876867602 0.1161096031 0.1451798912 -0.0268252095 -0.0816524368
[31] -0.1678213974 0.2196343740 -0.2830271409 0.3129109641 -0.0199061504
[36] -0.4263266374 -0.3063479544 -0.0046473313 0.0346230164 -0.1167302898
[41] 0.1099388548 0.0900493671 -0.1720396783 0.0933301330 0.4676590684
[46] -0.2767703587 0.1264116812 0.2281211485 0.6720393934 -0.0439392530
[51] 0.4997871463 0.0597971710 0.4801128495 0.4490628374 -0.0657898995
[56] 0.0456508936 0.2978634937 0.4134191094 0.5231875291 -0.1068494655
[61] -0.1287598609 -0.0969963845 -0.2111448883 0.8798803144 0.1436777285
[66] 0.5924526273 0.1100053223 0.4618147915 0.2487021357 -0.0243393401
[71] -0.2261310193 0.0240422416 -0.3676503209 0.0718611378 0.2568722120
[76] 0.0078151784 0.1301433674 0.3987585296 -0.0395877627 -0.6677388719
[81] 0.4515246986 -0.6000013775 0.3478204865 -0.3105042030 0.0912463924
[86] -0.2016280257 0.1945954548 0.1387435342 -0.4852201276 -0.3754945569
[91] -0.1720868999 0.3355951366 -0.1263755697 0.2272063423 0.0257242310
[96] -0.6046472375 0.4067223979 0.1996206719 -0.1341948096 0.3006558481
[101] -0.0196774396 -0.1578472610 -0.2783828431 0.2640807632 0.5449263309
[106] -0.4231252416 -0.1948407301 -0.2876173573 0.1483678439 -0.3250602625
[111] -0.0093654569 0.0002284598 -0.1897829895 1.1073160142 -0.4375977790
[116] 0.1737051188 -0.0900542337 0.8069408581 0.2500851421 0.2683788955
[121] 0.2755526620 -0.3210221630 0.7122453730 0.1060325332 -0.1561635005
[126] -0.0297032608 0.0374329937 0.1904561349 -0.3680446972 0.4149452197
[131] 0.0885399720 0.1044526705 0.2869019473 0.4787461104 0.3744454420
[136] -0.1233332971 0.0414494507 -0.2238854911 0.7347670725 0.1614626347
[141] -0.1004177937 0.1422787032 -0.3343775918 -0.2169926623 0.1565470496
[146] -0.7505726695 0.0417681437 -0.3755707479 0.2393697721 0.0085351177
[151] 0.1723678026 0.1254559822 -0.1538840084 0.0027579449 0.1410623944
[156] 0.1973969544 -0.1805346182 0.1330357536 -0.2969391621 0.2842787630
[161] -0.0795409983 0.2940418227 -0.0742711125 0.1968288258 -0.0614695386
[166] 0.2850314924 -0.1654967344 -0.1203635007 -0.0022363340 0.1098697949
[171] -0.5864856218 0.3851557179 -0.3451630561 0.5723034568 -0.5095273437
[176] 0.0766901644 0.0594545815 0.6652840154 -0.1540502290 -0.5282548744
[181] -0.0111941383 0.1907408752 0.0321808449 -0.0328254683 -0.1154927025
[186] 0.1561414806 0.0609566925 -0.2599478643 0.5964723488 -0.2010171534
[191] 0.0177067329 0.4695413354 0.0924768239 -0.0577249984 0.8037068221
[196] -0.4613773052 -0.3519543041 -0.1934367025 -0.2671686234 0.3777041489
[201] -0.0735490007 0.1008140460 -0.6454346758 -0.3788182377 0.0154006748
[206] 0.2273031764 -0.2645958443 0.3853324825 -0.2557463575 0.3512060089
[211] 0.1712245362 0.2551527299 -0.2354374658 -0.3116736481 -0.2009166179
[216] -0.0172706699 -0.1928843320 0.6689882750 0.1302677725 0.1463690013
[221] -0.1796570483 0.3727967190 -0.5173773545 0.2383388615 0.4102892866
[226] 0.2807558692 0.1263081902 0.2992298320 0.3243247141 -0.1824913307
>
> proc.time()
user system elapsed
1.295 1.466 2.748
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x64d9ad83fb20>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x64d9ad83fb20>
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x64d9ad83fb20>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000
<pointer: 0x64d9ad83fb20>
> rm(P)
>
> #P <- .Call("R_bm_Destroy",P)
> #.Call("R_bm_Destroy",P)
> #.Call("R_bm_Test_C",P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 0
Buffer Rows: 1
Buffer Cols: 1
Printing Values
<pointer: 0x64d9ad820410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ad820410>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 1
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000
0.000000
0.000000
0.000000
0.000000
<pointer: 0x64d9ad820410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ad820410>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x64d9ad820410>
> rm(P)
>
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ac0cd7a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ac0cd7a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x64d9ac0cd7a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x64d9ac0cd7a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x64d9ac0cd7a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x64d9ac0cd7a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x64d9ac0cd7a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x64d9ac0cd7a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x64d9ac0cd7a0>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ad09f680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x64d9ad09f680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ad09f680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ad09f680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2498ee2af190e3" "BufferedMatrixFile2498ee59938ec1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2498ee2af190e3" "BufferedMatrixFile2498ee59938ec1"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ace33490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ace33490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x64d9ace33490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x64d9ace33490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x64d9ace33490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x64d9ace33490>
> .Call("R_bm_isRowMode",P)
[1] FALSE
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ae48f110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64d9ae48f110>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x64d9ae48f110>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x64d9ae48f110>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x64d9ae5325e0>
> .Call("R_bm_getValue",P,3,3)
[1] 6
>
> .Call("R_bm_getValue",P,100000,10000)
[1] NA
> .Call("R_bm_setValue",P,3,3,12345.0)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 12345.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x64d9ae5325e0>
> rm(P)
>
> proc.time()
user system elapsed
0.261 0.059 0.306
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.246 0.051 0.284