| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-27 12:01 -0500 (Thu, 27 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4876 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4656 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4602 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4668 |
| 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 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | 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.74.0 |
| Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz |
| StartedAt: 2025-11-25 22:09:07 -0500 (Tue, 25 Nov 2025) |
| EndedAt: 2025-11-25 22:09:31 -0500 (Tue, 25 Nov 2025) |
| EllapsedTime: 24.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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 version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.246 0.039 0.274
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.22-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 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 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] "Tue Nov 25 22:09:22 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] "Tue Nov 25 22:09:22 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: 0x5f7979422240>
>
>
>
> 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] "Tue Nov 25 22:09:22 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] "Tue Nov 25 22:09:23 2025"
>
> ColMode(tmp2)
<pointer: 0x5f7979422240>
>
>
>
> ### 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.4109444 0.5464873 -4.39094412 1.3782102
[2,] -0.3510032 0.1655421 2.15429452 -0.4915553
[3,] -1.3444168 -1.1948393 -0.52494019 0.4947817
[4,] 0.3307066 -0.6714045 -0.00409506 0.6768994
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.4109444 0.5464873 4.39094412 1.3782102
[2,] 0.3510032 0.1655421 2.15429452 0.4915553
[3,] 1.3444168 1.1948393 0.52494019 0.4947817
[4,] 0.3307066 0.6714045 0.00409506 0.6768994
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0205262 0.7392478 2.09545797 1.1739720
[2,] 0.5924552 0.4068686 1.46775152 0.7011100
[3,] 1.1594899 1.0930871 0.72452756 0.7034072
[4,] 0.5750710 0.8193928 0.06399266 0.8227390
>
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.61621 32.93896 50.34552 38.11793
[2,] 31.27556 29.23423 41.83181 32.50266
[3,] 37.93932 37.12571 32.77022 32.52885
[4,] 31.08142 33.86533 25.64402 33.90429
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f797a028930>
> exp(tmp5)
<pointer: 0x5f797a028930>
> log(tmp5,2)
<pointer: 0x5f797a028930>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.5906
> Min(tmp5)
[1] 52.9664
> mean(tmp5)
[1] 72.91355
> Sum(tmp5)
[1] 14582.71
> Var(tmp5)
[1] 875.0016
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.56788 68.63514 72.51843 70.52194 73.16043 70.31905 71.24852 68.17130
[9] 72.80437 71.18846
> rowSums(tmp5)
[1] 1811.358 1372.703 1450.369 1410.439 1463.209 1406.381 1424.970 1363.426
[9] 1456.087 1423.769
> rowVars(tmp5)
[1] 8069.23873 110.75494 57.84860 107.16590 125.98770 53.78873
[7] 78.66133 57.80176 65.66593 47.15804
> rowSd(tmp5)
[1] 89.828941 10.524017 7.605827 10.352096 11.224424 7.334080 8.869122
[8] 7.602747 8.103452 6.867171
> rowMax(tmp5)
[1] 469.59057 89.04288 82.81692 93.87985 96.75716 83.63529 86.34275
[8] 85.26417 86.18028 84.03227
> rowMin(tmp5)
[1] 52.96640 54.87542 55.27545 53.37467 55.17639 53.81816 59.74663 54.89636
[9] 60.88525 58.66142
>
> colMeans(tmp5)
[1] 108.99821 71.17242 72.38310 71.81789 72.21238 71.22540 70.65636
[8] 77.05419 68.18756 71.44177 70.88696 76.45972 71.47542 70.31586
[15] 71.65990 70.10580 68.12871 66.74517 67.27622 70.06801
> colSums(tmp5)
[1] 1089.9821 711.7242 723.8310 718.1789 722.1238 712.2540 706.5636
[8] 770.5419 681.8756 714.4177 708.8696 764.5972 714.7542 703.1586
[15] 716.5990 701.0580 681.2871 667.4517 672.7622 700.6801
> colVars(tmp5)
[1] 16077.46524 65.63844 214.19714 59.27882 75.32604 52.36134
[7] 38.23494 167.29312 98.18896 71.30937 45.71353 114.34835
[13] 89.42981 61.79565 68.71740 95.40401 54.79833 122.25181
[19] 52.69405 64.50827
> colSd(tmp5)
[1] 126.796945 8.101755 14.635475 7.699274 8.679058 7.236114
[7] 6.183440 12.934184 9.909034 8.444488 6.761178 10.693379
[13] 9.456733 7.861021 8.289596 9.767497 7.402590 11.056754
[19] 7.259067 8.031704
> colMax(tmp5)
[1] 469.59057 83.63529 104.78761 81.05685 86.18028 80.82026 80.56786
[8] 96.75716 84.03227 89.49132 81.78850 93.87985 86.34275 79.20833
[15] 81.43722 89.04288 77.26477 83.24154 79.56071 87.52101
> colMin(tmp5)
[1] 62.07310 59.74663 53.37467 55.17639 59.95985 57.67125 62.45530 52.96640
[9] 55.27545 60.88525 59.96018 65.39970 58.13422 55.91180 57.74171 55.18718
[17] 58.59834 53.81816 54.89636 58.66142
>
>
> ### 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] 90.56788 68.63514 72.51843 70.52194 73.16043 70.31905 NA 68.17130
[9] 72.80437 71.18846
> rowSums(tmp5)
[1] 1811.358 1372.703 1450.369 1410.439 1463.209 1406.381 NA 1363.426
[9] 1456.087 1423.769
> rowVars(tmp5)
[1] 8069.23873 110.75494 57.84860 107.16590 125.98770 53.78873
[7] 81.10310 57.80176 65.66593 47.15804
> rowSd(tmp5)
[1] 89.828941 10.524017 7.605827 10.352096 11.224424 7.334080 9.005726
[8] 7.602747 8.103452 6.867171
> rowMax(tmp5)
[1] 469.59057 89.04288 82.81692 93.87985 96.75716 83.63529 NA
[8] 85.26417 86.18028 84.03227
> rowMin(tmp5)
[1] 52.96640 54.87542 55.27545 53.37467 55.17639 53.81816 NA 54.89636
[9] 60.88525 58.66142
>
> colMeans(tmp5)
[1] NA 71.17242 72.38310 71.81789 72.21238 71.22540 70.65636 77.05419
[9] 68.18756 71.44177 70.88696 76.45972 71.47542 70.31586 71.65990 70.10580
[17] 68.12871 66.74517 67.27622 70.06801
> colSums(tmp5)
[1] NA 711.7242 723.8310 718.1789 722.1238 712.2540 706.5636 770.5419
[9] 681.8756 714.4177 708.8696 764.5972 714.7542 703.1586 716.5990 701.0580
[17] 681.2871 667.4517 672.7622 700.6801
> colVars(tmp5)
[1] NA 65.63844 214.19714 59.27882 75.32604 52.36134 38.23494
[8] 167.29312 98.18896 71.30937 45.71353 114.34835 89.42981 61.79565
[15] 68.71740 95.40401 54.79833 122.25181 52.69405 64.50827
> colSd(tmp5)
[1] NA 8.101755 14.635475 7.699274 8.679058 7.236114 6.183440
[8] 12.934184 9.909034 8.444488 6.761178 10.693379 9.456733 7.861021
[15] 8.289596 9.767497 7.402590 11.056754 7.259067 8.031704
> colMax(tmp5)
[1] NA 83.63529 104.78761 81.05685 86.18028 80.82026 80.56786
[8] 96.75716 84.03227 89.49132 81.78850 93.87985 86.34275 79.20833
[15] 81.43722 89.04288 77.26477 83.24154 79.56071 87.52101
> colMin(tmp5)
[1] NA 59.74663 53.37467 55.17639 59.95985 57.67125 62.45530 52.96640
[9] 55.27545 60.88525 59.96018 65.39970 58.13422 55.91180 57.74171 55.18718
[17] 58.59834 53.81816 54.89636 58.66142
>
> Max(tmp5,na.rm=TRUE)
[1] 469.5906
> Min(tmp5,na.rm=TRUE)
[1] 52.9664
> mean(tmp5,na.rm=TRUE)
[1] 72.95077
> Sum(tmp5,na.rm=TRUE)
[1] 14517.2
> Var(tmp5,na.rm=TRUE)
[1] 879.1423
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.56788 68.63514 72.51843 70.52194 73.16043 70.31905 71.55075 68.17130
[9] 72.80437 71.18846
> rowSums(tmp5,na.rm=TRUE)
[1] 1811.358 1372.703 1450.369 1410.439 1463.209 1406.381 1359.464 1363.426
[9] 1456.087 1423.769
> rowVars(tmp5,na.rm=TRUE)
[1] 8069.23873 110.75494 57.84860 107.16590 125.98770 53.78873
[7] 81.10310 57.80176 65.66593 47.15804
> rowSd(tmp5,na.rm=TRUE)
[1] 89.828941 10.524017 7.605827 10.352096 11.224424 7.334080 9.005726
[8] 7.602747 8.103452 6.867171
> rowMax(tmp5,na.rm=TRUE)
[1] 469.59057 89.04288 82.81692 93.87985 96.75716 83.63529 86.34275
[8] 85.26417 86.18028 84.03227
> rowMin(tmp5,na.rm=TRUE)
[1] 52.96640 54.87542 55.27545 53.37467 55.17639 53.81816 59.74663 54.89636
[9] 60.88525 58.66142
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.83065 71.17242 72.38310 71.81789 72.21238 71.22540 70.65636
[8] 77.05419 68.18756 71.44177 70.88696 76.45972 71.47542 70.31586
[15] 71.65990 70.10580 68.12871 66.74517 67.27622 70.06801
> colSums(tmp5,na.rm=TRUE)
[1] 1024.4758 711.7242 723.8310 718.1789 722.1238 712.2540 706.5636
[8] 770.5419 681.8756 714.4177 708.8696 764.5972 714.7542 703.1586
[15] 716.5990 701.0580 681.2871 667.4517 672.7622 700.6801
> colVars(tmp5,na.rm=TRUE)
[1] 17824.43289 65.63844 214.19714 59.27882 75.32604 52.36134
[7] 38.23494 167.29312 98.18896 71.30937 45.71353 114.34835
[13] 89.42981 61.79565 68.71740 95.40401 54.79833 122.25181
[19] 52.69405 64.50827
> colSd(tmp5,na.rm=TRUE)
[1] 133.508175 8.101755 14.635475 7.699274 8.679058 7.236114
[7] 6.183440 12.934184 9.909034 8.444488 6.761178 10.693379
[13] 9.456733 7.861021 8.289596 9.767497 7.402590 11.056754
[19] 7.259067 8.031704
> colMax(tmp5,na.rm=TRUE)
[1] 469.59057 83.63529 104.78761 81.05685 86.18028 80.82026 80.56786
[8] 96.75716 84.03227 89.49132 81.78850 93.87985 86.34275 79.20833
[15] 81.43722 89.04288 77.26477 83.24154 79.56071 87.52101
> colMin(tmp5,na.rm=TRUE)
[1] 62.07310 59.74663 53.37467 55.17639 59.95985 57.67125 62.45530 52.96640
[9] 55.27545 60.88525 59.96018 65.39970 58.13422 55.91180 57.74171 55.18718
[17] 58.59834 53.81816 54.89636 58.66142
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.56788 68.63514 72.51843 70.52194 73.16043 70.31905 NaN 68.17130
[9] 72.80437 71.18846
> rowSums(tmp5,na.rm=TRUE)
[1] 1811.358 1372.703 1450.369 1410.439 1463.209 1406.381 0.000 1363.426
[9] 1456.087 1423.769
> rowVars(tmp5,na.rm=TRUE)
[1] 8069.23873 110.75494 57.84860 107.16590 125.98770 53.78873
[7] NA 57.80176 65.66593 47.15804
> rowSd(tmp5,na.rm=TRUE)
[1] 89.828941 10.524017 7.605827 10.352096 11.224424 7.334080 NA
[8] 7.602747 8.103452 6.867171
> rowMax(tmp5,na.rm=TRUE)
[1] 469.59057 89.04288 82.81692 93.87985 96.75716 83.63529 NA
[8] 85.26417 86.18028 84.03227
> rowMin(tmp5,na.rm=TRUE)
[1] 52.96640 54.87542 55.27545 53.37467 55.17639 53.81816 NA 54.89636
[9] 60.88525 58.66142
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] NaN 72.44195 73.56446 70.79133 71.06101 71.31906 71.17552 76.18140
[9] 68.80107 71.11269 70.65915 75.58608 69.82350 70.76406 70.93216 70.84494
[17] 68.94949 66.44419 67.74293 69.94546
> colSums(tmp5,na.rm=TRUE)
[1] 0.0000 651.9776 662.0802 637.1220 639.5491 641.8715 640.5797 685.6326
[9] 619.2096 640.0142 635.9324 680.2747 628.4115 636.8766 638.3895 637.6044
[17] 620.5454 597.9977 609.6863 629.5091
> colVars(tmp5,na.rm=TRUE)
[1] NA 55.71149 225.27100 54.83333 69.82810 58.80783 39.98216
[8] 179.63494 106.22815 79.00475 50.84391 120.05547 69.90890 67.26008
[15] 71.34907 101.18339 54.06933 136.51419 56.83043 72.40285
> colSd(tmp5,na.rm=TRUE)
[1] NA 7.464013 15.009031 7.404953 8.356321 7.668626 6.323145
[8] 13.402796 10.306704 8.888461 7.130492 10.956982 8.361154 8.201224
[15] 8.446838 10.058995 7.353185 11.683928 7.538596 8.508987
> colMax(tmp5,na.rm=TRUE)
[1] -Inf 83.63529 104.78761 79.33748 86.18028 80.82026 80.56786
[8] 96.75716 84.03227 89.49132 81.78850 93.87985 85.26417 79.20833
[15] 81.43722 89.04288 77.26477 83.24154 79.56071 87.52101
> colMin(tmp5,na.rm=TRUE)
[1] Inf 60.84722 53.37467 55.17639 59.95985 57.67125 62.45530 52.96640
[9] 55.27545 60.88525 59.96018 65.39970 58.13422 55.91180 57.74171 55.18718
[17] 58.59834 53.81816 54.89636 58.66142
>
>
>
>
> 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] 299.8720 191.0202 221.9914 178.4925 201.5158 249.2375 328.3603 151.7073
[9] 297.6116 145.0816
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 299.8720 191.0202 221.9914 178.4925 201.5158 249.2375 328.3603 151.7073
[9] 297.6116 145.0816
>
>
>
> 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] -1.847411e-13 -8.526513e-14 -5.684342e-14 2.842171e-14 0.000000e+00
[6] -1.421085e-14 -2.273737e-13 -8.526513e-14 4.973799e-14 -1.705303e-13
[11] -5.684342e-14 1.421085e-14 -1.136868e-13 5.684342e-14 -8.526513e-14
[16] -8.526513e-14 -1.705303e-13 5.684342e-14 -1.136868e-13 -2.842171e-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)
+ }
10 10
5 17
5 5
2 10
6 9
6 16
7 5
1 8
4 7
5 17
10 16
6 12
8 20
8 3
3 12
8 20
6 13
8 12
5 16
1 12
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.576005
> Min(tmp)
[1] -2.788996
> mean(tmp)
[1] -0.09047825
> Sum(tmp)
[1] -9.047825
> Var(tmp)
[1] 1.107691
>
> rowMeans(tmp)
[1] -0.09047825
> rowSums(tmp)
[1] -9.047825
> rowVars(tmp)
[1] 1.107691
> rowSd(tmp)
[1] 1.052469
> rowMax(tmp)
[1] 2.576005
> rowMin(tmp)
[1] -2.788996
>
> colMeans(tmp)
[1] 0.431251038 -1.210743601 -0.160692398 -0.889679009 1.088591746
[6] -0.844099695 0.605756546 1.167136935 0.614484821 1.427113910
[11] -0.713388711 0.714316994 -0.276314351 0.449465817 -0.906847601
[16] -0.368103603 1.126756555 1.353185692 -0.130469831 -2.788996309
[21] -0.111838771 0.237439931 0.994895202 -0.837438458 0.345702863
[26] -0.210299042 -1.102736257 -0.823466002 -0.654101465 1.062615647
[31] -0.036425847 -0.148135434 0.080103337 -1.985690875 -1.176984079
[36] 1.588553457 -1.459243656 0.121681539 0.368258578 -0.378789809
[41] -2.412861306 0.421635404 2.439342864 1.000364913 -0.609656921
[46] -0.122077002 0.819812472 -0.684907207 1.622594765 -0.745549083
[51] 0.343527359 0.013507753 0.819232481 -0.548500148 -1.433751405
[56] -1.071345543 1.850160057 -0.280349030 -0.166091175 0.038159824
[61] 0.528443996 -1.428054466 -1.581964432 2.033164373 0.045816061
[66] 0.495058384 -0.230495668 0.866588323 0.328866965 -0.516629178
[71] -0.707735626 -0.579987548 0.430876311 0.966164896 0.345306118
[76] -2.162649717 2.576005460 -0.445191993 -2.632663875 0.548710467
[81] -0.532244353 -0.647001878 0.546103541 0.934281062 -0.550501344
[86] -0.698970205 0.176435850 -0.729665503 -0.633824293 0.729485763
[91] -1.261335994 -0.674524681 -0.832263877 -0.534513042 0.002089641
[96] -0.880185279 1.221712789 -1.264947969 -1.717180638 1.563522084
> colSums(tmp)
[1] 0.431251038 -1.210743601 -0.160692398 -0.889679009 1.088591746
[6] -0.844099695 0.605756546 1.167136935 0.614484821 1.427113910
[11] -0.713388711 0.714316994 -0.276314351 0.449465817 -0.906847601
[16] -0.368103603 1.126756555 1.353185692 -0.130469831 -2.788996309
[21] -0.111838771 0.237439931 0.994895202 -0.837438458 0.345702863
[26] -0.210299042 -1.102736257 -0.823466002 -0.654101465 1.062615647
[31] -0.036425847 -0.148135434 0.080103337 -1.985690875 -1.176984079
[36] 1.588553457 -1.459243656 0.121681539 0.368258578 -0.378789809
[41] -2.412861306 0.421635404 2.439342864 1.000364913 -0.609656921
[46] -0.122077002 0.819812472 -0.684907207 1.622594765 -0.745549083
[51] 0.343527359 0.013507753 0.819232481 -0.548500148 -1.433751405
[56] -1.071345543 1.850160057 -0.280349030 -0.166091175 0.038159824
[61] 0.528443996 -1.428054466 -1.581964432 2.033164373 0.045816061
[66] 0.495058384 -0.230495668 0.866588323 0.328866965 -0.516629178
[71] -0.707735626 -0.579987548 0.430876311 0.966164896 0.345306118
[76] -2.162649717 2.576005460 -0.445191993 -2.632663875 0.548710467
[81] -0.532244353 -0.647001878 0.546103541 0.934281062 -0.550501344
[86] -0.698970205 0.176435850 -0.729665503 -0.633824293 0.729485763
[91] -1.261335994 -0.674524681 -0.832263877 -0.534513042 0.002089641
[96] -0.880185279 1.221712789 -1.264947969 -1.717180638 1.563522084
> 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] 0.431251038 -1.210743601 -0.160692398 -0.889679009 1.088591746
[6] -0.844099695 0.605756546 1.167136935 0.614484821 1.427113910
[11] -0.713388711 0.714316994 -0.276314351 0.449465817 -0.906847601
[16] -0.368103603 1.126756555 1.353185692 -0.130469831 -2.788996309
[21] -0.111838771 0.237439931 0.994895202 -0.837438458 0.345702863
[26] -0.210299042 -1.102736257 -0.823466002 -0.654101465 1.062615647
[31] -0.036425847 -0.148135434 0.080103337 -1.985690875 -1.176984079
[36] 1.588553457 -1.459243656 0.121681539 0.368258578 -0.378789809
[41] -2.412861306 0.421635404 2.439342864 1.000364913 -0.609656921
[46] -0.122077002 0.819812472 -0.684907207 1.622594765 -0.745549083
[51] 0.343527359 0.013507753 0.819232481 -0.548500148 -1.433751405
[56] -1.071345543 1.850160057 -0.280349030 -0.166091175 0.038159824
[61] 0.528443996 -1.428054466 -1.581964432 2.033164373 0.045816061
[66] 0.495058384 -0.230495668 0.866588323 0.328866965 -0.516629178
[71] -0.707735626 -0.579987548 0.430876311 0.966164896 0.345306118
[76] -2.162649717 2.576005460 -0.445191993 -2.632663875 0.548710467
[81] -0.532244353 -0.647001878 0.546103541 0.934281062 -0.550501344
[86] -0.698970205 0.176435850 -0.729665503 -0.633824293 0.729485763
[91] -1.261335994 -0.674524681 -0.832263877 -0.534513042 0.002089641
[96] -0.880185279 1.221712789 -1.264947969 -1.717180638 1.563522084
> colMin(tmp)
[1] 0.431251038 -1.210743601 -0.160692398 -0.889679009 1.088591746
[6] -0.844099695 0.605756546 1.167136935 0.614484821 1.427113910
[11] -0.713388711 0.714316994 -0.276314351 0.449465817 -0.906847601
[16] -0.368103603 1.126756555 1.353185692 -0.130469831 -2.788996309
[21] -0.111838771 0.237439931 0.994895202 -0.837438458 0.345702863
[26] -0.210299042 -1.102736257 -0.823466002 -0.654101465 1.062615647
[31] -0.036425847 -0.148135434 0.080103337 -1.985690875 -1.176984079
[36] 1.588553457 -1.459243656 0.121681539 0.368258578 -0.378789809
[41] -2.412861306 0.421635404 2.439342864 1.000364913 -0.609656921
[46] -0.122077002 0.819812472 -0.684907207 1.622594765 -0.745549083
[51] 0.343527359 0.013507753 0.819232481 -0.548500148 -1.433751405
[56] -1.071345543 1.850160057 -0.280349030 -0.166091175 0.038159824
[61] 0.528443996 -1.428054466 -1.581964432 2.033164373 0.045816061
[66] 0.495058384 -0.230495668 0.866588323 0.328866965 -0.516629178
[71] -0.707735626 -0.579987548 0.430876311 0.966164896 0.345306118
[76] -2.162649717 2.576005460 -0.445191993 -2.632663875 0.548710467
[81] -0.532244353 -0.647001878 0.546103541 0.934281062 -0.550501344
[86] -0.698970205 0.176435850 -0.729665503 -0.633824293 0.729485763
[91] -1.261335994 -0.674524681 -0.832263877 -0.534513042 0.002089641
[96] -0.880185279 1.221712789 -1.264947969 -1.717180638 1.563522084
> colMedians(tmp)
[1] 0.431251038 -1.210743601 -0.160692398 -0.889679009 1.088591746
[6] -0.844099695 0.605756546 1.167136935 0.614484821 1.427113910
[11] -0.713388711 0.714316994 -0.276314351 0.449465817 -0.906847601
[16] -0.368103603 1.126756555 1.353185692 -0.130469831 -2.788996309
[21] -0.111838771 0.237439931 0.994895202 -0.837438458 0.345702863
[26] -0.210299042 -1.102736257 -0.823466002 -0.654101465 1.062615647
[31] -0.036425847 -0.148135434 0.080103337 -1.985690875 -1.176984079
[36] 1.588553457 -1.459243656 0.121681539 0.368258578 -0.378789809
[41] -2.412861306 0.421635404 2.439342864 1.000364913 -0.609656921
[46] -0.122077002 0.819812472 -0.684907207 1.622594765 -0.745549083
[51] 0.343527359 0.013507753 0.819232481 -0.548500148 -1.433751405
[56] -1.071345543 1.850160057 -0.280349030 -0.166091175 0.038159824
[61] 0.528443996 -1.428054466 -1.581964432 2.033164373 0.045816061
[66] 0.495058384 -0.230495668 0.866588323 0.328866965 -0.516629178
[71] -0.707735626 -0.579987548 0.430876311 0.966164896 0.345306118
[76] -2.162649717 2.576005460 -0.445191993 -2.632663875 0.548710467
[81] -0.532244353 -0.647001878 0.546103541 0.934281062 -0.550501344
[86] -0.698970205 0.176435850 -0.729665503 -0.633824293 0.729485763
[91] -1.261335994 -0.674524681 -0.832263877 -0.534513042 0.002089641
[96] -0.880185279 1.221712789 -1.264947969 -1.717180638 1.563522084
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.431251 -1.210744 -0.1606924 -0.889679 1.088592 -0.8440997 0.6057565
[2,] 0.431251 -1.210744 -0.1606924 -0.889679 1.088592 -0.8440997 0.6057565
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.167137 0.6144848 1.427114 -0.7133887 0.714317 -0.2763144 0.4494658
[2,] 1.167137 0.6144848 1.427114 -0.7133887 0.714317 -0.2763144 0.4494658
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.9068476 -0.3681036 1.126757 1.353186 -0.1304698 -2.788996 -0.1118388
[2,] -0.9068476 -0.3681036 1.126757 1.353186 -0.1304698 -2.788996 -0.1118388
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.2374399 0.9948952 -0.8374385 0.3457029 -0.210299 -1.102736 -0.823466
[2,] 0.2374399 0.9948952 -0.8374385 0.3457029 -0.210299 -1.102736 -0.823466
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.6541015 1.062616 -0.03642585 -0.1481354 0.08010334 -1.985691 -1.176984
[2,] -0.6541015 1.062616 -0.03642585 -0.1481354 0.08010334 -1.985691 -1.176984
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.588553 -1.459244 0.1216815 0.3682586 -0.3787898 -2.412861 0.4216354
[2,] 1.588553 -1.459244 0.1216815 0.3682586 -0.3787898 -2.412861 0.4216354
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 2.439343 1.000365 -0.6096569 -0.122077 0.8198125 -0.6849072 1.622595
[2,] 2.439343 1.000365 -0.6096569 -0.122077 0.8198125 -0.6849072 1.622595
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.7455491 0.3435274 0.01350775 0.8192325 -0.5485001 -1.433751 -1.071346
[2,] -0.7455491 0.3435274 0.01350775 0.8192325 -0.5485001 -1.433751 -1.071346
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.85016 -0.280349 -0.1660912 0.03815982 0.528444 -1.428054 -1.581964
[2,] 1.85016 -0.280349 -0.1660912 0.03815982 0.528444 -1.428054 -1.581964
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 2.033164 0.04581606 0.4950584 -0.2304957 0.8665883 0.328867 -0.5166292
[2,] 2.033164 0.04581606 0.4950584 -0.2304957 0.8665883 0.328867 -0.5166292
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.7077356 -0.5799875 0.4308763 0.9661649 0.3453061 -2.16265 2.576005
[2,] -0.7077356 -0.5799875 0.4308763 0.9661649 0.3453061 -2.16265 2.576005
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.445192 -2.632664 0.5487105 -0.5322444 -0.6470019 0.5461035 0.9342811
[2,] -0.445192 -2.632664 0.5487105 -0.5322444 -0.6470019 0.5461035 0.9342811
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.5505013 -0.6989702 0.1764359 -0.7296655 -0.6338243 0.7294858 -1.261336
[2,] -0.5505013 -0.6989702 0.1764359 -0.7296655 -0.6338243 0.7294858 -1.261336
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.6745247 -0.8322639 -0.534513 0.002089641 -0.8801853 1.221713 -1.264948
[2,] -0.6745247 -0.8322639 -0.534513 0.002089641 -0.8801853 1.221713 -1.264948
[,99] [,100]
[1,] -1.717181 1.563522
[2,] -1.717181 1.563522
>
>
> Max(tmp2)
[1] 2.448695
> Min(tmp2)
[1] -2.849609
> mean(tmp2)
[1] 0.009300602
> Sum(tmp2)
[1] 0.9300602
> Var(tmp2)
[1] 0.8635763
>
> rowMeans(tmp2)
[1] 0.871577470 -0.200124362 0.228151509 -0.433092810 -0.732752197
[6] 0.788155739 0.982452876 0.265626063 1.163766051 0.117266547
[11] -0.014410221 0.808620603 -0.959293261 -1.583277465 -2.849609141
[16] -0.143123532 -0.462353387 0.752016688 0.152291819 -1.793605263
[21] 0.530506655 0.169131191 -0.446376494 -2.556544559 -0.248298884
[26] -1.414427852 0.395532187 -0.278309104 0.640817963 -0.990552511
[31] 0.084162211 -0.781984880 0.420523521 0.663225148 0.008103019
[36] -0.439572033 0.520353135 -0.358391952 0.531301422 -1.843872798
[41] -0.027252174 1.026847246 -0.017141303 0.328340167 0.353723580
[46] 1.294726910 -0.217762168 -1.333827395 -0.182813192 -0.927343310
[51] -0.302244075 -0.076286845 0.279336264 -1.453123913 1.079010064
[56] 1.799663390 -0.549249547 -0.254344773 0.652328768 -0.010277625
[61] 0.604112744 -0.632511076 -1.972288325 1.838069948 -0.125197890
[66] -0.626783267 0.108430516 -0.123505164 -0.059376367 0.465206737
[71] -0.753230062 1.564739695 0.132885302 2.378783518 0.363791662
[76] 2.448694642 0.733327074 1.374793512 0.929075560 0.161582727
[81] 0.698184035 -0.357318626 0.708768476 0.347605451 0.349888684
[86] -0.268176338 -0.122975371 -0.240756150 -0.329978646 0.375167615
[91] -1.351600703 -0.117871177 0.375262126 -0.434709742 0.793156494
[96] -0.723040765 -1.711372952 0.321670714 0.455627113 0.326009247
> rowSums(tmp2)
[1] 0.871577470 -0.200124362 0.228151509 -0.433092810 -0.732752197
[6] 0.788155739 0.982452876 0.265626063 1.163766051 0.117266547
[11] -0.014410221 0.808620603 -0.959293261 -1.583277465 -2.849609141
[16] -0.143123532 -0.462353387 0.752016688 0.152291819 -1.793605263
[21] 0.530506655 0.169131191 -0.446376494 -2.556544559 -0.248298884
[26] -1.414427852 0.395532187 -0.278309104 0.640817963 -0.990552511
[31] 0.084162211 -0.781984880 0.420523521 0.663225148 0.008103019
[36] -0.439572033 0.520353135 -0.358391952 0.531301422 -1.843872798
[41] -0.027252174 1.026847246 -0.017141303 0.328340167 0.353723580
[46] 1.294726910 -0.217762168 -1.333827395 -0.182813192 -0.927343310
[51] -0.302244075 -0.076286845 0.279336264 -1.453123913 1.079010064
[56] 1.799663390 -0.549249547 -0.254344773 0.652328768 -0.010277625
[61] 0.604112744 -0.632511076 -1.972288325 1.838069948 -0.125197890
[66] -0.626783267 0.108430516 -0.123505164 -0.059376367 0.465206737
[71] -0.753230062 1.564739695 0.132885302 2.378783518 0.363791662
[76] 2.448694642 0.733327074 1.374793512 0.929075560 0.161582727
[81] 0.698184035 -0.357318626 0.708768476 0.347605451 0.349888684
[86] -0.268176338 -0.122975371 -0.240756150 -0.329978646 0.375167615
[91] -1.351600703 -0.117871177 0.375262126 -0.434709742 0.793156494
[96] -0.723040765 -1.711372952 0.321670714 0.455627113 0.326009247
> 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.871577470 -0.200124362 0.228151509 -0.433092810 -0.732752197
[6] 0.788155739 0.982452876 0.265626063 1.163766051 0.117266547
[11] -0.014410221 0.808620603 -0.959293261 -1.583277465 -2.849609141
[16] -0.143123532 -0.462353387 0.752016688 0.152291819 -1.793605263
[21] 0.530506655 0.169131191 -0.446376494 -2.556544559 -0.248298884
[26] -1.414427852 0.395532187 -0.278309104 0.640817963 -0.990552511
[31] 0.084162211 -0.781984880 0.420523521 0.663225148 0.008103019
[36] -0.439572033 0.520353135 -0.358391952 0.531301422 -1.843872798
[41] -0.027252174 1.026847246 -0.017141303 0.328340167 0.353723580
[46] 1.294726910 -0.217762168 -1.333827395 -0.182813192 -0.927343310
[51] -0.302244075 -0.076286845 0.279336264 -1.453123913 1.079010064
[56] 1.799663390 -0.549249547 -0.254344773 0.652328768 -0.010277625
[61] 0.604112744 -0.632511076 -1.972288325 1.838069948 -0.125197890
[66] -0.626783267 0.108430516 -0.123505164 -0.059376367 0.465206737
[71] -0.753230062 1.564739695 0.132885302 2.378783518 0.363791662
[76] 2.448694642 0.733327074 1.374793512 0.929075560 0.161582727
[81] 0.698184035 -0.357318626 0.708768476 0.347605451 0.349888684
[86] -0.268176338 -0.122975371 -0.240756150 -0.329978646 0.375167615
[91] -1.351600703 -0.117871177 0.375262126 -0.434709742 0.793156494
[96] -0.723040765 -1.711372952 0.321670714 0.455627113 0.326009247
> rowMin(tmp2)
[1] 0.871577470 -0.200124362 0.228151509 -0.433092810 -0.732752197
[6] 0.788155739 0.982452876 0.265626063 1.163766051 0.117266547
[11] -0.014410221 0.808620603 -0.959293261 -1.583277465 -2.849609141
[16] -0.143123532 -0.462353387 0.752016688 0.152291819 -1.793605263
[21] 0.530506655 0.169131191 -0.446376494 -2.556544559 -0.248298884
[26] -1.414427852 0.395532187 -0.278309104 0.640817963 -0.990552511
[31] 0.084162211 -0.781984880 0.420523521 0.663225148 0.008103019
[36] -0.439572033 0.520353135 -0.358391952 0.531301422 -1.843872798
[41] -0.027252174 1.026847246 -0.017141303 0.328340167 0.353723580
[46] 1.294726910 -0.217762168 -1.333827395 -0.182813192 -0.927343310
[51] -0.302244075 -0.076286845 0.279336264 -1.453123913 1.079010064
[56] 1.799663390 -0.549249547 -0.254344773 0.652328768 -0.010277625
[61] 0.604112744 -0.632511076 -1.972288325 1.838069948 -0.125197890
[66] -0.626783267 0.108430516 -0.123505164 -0.059376367 0.465206737
[71] -0.753230062 1.564739695 0.132885302 2.378783518 0.363791662
[76] 2.448694642 0.733327074 1.374793512 0.929075560 0.161582727
[81] 0.698184035 -0.357318626 0.708768476 0.347605451 0.349888684
[86] -0.268176338 -0.122975371 -0.240756150 -0.329978646 0.375167615
[91] -1.351600703 -0.117871177 0.375262126 -0.434709742 0.793156494
[96] -0.723040765 -1.711372952 0.321670714 0.455627113 0.326009247
>
> colMeans(tmp2)
[1] 0.009300602
> colSums(tmp2)
[1] 0.9300602
> colVars(tmp2)
[1] 0.8635763
> colSd(tmp2)
[1] 0.9292881
> colMax(tmp2)
[1] 2.448695
> colMin(tmp2)
[1] -2.849609
> colMedians(tmp2)
[1] 0.04613262
> colRanges(tmp2)
[,1]
[1,] -2.849609
[2,] 2.448695
>
> 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] 2.7981530 -1.9854078 2.2720793 -3.2496798 -1.7046161 -2.7156626
[7] 1.6714121 2.9264416 -0.6905654 4.5857086
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.7939307
[2,] -0.5226464
[3,] 0.1960300
[4,] 0.8493364
[5,] 2.4560720
>
> rowApply(tmp,sum)
[1] 3.0555082 -2.5470391 2.0333906 -1.2775325 3.0186659 2.8329490
[7] 1.2439418 1.3639165 -5.0733226 -0.7426148
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 6 10 8 1 2 10 4 9 7
[2,] 7 4 5 7 4 9 8 2 3 1
[3,] 8 8 8 10 8 8 6 5 4 2
[4,] 1 5 2 4 10 4 1 3 7 4
[5,] 2 7 4 1 9 6 5 9 2 3
[6,] 4 2 7 3 5 5 4 8 6 5
[7,] 10 1 6 2 2 10 3 7 10 6
[8,] 9 3 3 9 3 7 9 6 5 9
[9,] 6 9 1 5 6 3 7 1 1 10
[10,] 5 10 9 6 7 1 2 10 8 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.9276674 -1.2349115 -1.8292464 -0.3119902 1.0851089 1.2398012
[7] -1.1678464 1.0129955 2.3212054 0.3666686 -0.2726477 -1.6088526
[13] 1.6014257 2.1304182 1.6673474 0.6302175 -2.3734224 -2.6510371
[19] 0.3793079 0.9584813
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.3072819
[2,] 0.1329218
[3,] 0.2188352
[4,] 0.5299816
[5,] 1.3532106
>
> rowApply(tmp,sum)
[1] 2.3172339 2.2144168 -4.0605362 0.3005856 3.0989904
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 11 16 18 11
[2,] 10 2 2 19 10
[3,] 3 4 12 16 2
[4,] 1 10 15 17 5
[5,] 19 13 10 6 7
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.3072819 -0.2413628 -0.7188022 -1.06076629 1.32038428 1.57014331
[2,] 0.1329218 -1.0785239 -1.0329325 -0.05281741 0.39070663 -0.09471263
[3,] 0.5299816 -1.5583879 0.1046530 0.49451542 -0.03733812 0.44914980
[4,] 1.3532106 1.4429068 0.9952366 1.10974623 -0.42494424 -1.35865980
[5,] 0.2188352 0.2004564 -1.1774012 -0.80266819 -0.16369962 0.67388050
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.9690137 0.04225509 0.88896473 -0.3642123 1.08311340 -0.4416435
[2,] 2.0808760 -0.29256136 -0.67827499 -1.2687632 -0.87369667 1.1290958
[3,] -2.2352360 -0.15875030 -0.01123163 0.4333616 -1.03602539 -0.1201085
[4,] 0.1037091 0.17915901 1.59788547 -0.1778193 0.45798669 -1.7252570
[5,] -0.1481818 1.24289304 0.52386179 1.7441018 0.09597425 -0.4509395
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.4115679 0.3127471 0.9325470 0.8591950 -0.5018010 -0.2206482
[2,] 1.1715623 1.3039616 1.3470401 -0.3051813 -1.0491961 0.4670973
[3,] -0.8494004 1.0347153 0.5791395 0.7095480 -0.7075900 -1.1336009
[4,] -0.2225906 -0.7874612 -1.5491128 0.1823791 0.8651965 -0.1654472
[5,] 1.9134224 0.2664553 0.3577336 -0.8157233 -0.9800317 -1.5984382
[,19] [,20]
[1,] -0.7122595 1.25724320
[2,] 0.1838636 0.73395198
[3,] 0.6686164 -1.21654762
[4,] -1.4804553 -0.09508297
[5,] 1.7195429 0.27891672
>
>
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 649 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 562 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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 0.4452157 1.413777 -1.782484 1.048332 -0.1318373 -0.4400547 0.4177506
col8 col9 col10 col11 col12 col13 col14
row1 -1.196345 0.4698539 -0.9687081 -0.6355024 0.8195389 3.543502 0.523921
col15 col16 col17 col18 col19 col20
row1 -0.8246019 -0.7148874 0.2142155 1.225767 -2.400706 -0.1774662
> tmp[,"col10"]
col10
row1 -0.96870811
row2 -0.04520558
row3 0.12490448
row4 -0.11940553
row5 -1.13806567
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.4452157 1.4137768 -1.7824839 1.048332 -0.1318373 -0.4400547 0.4177506
row5 0.7158315 -0.3909448 -0.8885557 -2.501276 -1.1533427 0.5637512 0.3625869
col8 col9 col10 col11 col12 col13 col14
row1 -1.196345 0.4698539 -0.9687081 -0.6355024 0.8195389 3.543502 0.5239210
row5 2.129240 -0.2463416 -1.1380657 0.6812436 -1.3845259 1.316940 -0.4201819
col15 col16 col17 col18 col19 col20
row1 -0.8246019 -0.7148874 0.2142155 1.225767 -2.40070581 -0.1774662
row5 -0.7986649 0.7944467 1.0410411 1.016858 0.04790301 0.7526501
> tmp[,c("col6","col20")]
col6 col20
row1 -0.44005470 -0.1774662
row2 0.48541912 -0.8633627
row3 -0.09716185 -0.3348282
row4 0.33152085 0.3332815
row5 0.56375116 0.7526501
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.4400547 -0.1774662
row5 0.5637512 0.7526501
>
>
>
>
> 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 50.81623 50.1512 49.90103 48.46085 50.25856 105.4438 47.43884 49.4648
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.82234 48.65139 50.65491 49.69548 50.32671 50.1016 49.2546 48.46217
col17 col18 col19 col20
row1 50.35812 48.98216 49.35948 105.1415
> tmp[,"col10"]
col10
row1 48.65139
row2 30.26169
row3 27.08326
row4 28.95974
row5 50.47005
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.81623 50.15120 49.90103 48.46085 50.25856 105.4438 47.43884 49.4648
row5 50.97648 50.17911 50.29309 48.38178 50.67056 106.6462 49.42528 51.1019
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.82234 48.65139 50.65491 49.69548 50.32671 50.10160 49.2546 48.46217
row5 49.31979 50.47005 50.05406 48.68356 51.12564 50.85885 49.7043 50.55149
col17 col18 col19 col20
row1 50.35812 48.98216 49.35948 105.1415
row5 50.66777 49.16300 50.54362 106.6244
> tmp[,c("col6","col20")]
col6 col20
row1 105.44380 105.14147
row2 74.81637 75.68051
row3 77.24307 76.46497
row4 74.73041 74.34191
row5 106.64619 106.62440
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.4438 105.1415
row5 106.6462 106.6244
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.4438 105.1415
row5 106.6462 106.6244
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.92631016
[2,] -0.08401556
[3,] -1.91867681
[4,] -0.08500486
[5,] 0.10792062
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.5073824 -0.7012922
[2,] -0.6128218 -1.4037226
[3,] -1.2515360 -0.6941807
[4,] -0.7757092 -0.8314149
[5,] 1.0267775 -0.2910403
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.3616790 1.0044923
[2,] -0.3189360 -0.5852226
[3,] 0.5387690 -1.5797746
[4,] -0.5074277 -2.1353703
[5,] -1.0823649 0.6388628
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.361679
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.361679
[2,] -0.318936
>
>
>
> 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.6611093 -0.1389121 -0.8161818 -1.4154161 -0.8330560 -0.2419003
row1 0.1521162 0.0346516 -0.9386270 0.8650423 -0.9572473 1.9267615
[,7] [,8] [,9] [,10] [,11] [,12]
row3 0.5750605 -0.1019272 -1.042841 -0.2975535 0.3963911 0.967489
row1 -0.2976225 -1.1903711 1.150910 1.6242537 -0.4937319 -1.081703
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 0.09798504 -2.623947 -0.08003066 0.8936432 1.5521749 0.3364282 0.563660
row1 -0.49670052 -1.899410 -1.88973839 -1.1063070 -0.1649545 0.2718312 0.172727
[,20]
row3 -0.8654515
row1 -0.6390356
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.6966024 -0.8668312 -0.01370016 1.046352 -0.2845781 -1.712196 1.864175
[,8] [,9] [,10]
row2 -1.015212 0.2007294 0.6196436
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.781544 0.3590565 -1.322152 -0.9155188 -0.7329713 0.7241956 -0.4154438
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.03903322 -0.08675179 0.6527383 -0.6958317 -0.3335246 0.2637378 0.131814
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -2.127756 0.11019 0.5345896 1.305354 -1.477993 -0.4548628
>
>
> 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: 0x5f7978e5b790>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe55888d7090"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe5585beab6d8"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe558585cffc8"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe558348dcc5f"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe55815890c4d"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe55815c709f8"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe5581f7c2921"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe5582d2b31da"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe558d9a412e"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe5581cebcc24"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe5587b8c77ca"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe55861f9ce"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe5583f181fa7"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe558742eb2c7"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMfe558526679ca"
>
>
> ### 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: 0x5f797a932820>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f797a932820>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5f797a932820>
> rowMedians(tmp)
[1] 0.5567076639 -0.2473150251 0.4018462351 -0.6507646802 -0.4119420422
[6] 0.0417496872 -0.0867397184 -0.1902051017 0.4484716568 0.3539271698
[11] 0.1600823252 0.1185576167 0.5404619590 0.0049979088 -0.3652616530
[16] -0.0553458724 0.2273728684 0.1783243063 0.5123553663 -0.1986944026
[21] -0.5168074751 0.1486100254 -0.3277284006 -0.2374442108 -0.3138736421
[26] 0.0018204283 0.2590749054 -0.2955360057 -0.2042434456 -0.2372650742
[31] 0.1079684877 -0.3802448068 -0.0471897847 0.6671336138 0.4515870948
[36] -0.3305080650 -0.2074905463 0.7284679271 -0.0870399158 -0.6997307424
[41] -0.0105305307 -0.4902227619 0.0511092834 0.0519181149 0.0848442959
[46] 0.2267840354 -0.2070217671 -0.0785808925 0.0803202737 0.6306417607
[51] -0.2748596417 -0.4439576767 0.0220600181 -0.2279881124 -0.0242633039
[56] 0.2407765324 -0.0733838471 0.0799803964 -0.4833079903 0.1247253411
[61] 0.0148842241 0.0467430532 0.0400631364 -0.3206118452 0.1703417270
[66] 0.1623785345 0.5380237421 0.2126223968 -0.3472717986 0.2747679272
[71] 0.3282539078 -0.2839202162 -0.0846849819 -0.6834189453 0.3624292576
[76] 0.4303411050 -0.3814517908 -0.0727150012 0.2292708751 -0.1650771581
[81] 0.5098526874 0.2190127605 0.5463574533 -0.2967500415 -0.0127435446
[86] 0.0982188527 0.0969559904 -0.2813455301 0.2539661557 0.1085213339
[91] 0.1285442701 0.1896838615 -0.1803056904 -0.2204690935 0.7671207183
[96] -0.2874326944 -0.5240497131 0.0625005465 0.1386207608 0.4305343743
[101] -0.0866349596 -0.3810233589 -0.2275578186 0.0650603888 -0.0397078280
[106] 0.1888466318 0.2838507341 -0.1432608838 0.0853491088 -0.1657702576
[111] 0.4378936511 -0.4366916604 -0.3093601511 -0.8138003444 0.3381985731
[116] 0.4610539960 -0.2608739685 -0.3039354034 -0.1515944259 0.2060890986
[121] 0.3887544788 0.1602240861 0.0440744814 -0.2633087509 -0.1498293631
[126] -0.0829280614 -0.0359378701 0.5167501312 -0.2424560249 0.5362287234
[131] -0.2375811706 0.3909474520 0.7060242077 0.4785791688 0.5311829939
[136] 0.2787190244 0.2088608167 0.3473015162 -0.2679347480 0.0892981510
[141] 0.3962509629 -0.1621214937 -0.5932014670 0.0078849591 -0.3303156454
[146] -0.5263370446 -0.2466640526 0.3436515771 0.0384845083 0.1781507737
[151] -0.2099178190 0.1484146766 -0.2392109964 -0.0557748145 0.4265808425
[156] 0.2831854507 -0.0113996247 0.0007914361 0.1243909430 -0.0268111544
[161] 0.0064935692 0.0592455811 0.0450622261 -0.2622108786 0.6867259604
[166] 0.2738143305 -0.1460348108 0.3498931768 0.0673766362 -0.1870019725
[171] -0.0214181970 -0.0415309925 0.3955975650 -0.3599370297 -0.3483713488
[176] -0.0915398016 -0.1449258908 0.3591395136 -0.1357429467 0.5079944738
[181] 0.0406507108 -0.1978936725 0.2229496513 0.2128394249 0.1154697308
[186] -0.0729376415 -0.1137294770 -0.3753700023 -0.0538987735 0.1427361746
[191] -0.3845262091 0.1976821253 -0.5982383293 -0.3173576664 -0.0119347737
[196] 0.0279431913 -0.4691221634 0.1494438360 -0.0838649994 0.2069495035
[201] 0.0149327194 0.2503436425 -0.4296158828 -0.4104018251 -0.4464247076
[206] -0.0370589504 0.2707755462 0.0665764360 -0.0076820681 0.5138861871
[211] -0.5183460193 0.1369017476 -0.5233271149 0.2237962959 -0.1602833424
[216] -0.2919676683 0.1404464684 0.3846925284 0.0616277363 -0.4552370832
[221] -0.2742499057 0.0203689906 0.1713294678 -0.0449546834 1.1555805095
[226] -0.6675122505 0.5421732167 0.3005282761 -0.2445596321 0.5010138717
>
> proc.time()
user system elapsed
1.321 0.664 1.975
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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: 0x5e4f824c9240>
> .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: 0x5e4f824c9240>
> .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: 0x5e4f824c9240>
> .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: 0x5e4f824c9240>
> 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: 0x5e4f827ac1a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f827ac1a0>
> .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: 0x5e4f827ac1a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f827ac1a0>
> .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: 0x5e4f827ac1a0>
> 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: 0x5e4f814604a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f814604a0>
> .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: 0x5e4f814604a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e4f814604a0>
> .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: 0x5e4f814604a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5e4f814604a0>
> .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: 0x5e4f814604a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5e4f814604a0>
> .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: 0x5e4f814604a0>
> 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: 0x5e4f814fc410>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5e4f814fc410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f814fc410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f814fc410>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilefe65360b0d696" "BufferedMatrixFilefe653993f616"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilefe65360b0d696" "BufferedMatrixFilefe653993f616"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f81d7b6d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f81d7b6d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e4f81d7b6d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e4f81d7b6d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5e4f81d7b6d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5e4f81d7b6d0>
> .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: 0x5e4f82f024b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e4f82f024b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e4f82f024b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5e4f82f024b0>
> 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: 0x5e4f831f72d0>
> .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: 0x5e4f831f72d0>
> rm(P)
>
> proc.time()
user system elapsed
0.257 0.050 0.294
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.243 0.041 0.275