| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-09-20 12:04 -0400 (Sat, 20 Sep 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4814 |
| lconway | macOS 12.7.1 Monterey | x86_64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4603 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4547 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4553 |
| 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/2333 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.73.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| lconway | macOS 12.7.1 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson3 | macOS 13.7.7 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.73.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz |
| StartedAt: 2025-09-19 19:43:11 -0400 (Fri, 19 Sep 2025) |
| EndedAt: 2025-09-19 19:44:06 -0400 (Fri, 19 Sep 2025) |
| EllapsedTime: 54.4 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-09-10 r88807)
* using platform: x86_64-apple-darwin20
* R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.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 ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.1.sdk’
* 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 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 sizes of PDF files under ‘inst/doc’ ... OK
* 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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 2 NOTEs
See
‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/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.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
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.368 0.164 0.539
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
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] "/Users/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) limit (Mb) max used (Mb)
Ncells 480848 25.7 1056620 56.5 NA 634462 33.9
Vcells 891079 6.8 8388608 64.0 98304 2108727 16.1
>
>
>
>
> ##
> ## 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] "Fri Sep 19 19:43:37 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] "Fri Sep 19 19:43:38 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: 0x6000003ec000>
>
>
>
> 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] "Fri Sep 19 19:43:43 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] "Fri Sep 19 19:43:45 2025"
>
> ColMode(tmp2)
<pointer: 0x6000003ec000>
>
>
>
> ### 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,] 99.1238655 -0.08641705 -1.3608331 0.28892331
[2,] 0.1183883 0.16895114 -0.7704463 0.74387601
[3,] -1.6850248 0.70042700 -0.8884378 0.01097285
[4,] -1.2987452 0.22772492 -0.1535815 0.37240961
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/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,] 99.1238655 0.08641705 1.3608331 0.28892331
[2,] 0.1183883 0.16895114 0.7704463 0.74387601
[3,] 1.6850248 0.70042700 0.8884378 0.01097285
[4,] 1.2987452 0.22772492 0.1535815 0.37240961
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/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,] 9.956097 0.2939678 1.1665475 0.5375159
[2,] 0.344076 0.4110367 0.8777507 0.8624825
[3,] 1.298085 0.8369152 0.9425698 0.1047514
[4,] 1.139625 0.4772053 0.3918948 0.6102537
>
> 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: /Users/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,] 223.68483 28.02609 38.02631 30.66408
[2,] 28.55915 29.27932 34.54795 34.36870
[3,] 39.66588 34.06958 35.31414 26.05849
[4,] 37.69500 29.99978 29.07253 31.47495
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000003e4000>
> exp(tmp5)
<pointer: 0x6000003e4000>
> log(tmp5,2)
<pointer: 0x6000003e4000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.5707
> Min(tmp5)
[1] 52.80811
> mean(tmp5)
[1] 72.70458
> Sum(tmp5)
[1] 14540.92
> Var(tmp5)
[1] 851.7843
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.22128 69.15102 69.03983 69.67177 71.06261 74.31496 70.22579 70.89987
[9] 69.93846 71.52019
> rowSums(tmp5)
[1] 1824.426 1383.020 1380.797 1393.435 1421.252 1486.299 1404.516 1417.997
[9] 1398.769 1430.404
> rowVars(tmp5)
[1] 7846.03057 54.32056 88.78082 64.69308 60.91069 68.38884
[7] 105.88029 57.77888 98.04462 53.47130
> rowSd(tmp5)
[1] 88.577822 7.370248 9.422357 8.043201 7.804530 8.269754 10.289815
[8] 7.601242 9.901748 7.312408
> rowMax(tmp5)
[1] 465.57068 78.29356 88.16015 83.92142 86.56180 86.10412 89.20754
[8] 88.29803 87.10835 82.90910
> rowMin(tmp5)
[1] 58.33264 53.82222 52.80811 56.60337 59.60981 58.32972 55.17510 60.31765
[9] 54.66031 59.82625
>
> colMeans(tmp5)
[1] 113.10238 66.78340 69.05722 65.41189 69.38751 69.78265 71.70107
[8] 72.63059 70.60747 68.20545 71.35888 66.54734 72.23432 75.15873
[15] 74.18760 69.92087 70.14227 74.32498 73.39550 70.15144
> colSums(tmp5)
[1] 1131.0238 667.8340 690.5722 654.1189 693.8751 697.8265 717.0107
[8] 726.3059 706.0747 682.0545 713.5888 665.4734 722.3432 751.5873
[15] 741.8760 699.2087 701.4227 743.2498 733.9550 701.5144
> colVars(tmp5)
[1] 15443.79238 60.82288 44.70095 65.68714 107.27107 72.08494
[7] 74.75844 50.45493 72.70072 88.79577 60.57134 47.32558
[13] 27.55344 86.19529 74.49110 99.82380 34.99416 57.46199
[19] 106.64275 101.29804
> colSd(tmp5)
[1] 124.273056 7.798902 6.685877 8.104761 10.357175 8.490285
[7] 8.646296 7.103164 8.526472 9.423151 7.782759 6.879359
[13] 5.249137 9.284142 8.630823 9.991186 5.915586 7.580369
[19] 10.326798 10.064693
> colMax(tmp5)
[1] 465.57068 81.93023 79.14678 81.48548 81.84653 84.03388 80.32171
[8] 80.65107 90.03020 84.06601 89.20754 77.70987 79.15394 88.83185
[15] 87.10835 85.77418 83.92142 84.76031 90.74486 88.29803
> colMin(tmp5)
[1] 59.44213 58.33264 56.43173 54.23733 53.82222 58.26202 55.17510 62.76280
[9] 60.49979 52.80811 61.87697 54.66031 61.38130 59.21878 64.93192 55.23426
[17] 62.96763 62.20116 59.26223 61.35423
>
>
> ### 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] 91.22128 69.15102 NA 69.67177 71.06261 74.31496 70.22579 70.89987
[9] 69.93846 71.52019
> rowSums(tmp5)
[1] 1824.426 1383.020 NA 1393.435 1421.252 1486.299 1404.516 1417.997
[9] 1398.769 1430.404
> rowVars(tmp5)
[1] 7846.03057 54.32056 72.33377 64.69308 60.91069 68.38884
[7] 105.88029 57.77888 98.04462 53.47130
> rowSd(tmp5)
[1] 88.577822 7.370248 8.504926 8.043201 7.804530 8.269754 10.289815
[8] 7.601242 9.901748 7.312408
> rowMax(tmp5)
[1] 465.57068 78.29356 NA 83.92142 86.56180 86.10412 89.20754
[8] 88.29803 87.10835 82.90910
> rowMin(tmp5)
[1] 58.33264 53.82222 NA 56.60337 59.60981 58.32972 55.17510 60.31765
[9] 54.66031 59.82625
>
> colMeans(tmp5)
[1] 113.10238 66.78340 69.05722 65.41189 69.38751 69.78265 71.70107
[8] 72.63059 70.60747 68.20545 71.35888 66.54734 72.23432 NA
[15] 74.18760 69.92087 70.14227 74.32498 73.39550 70.15144
> colSums(tmp5)
[1] 1131.0238 667.8340 690.5722 654.1189 693.8751 697.8265 717.0107
[8] 726.3059 706.0747 682.0545 713.5888 665.4734 722.3432 NA
[15] 741.8760 699.2087 701.4227 743.2498 733.9550 701.5144
> colVars(tmp5)
[1] 15443.79238 60.82288 44.70095 65.68714 107.27107 72.08494
[7] 74.75844 50.45493 72.70072 88.79577 60.57134 47.32558
[13] 27.55344 NA 74.49110 99.82380 34.99416 57.46199
[19] 106.64275 101.29804
> colSd(tmp5)
[1] 124.273056 7.798902 6.685877 8.104761 10.357175 8.490285
[7] 8.646296 7.103164 8.526472 9.423151 7.782759 6.879359
[13] 5.249137 NA 8.630823 9.991186 5.915586 7.580369
[19] 10.326798 10.064693
> colMax(tmp5)
[1] 465.57068 81.93023 79.14678 81.48548 81.84653 84.03388 80.32171
[8] 80.65107 90.03020 84.06601 89.20754 77.70987 79.15394 NA
[15] 87.10835 85.77418 83.92142 84.76031 90.74486 88.29803
> colMin(tmp5)
[1] 59.44213 58.33264 56.43173 54.23733 53.82222 58.26202 55.17510 62.76280
[9] 60.49979 52.80811 61.87697 54.66031 61.38130 NA 64.93192 55.23426
[17] 62.96763 62.20116 59.26223 61.35423
>
> Max(tmp5,na.rm=TRUE)
[1] 465.5707
> Min(tmp5,na.rm=TRUE)
[1] 52.80811
> mean(tmp5,na.rm=TRUE)
[1] 72.62691
> Sum(tmp5,na.rm=TRUE)
[1] 14452.76
> Var(tmp5,na.rm=TRUE)
[1] 854.8737
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.22128 69.15102 68.03350 69.67177 71.06261 74.31496 70.22579 70.89987
[9] 69.93846 71.52019
> rowSums(tmp5,na.rm=TRUE)
[1] 1824.426 1383.020 1292.637 1393.435 1421.252 1486.299 1404.516 1417.997
[9] 1398.769 1430.404
> rowVars(tmp5,na.rm=TRUE)
[1] 7846.03057 54.32056 72.33377 64.69308 60.91069 68.38884
[7] 105.88029 57.77888 98.04462 53.47130
> rowSd(tmp5,na.rm=TRUE)
[1] 88.577822 7.370248 8.504926 8.043201 7.804530 8.269754 10.289815
[8] 7.601242 9.901748 7.312408
> rowMax(tmp5,na.rm=TRUE)
[1] 465.57068 78.29356 82.55932 83.92142 86.56180 86.10412 89.20754
[8] 88.29803 87.10835 82.90910
> rowMin(tmp5,na.rm=TRUE)
[1] 58.33264 53.82222 52.80811 56.60337 59.60981 58.32972 55.17510 60.31765
[9] 54.66031 59.82625
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.10238 66.78340 69.05722 65.41189 69.38751 69.78265 71.70107
[8] 72.63059 70.60747 68.20545 71.35888 66.54734 72.23432 73.71413
[15] 74.18760 69.92087 70.14227 74.32498 73.39550 70.15144
> colSums(tmp5,na.rm=TRUE)
[1] 1131.0238 667.8340 690.5722 654.1189 693.8751 697.8265 717.0107
[8] 726.3059 706.0747 682.0545 713.5888 665.4734 722.3432 663.4272
[15] 741.8760 699.2087 701.4227 743.2498 733.9550 701.5144
> colVars(tmp5,na.rm=TRUE)
[1] 15443.79238 60.82288 44.70095 65.68714 107.27107 72.08494
[7] 74.75844 50.45493 72.70072 88.79577 60.57134 47.32558
[13] 27.55344 73.49238 74.49110 99.82380 34.99416 57.46199
[19] 106.64275 101.29804
> colSd(tmp5,na.rm=TRUE)
[1] 124.273056 7.798902 6.685877 8.104761 10.357175 8.490285
[7] 8.646296 7.103164 8.526472 9.423151 7.782759 6.879359
[13] 5.249137 8.572770 8.630823 9.991186 5.915586 7.580369
[19] 10.326798 10.064693
> colMax(tmp5,na.rm=TRUE)
[1] 465.57068 81.93023 79.14678 81.48548 81.84653 84.03388 80.32171
[8] 80.65107 90.03020 84.06601 89.20754 77.70987 79.15394 88.83185
[15] 87.10835 85.77418 83.92142 84.76031 90.74486 88.29803
> colMin(tmp5,na.rm=TRUE)
[1] 59.44213 58.33264 56.43173 54.23733 53.82222 58.26202 55.17510 62.76280
[9] 60.49979 52.80811 61.87697 54.66031 61.38130 59.21878 64.93192 55.23426
[17] 62.96763 62.20116 59.26223 61.35423
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.22128 69.15102 NaN 69.67177 71.06261 74.31496 70.22579 70.89987
[9] 69.93846 71.52019
> rowSums(tmp5,na.rm=TRUE)
[1] 1824.426 1383.020 0.000 1393.435 1421.252 1486.299 1404.516 1417.997
[9] 1398.769 1430.404
> rowVars(tmp5,na.rm=TRUE)
[1] 7846.03057 54.32056 NA 64.69308 60.91069 68.38884
[7] 105.88029 57.77888 98.04462 53.47130
> rowSd(tmp5,na.rm=TRUE)
[1] 88.577822 7.370248 NA 8.043201 7.804530 8.269754 10.289815
[8] 7.601242 9.901748 7.312408
> rowMax(tmp5,na.rm=TRUE)
[1] 465.57068 78.29356 NA 83.92142 86.56180 86.10412 89.20754
[8] 88.29803 87.10835 82.90910
> rowMin(tmp5,na.rm=TRUE)
[1] 58.33264 53.82222 NA 56.60337 59.60981 58.32972 55.17510 60.31765
[9] 54.66031 59.82625
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.49605 66.32474 68.56339 66.65351 70.59178 69.39175 71.46909
[8] 73.72702 71.73055 69.91627 72.03436 67.25407 71.46547 NaN
[15] 73.84565 69.92223 70.36344 75.67207 73.64159 69.45832
> colSums(tmp5,na.rm=TRUE)
[1] 1048.4644 596.9227 617.0705 599.8816 635.3260 624.5258 643.2218
[8] 663.5431 645.5749 629.2464 648.3093 605.2866 643.1892 0.0000
[15] 664.6109 629.3000 633.2710 681.0486 662.7743 625.1249
> colVars(tmp5,na.rm=TRUE)
[1] 17244.70002 66.05906 47.54499 56.55485 104.36435 79.37653
[7] 83.49778 43.23773 67.59868 66.96772 63.00971 47.62232
[13] 24.34746 NA 82.48707 112.30175 38.81813 44.22987
[19] 119.29183 108.55562
> colSd(tmp5,na.rm=TRUE)
[1] 131.319077 8.127673 6.895287 7.520296 10.215887 8.909351
[7] 9.137712 6.575540 8.221842 8.183381 7.937865 6.900892
[13] 4.934315 NA 9.082239 10.597252 6.230420 6.650554
[19] 10.922080 10.419003
> colMax(tmp5,na.rm=TRUE)
[1] 465.57068 81.93023 79.14678 81.48548 81.84653 84.03388 80.32171
[8] 80.65107 90.03020 84.06601 89.20754 77.70987 77.43508 -Inf
[15] 87.10835 85.77418 83.92142 84.76031 90.74486 88.29803
> colMin(tmp5,na.rm=TRUE)
[1] 59.44213 58.33264 56.43173 58.32972 53.82222 58.26202 55.17510 64.36284
[9] 62.87010 59.82625 61.87697 54.66031 61.38130 Inf 64.93192 55.23426
[17] 62.96763 66.89230 59.26223 61.35423
>
>
>
>
> 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] 266.84479 162.00982 205.08037 250.57803 260.99392 244.82554 347.80451
[8] 273.89924 294.26895 87.89495
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 266.84479 162.00982 205.08037 250.57803 260.99392 244.82554 347.80451
[8] 273.89924 294.26895 87.89495
>
>
>
> 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] -5.684342e-14 0.000000e+00 1.136868e-13 -2.842171e-14 1.136868e-13
[6] -2.842171e-14 -1.136868e-13 -2.842171e-14 -8.526513e-14 -1.421085e-13
[11] 0.000000e+00 0.000000e+00 0.000000e+00 -2.273737e-13 9.947598e-14
[16] 2.842171e-14 5.684342e-14 5.684342e-14 -2.842171e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
6 18
4 19
5 11
3 20
4 13
10 9
5 10
4 3
7 17
6 4
6 9
6 11
10 16
8 6
8 10
7 5
10 19
3 14
8 17
9 13
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.057915
> Min(tmp)
[1] -2.974063
> mean(tmp)
[1] -0.04262803
> Sum(tmp)
[1] -4.262803
> Var(tmp)
[1] 0.9103629
>
> rowMeans(tmp)
[1] -0.04262803
> rowSums(tmp)
[1] -4.262803
> rowVars(tmp)
[1] 0.9103629
> rowSd(tmp)
[1] 0.9541294
> rowMax(tmp)
[1] 2.057915
> rowMin(tmp)
[1] -2.974063
>
> colMeans(tmp)
[1] -0.4702014693 -1.5142042537 -1.0474459652 1.2158974867 -0.1963730365
[6] 1.7812716141 1.3450096809 -0.5416310362 -0.1178737295 -0.0967652783
[11] 0.3930832376 0.2257480792 0.4511231757 -0.4402992878 -0.1722896343
[16] -0.8688835621 -0.5615809164 -0.8804021325 -0.7395735533 0.1806514884
[21] -0.0306942953 -0.0545088562 1.6525110303 -1.2238066062 -0.5484922879
[26] -0.9626291188 0.5379943780 0.4066179677 1.6700919093 -0.7539178429
[31] 0.6388903693 2.0579154075 1.7045554110 0.5461054021 0.2834834141
[36] -1.2817258719 0.4452711157 0.9246179975 -1.0018944367 -1.0681923515
[41] 0.5474718156 -0.4533142688 -0.0448092937 -1.2280147139 -0.5776501782
[46] 0.9166685764 0.7608654636 0.0141607566 -0.8308830610 -1.6328874953
[51] -1.2563131055 0.4160591961 0.6866855600 -0.0740296670 0.2637800756
[56] 1.1466863747 0.3604593588 -0.5168057881 1.0268533007 0.0008621035
[61] 0.0247843810 0.8261104793 0.9036048710 0.7066045561 -0.0669847301
[66] -0.9345831045 -1.2219308010 0.5129700647 -0.4944424291 -0.6114784409
[71] -0.3930031496 -2.0653041627 -2.9740631368 -1.2837733799 1.6473346874
[76] -0.4771593137 0.3919544704 -1.9912530247 0.9058047577 -0.5525464663
[81] -0.0872002205 0.5921818036 -0.8550409232 0.3990427417 1.7048779324
[86] -1.2201752329 0.7526458347 1.4979798147 -0.9670945229 -1.0125565822
[91] 0.4175304349 0.8752191823 0.5047854954 0.2627962872 0.5397262022
[96] 0.5430639227 -0.1064889269 -0.7140245478 -0.6213045301 -1.0347119664
> colSums(tmp)
[1] -0.4702014693 -1.5142042537 -1.0474459652 1.2158974867 -0.1963730365
[6] 1.7812716141 1.3450096809 -0.5416310362 -0.1178737295 -0.0967652783
[11] 0.3930832376 0.2257480792 0.4511231757 -0.4402992878 -0.1722896343
[16] -0.8688835621 -0.5615809164 -0.8804021325 -0.7395735533 0.1806514884
[21] -0.0306942953 -0.0545088562 1.6525110303 -1.2238066062 -0.5484922879
[26] -0.9626291188 0.5379943780 0.4066179677 1.6700919093 -0.7539178429
[31] 0.6388903693 2.0579154075 1.7045554110 0.5461054021 0.2834834141
[36] -1.2817258719 0.4452711157 0.9246179975 -1.0018944367 -1.0681923515
[41] 0.5474718156 -0.4533142688 -0.0448092937 -1.2280147139 -0.5776501782
[46] 0.9166685764 0.7608654636 0.0141607566 -0.8308830610 -1.6328874953
[51] -1.2563131055 0.4160591961 0.6866855600 -0.0740296670 0.2637800756
[56] 1.1466863747 0.3604593588 -0.5168057881 1.0268533007 0.0008621035
[61] 0.0247843810 0.8261104793 0.9036048710 0.7066045561 -0.0669847301
[66] -0.9345831045 -1.2219308010 0.5129700647 -0.4944424291 -0.6114784409
[71] -0.3930031496 -2.0653041627 -2.9740631368 -1.2837733799 1.6473346874
[76] -0.4771593137 0.3919544704 -1.9912530247 0.9058047577 -0.5525464663
[81] -0.0872002205 0.5921818036 -0.8550409232 0.3990427417 1.7048779324
[86] -1.2201752329 0.7526458347 1.4979798147 -0.9670945229 -1.0125565822
[91] 0.4175304349 0.8752191823 0.5047854954 0.2627962872 0.5397262022
[96] 0.5430639227 -0.1064889269 -0.7140245478 -0.6213045301 -1.0347119664
> 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.4702014693 -1.5142042537 -1.0474459652 1.2158974867 -0.1963730365
[6] 1.7812716141 1.3450096809 -0.5416310362 -0.1178737295 -0.0967652783
[11] 0.3930832376 0.2257480792 0.4511231757 -0.4402992878 -0.1722896343
[16] -0.8688835621 -0.5615809164 -0.8804021325 -0.7395735533 0.1806514884
[21] -0.0306942953 -0.0545088562 1.6525110303 -1.2238066062 -0.5484922879
[26] -0.9626291188 0.5379943780 0.4066179677 1.6700919093 -0.7539178429
[31] 0.6388903693 2.0579154075 1.7045554110 0.5461054021 0.2834834141
[36] -1.2817258719 0.4452711157 0.9246179975 -1.0018944367 -1.0681923515
[41] 0.5474718156 -0.4533142688 -0.0448092937 -1.2280147139 -0.5776501782
[46] 0.9166685764 0.7608654636 0.0141607566 -0.8308830610 -1.6328874953
[51] -1.2563131055 0.4160591961 0.6866855600 -0.0740296670 0.2637800756
[56] 1.1466863747 0.3604593588 -0.5168057881 1.0268533007 0.0008621035
[61] 0.0247843810 0.8261104793 0.9036048710 0.7066045561 -0.0669847301
[66] -0.9345831045 -1.2219308010 0.5129700647 -0.4944424291 -0.6114784409
[71] -0.3930031496 -2.0653041627 -2.9740631368 -1.2837733799 1.6473346874
[76] -0.4771593137 0.3919544704 -1.9912530247 0.9058047577 -0.5525464663
[81] -0.0872002205 0.5921818036 -0.8550409232 0.3990427417 1.7048779324
[86] -1.2201752329 0.7526458347 1.4979798147 -0.9670945229 -1.0125565822
[91] 0.4175304349 0.8752191823 0.5047854954 0.2627962872 0.5397262022
[96] 0.5430639227 -0.1064889269 -0.7140245478 -0.6213045301 -1.0347119664
> colMin(tmp)
[1] -0.4702014693 -1.5142042537 -1.0474459652 1.2158974867 -0.1963730365
[6] 1.7812716141 1.3450096809 -0.5416310362 -0.1178737295 -0.0967652783
[11] 0.3930832376 0.2257480792 0.4511231757 -0.4402992878 -0.1722896343
[16] -0.8688835621 -0.5615809164 -0.8804021325 -0.7395735533 0.1806514884
[21] -0.0306942953 -0.0545088562 1.6525110303 -1.2238066062 -0.5484922879
[26] -0.9626291188 0.5379943780 0.4066179677 1.6700919093 -0.7539178429
[31] 0.6388903693 2.0579154075 1.7045554110 0.5461054021 0.2834834141
[36] -1.2817258719 0.4452711157 0.9246179975 -1.0018944367 -1.0681923515
[41] 0.5474718156 -0.4533142688 -0.0448092937 -1.2280147139 -0.5776501782
[46] 0.9166685764 0.7608654636 0.0141607566 -0.8308830610 -1.6328874953
[51] -1.2563131055 0.4160591961 0.6866855600 -0.0740296670 0.2637800756
[56] 1.1466863747 0.3604593588 -0.5168057881 1.0268533007 0.0008621035
[61] 0.0247843810 0.8261104793 0.9036048710 0.7066045561 -0.0669847301
[66] -0.9345831045 -1.2219308010 0.5129700647 -0.4944424291 -0.6114784409
[71] -0.3930031496 -2.0653041627 -2.9740631368 -1.2837733799 1.6473346874
[76] -0.4771593137 0.3919544704 -1.9912530247 0.9058047577 -0.5525464663
[81] -0.0872002205 0.5921818036 -0.8550409232 0.3990427417 1.7048779324
[86] -1.2201752329 0.7526458347 1.4979798147 -0.9670945229 -1.0125565822
[91] 0.4175304349 0.8752191823 0.5047854954 0.2627962872 0.5397262022
[96] 0.5430639227 -0.1064889269 -0.7140245478 -0.6213045301 -1.0347119664
> colMedians(tmp)
[1] -0.4702014693 -1.5142042537 -1.0474459652 1.2158974867 -0.1963730365
[6] 1.7812716141 1.3450096809 -0.5416310362 -0.1178737295 -0.0967652783
[11] 0.3930832376 0.2257480792 0.4511231757 -0.4402992878 -0.1722896343
[16] -0.8688835621 -0.5615809164 -0.8804021325 -0.7395735533 0.1806514884
[21] -0.0306942953 -0.0545088562 1.6525110303 -1.2238066062 -0.5484922879
[26] -0.9626291188 0.5379943780 0.4066179677 1.6700919093 -0.7539178429
[31] 0.6388903693 2.0579154075 1.7045554110 0.5461054021 0.2834834141
[36] -1.2817258719 0.4452711157 0.9246179975 -1.0018944367 -1.0681923515
[41] 0.5474718156 -0.4533142688 -0.0448092937 -1.2280147139 -0.5776501782
[46] 0.9166685764 0.7608654636 0.0141607566 -0.8308830610 -1.6328874953
[51] -1.2563131055 0.4160591961 0.6866855600 -0.0740296670 0.2637800756
[56] 1.1466863747 0.3604593588 -0.5168057881 1.0268533007 0.0008621035
[61] 0.0247843810 0.8261104793 0.9036048710 0.7066045561 -0.0669847301
[66] -0.9345831045 -1.2219308010 0.5129700647 -0.4944424291 -0.6114784409
[71] -0.3930031496 -2.0653041627 -2.9740631368 -1.2837733799 1.6473346874
[76] -0.4771593137 0.3919544704 -1.9912530247 0.9058047577 -0.5525464663
[81] -0.0872002205 0.5921818036 -0.8550409232 0.3990427417 1.7048779324
[86] -1.2201752329 0.7526458347 1.4979798147 -0.9670945229 -1.0125565822
[91] 0.4175304349 0.8752191823 0.5047854954 0.2627962872 0.5397262022
[96] 0.5430639227 -0.1064889269 -0.7140245478 -0.6213045301 -1.0347119664
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.4702015 -1.514204 -1.047446 1.215897 -0.196373 1.781272 1.34501
[2,] -0.4702015 -1.514204 -1.047446 1.215897 -0.196373 1.781272 1.34501
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.541631 -0.1178737 -0.09676528 0.3930832 0.2257481 0.4511232 -0.4402993
[2,] -0.541631 -0.1178737 -0.09676528 0.3930832 0.2257481 0.4511232 -0.4402993
[,15] [,16] [,17] [,18] [,19] [,20]
[1,] -0.1722896 -0.8688836 -0.5615809 -0.8804021 -0.7395736 0.1806515
[2,] -0.1722896 -0.8688836 -0.5615809 -0.8804021 -0.7395736 0.1806515
[,21] [,22] [,23] [,24] [,25] [,26] [,27]
[1,] -0.0306943 -0.05450886 1.652511 -1.223807 -0.5484923 -0.9626291 0.5379944
[2,] -0.0306943 -0.05450886 1.652511 -1.223807 -0.5484923 -0.9626291 0.5379944
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] 0.406618 1.670092 -0.7539178 0.6388904 2.057915 1.704555 0.5461054
[2,] 0.406618 1.670092 -0.7539178 0.6388904 2.057915 1.704555 0.5461054
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] 0.2834834 -1.281726 0.4452711 0.924618 -1.001894 -1.068192 0.5474718
[2,] 0.2834834 -1.281726 0.4452711 0.924618 -1.001894 -1.068192 0.5474718
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.4533143 -0.04480929 -1.228015 -0.5776502 0.9166686 0.7608655 0.01416076
[2,] -0.4533143 -0.04480929 -1.228015 -0.5776502 0.9166686 0.7608655 0.01416076
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.8308831 -1.632887 -1.256313 0.4160592 0.6866856 -0.07402967 0.2637801
[2,] -0.8308831 -1.632887 -1.256313 0.4160592 0.6866856 -0.07402967 0.2637801
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 1.146686 0.3604594 -0.5168058 1.026853 0.0008621035 0.02478438 0.8261105
[2,] 1.146686 0.3604594 -0.5168058 1.026853 0.0008621035 0.02478438 0.8261105
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.9036049 0.7066046 -0.06698473 -0.9345831 -1.221931 0.5129701 -0.4944424
[2,] 0.9036049 0.7066046 -0.06698473 -0.9345831 -1.221931 0.5129701 -0.4944424
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -0.6114784 -0.3930031 -2.065304 -2.974063 -1.283773 1.647335 -0.4771593
[2,] -0.6114784 -0.3930031 -2.065304 -2.974063 -1.283773 1.647335 -0.4771593
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.3919545 -1.991253 0.9058048 -0.5525465 -0.08720022 0.5921818 -0.8550409
[2,] 0.3919545 -1.991253 0.9058048 -0.5525465 -0.08720022 0.5921818 -0.8550409
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.3990427 1.704878 -1.220175 0.7526458 1.49798 -0.9670945 -1.012557
[2,] 0.3990427 1.704878 -1.220175 0.7526458 1.49798 -0.9670945 -1.012557
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.4175304 0.8752192 0.5047855 0.2627963 0.5397262 0.5430639 -0.1064889
[2,] 0.4175304 0.8752192 0.5047855 0.2627963 0.5397262 0.5430639 -0.1064889
[,98] [,99] [,100]
[1,] -0.7140245 -0.6213045 -1.034712
[2,] -0.7140245 -0.6213045 -1.034712
>
>
> Max(tmp2)
[1] 2.499937
> Min(tmp2)
[1] -2.463065
> mean(tmp2)
[1] -0.02571508
> Sum(tmp2)
[1] -2.571508
> Var(tmp2)
[1] 0.8048735
>
> rowMeans(tmp2)
[1] -0.26193008 -0.12676950 -0.87692521 0.15307323 -0.08773901 -1.30856831
[7] -0.08469593 0.20166926 -0.19859254 -0.07650910 1.22429350 -0.50994878
[13] -0.05428564 0.44268891 -0.21973098 -1.18575019 -0.17449359 -1.42798305
[19] -0.76888394 -0.29768597 1.52594862 0.45006441 -0.07540414 -0.15871989
[25] 0.08598743 1.70693780 -2.46306510 -0.41989447 0.73358036 0.62870026
[31] 0.41381220 0.95227433 0.95424655 0.07289352 0.69820873 -0.32308702
[37] 0.48502039 0.18344700 -0.49927940 1.11219289 -1.48187762 0.05303622
[43] 1.65136586 -1.24141630 0.37932793 -0.48549161 0.82655236 0.89192778
[49] 0.02368033 -0.80374500 -0.05633468 0.16642795 0.12662658 -1.77689758
[55] 0.68593220 -0.49083977 -0.69073340 0.23540912 -0.69202753 -0.32368618
[61] -0.19116434 1.43755892 -0.29852673 -0.89289930 1.31953759 -0.39814993
[67] -1.86008204 -1.16216189 0.47013769 -1.67158329 0.36703311 0.09360412
[73] -0.59972979 -0.24659448 -0.37593419 0.92285989 0.42275334 -0.58534443
[79] 1.74692648 -0.04328080 0.47901474 -0.47508137 0.82881720 -1.00919021
[85] 0.16837115 0.15013609 -0.48478576 0.44448065 -1.35370685 2.49993681
[91] -0.06224366 0.77686358 -0.40417510 0.72686401 -1.77258372 0.14097380
[97] 0.02171914 0.93349018 1.70103779 -1.75874066
> rowSums(tmp2)
[1] -0.26193008 -0.12676950 -0.87692521 0.15307323 -0.08773901 -1.30856831
[7] -0.08469593 0.20166926 -0.19859254 -0.07650910 1.22429350 -0.50994878
[13] -0.05428564 0.44268891 -0.21973098 -1.18575019 -0.17449359 -1.42798305
[19] -0.76888394 -0.29768597 1.52594862 0.45006441 -0.07540414 -0.15871989
[25] 0.08598743 1.70693780 -2.46306510 -0.41989447 0.73358036 0.62870026
[31] 0.41381220 0.95227433 0.95424655 0.07289352 0.69820873 -0.32308702
[37] 0.48502039 0.18344700 -0.49927940 1.11219289 -1.48187762 0.05303622
[43] 1.65136586 -1.24141630 0.37932793 -0.48549161 0.82655236 0.89192778
[49] 0.02368033 -0.80374500 -0.05633468 0.16642795 0.12662658 -1.77689758
[55] 0.68593220 -0.49083977 -0.69073340 0.23540912 -0.69202753 -0.32368618
[61] -0.19116434 1.43755892 -0.29852673 -0.89289930 1.31953759 -0.39814993
[67] -1.86008204 -1.16216189 0.47013769 -1.67158329 0.36703311 0.09360412
[73] -0.59972979 -0.24659448 -0.37593419 0.92285989 0.42275334 -0.58534443
[79] 1.74692648 -0.04328080 0.47901474 -0.47508137 0.82881720 -1.00919021
[85] 0.16837115 0.15013609 -0.48478576 0.44448065 -1.35370685 2.49993681
[91] -0.06224366 0.77686358 -0.40417510 0.72686401 -1.77258372 0.14097380
[97] 0.02171914 0.93349018 1.70103779 -1.75874066
> 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.26193008 -0.12676950 -0.87692521 0.15307323 -0.08773901 -1.30856831
[7] -0.08469593 0.20166926 -0.19859254 -0.07650910 1.22429350 -0.50994878
[13] -0.05428564 0.44268891 -0.21973098 -1.18575019 -0.17449359 -1.42798305
[19] -0.76888394 -0.29768597 1.52594862 0.45006441 -0.07540414 -0.15871989
[25] 0.08598743 1.70693780 -2.46306510 -0.41989447 0.73358036 0.62870026
[31] 0.41381220 0.95227433 0.95424655 0.07289352 0.69820873 -0.32308702
[37] 0.48502039 0.18344700 -0.49927940 1.11219289 -1.48187762 0.05303622
[43] 1.65136586 -1.24141630 0.37932793 -0.48549161 0.82655236 0.89192778
[49] 0.02368033 -0.80374500 -0.05633468 0.16642795 0.12662658 -1.77689758
[55] 0.68593220 -0.49083977 -0.69073340 0.23540912 -0.69202753 -0.32368618
[61] -0.19116434 1.43755892 -0.29852673 -0.89289930 1.31953759 -0.39814993
[67] -1.86008204 -1.16216189 0.47013769 -1.67158329 0.36703311 0.09360412
[73] -0.59972979 -0.24659448 -0.37593419 0.92285989 0.42275334 -0.58534443
[79] 1.74692648 -0.04328080 0.47901474 -0.47508137 0.82881720 -1.00919021
[85] 0.16837115 0.15013609 -0.48478576 0.44448065 -1.35370685 2.49993681
[91] -0.06224366 0.77686358 -0.40417510 0.72686401 -1.77258372 0.14097380
[97] 0.02171914 0.93349018 1.70103779 -1.75874066
> rowMin(tmp2)
[1] -0.26193008 -0.12676950 -0.87692521 0.15307323 -0.08773901 -1.30856831
[7] -0.08469593 0.20166926 -0.19859254 -0.07650910 1.22429350 -0.50994878
[13] -0.05428564 0.44268891 -0.21973098 -1.18575019 -0.17449359 -1.42798305
[19] -0.76888394 -0.29768597 1.52594862 0.45006441 -0.07540414 -0.15871989
[25] 0.08598743 1.70693780 -2.46306510 -0.41989447 0.73358036 0.62870026
[31] 0.41381220 0.95227433 0.95424655 0.07289352 0.69820873 -0.32308702
[37] 0.48502039 0.18344700 -0.49927940 1.11219289 -1.48187762 0.05303622
[43] 1.65136586 -1.24141630 0.37932793 -0.48549161 0.82655236 0.89192778
[49] 0.02368033 -0.80374500 -0.05633468 0.16642795 0.12662658 -1.77689758
[55] 0.68593220 -0.49083977 -0.69073340 0.23540912 -0.69202753 -0.32368618
[61] -0.19116434 1.43755892 -0.29852673 -0.89289930 1.31953759 -0.39814993
[67] -1.86008204 -1.16216189 0.47013769 -1.67158329 0.36703311 0.09360412
[73] -0.59972979 -0.24659448 -0.37593419 0.92285989 0.42275334 -0.58534443
[79] 1.74692648 -0.04328080 0.47901474 -0.47508137 0.82881720 -1.00919021
[85] 0.16837115 0.15013609 -0.48478576 0.44448065 -1.35370685 2.49993681
[91] -0.06224366 0.77686358 -0.40417510 0.72686401 -1.77258372 0.14097380
[97] 0.02171914 0.93349018 1.70103779 -1.75874066
>
> colMeans(tmp2)
[1] -0.02571508
> colSums(tmp2)
[1] -2.571508
> colVars(tmp2)
[1] 0.8048735
> colSd(tmp2)
[1] 0.8971474
> colMax(tmp2)
[1] 2.499937
> colMin(tmp2)
[1] -2.463065
> colMedians(tmp2)
[1] -0.05531016
> colRanges(tmp2)
[,1]
[1,] -2.463065
[2,] 2.499937
>
> 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] 7.17466666 1.51987028 0.95633208 -4.81084964 -8.62085343 0.05186354
[7] 3.27039581 -0.01964774 0.12789069 -1.24442141
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.5235992
[2,] -0.1196815
[3,] 0.7603219
[4,] 1.1721203
[5,] 2.1686205
>
> rowApply(tmp,sum)
[1] -2.1625414 -0.1342107 -3.5586459 3.3035133 1.1892309 -1.0595887
[7] 0.9002460 5.3466138 -0.5820885 -4.8372819
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 9 5 9 5 8 4 10 9 9
[2,] 3 6 10 7 2 10 8 3 7 3
[3,] 9 8 9 5 10 7 3 1 3 6
[4,] 7 4 2 2 8 4 1 5 6 2
[5,] 1 5 3 1 4 3 2 6 1 1
[6,] 2 10 7 3 1 2 7 7 10 8
[7,] 5 2 8 4 6 9 9 2 8 10
[8,] 8 7 6 8 9 1 5 4 5 5
[9,] 4 3 4 6 3 6 10 9 4 7
[10,] 6 1 1 10 7 5 6 8 2 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.27504807 -2.75070560 1.98073554 -2.37876796 3.17444296 0.01561413
[7] 2.19593668 -2.77385873 -1.19947001 1.68597549 6.29944242 -0.33994354
[13] -1.98137346 2.06701290 5.46052407 0.70435711 -0.80651773 -3.36236244
[19] 3.05778763 -2.53199427
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3660477
[2,] -0.7819609
[3,] -0.1716945
[4,] 0.4292753
[5,] 0.6153797
>
> rowApply(tmp,sum)
[1] 5.445179 -2.325085 1.454441 -3.635259 6.302512
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 4 3 4 15 13
[2,] 10 2 8 11 2
[3,] 12 10 19 16 8
[4,] 15 12 1 4 6
[5,] 16 18 20 12 12
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.1716945 0.2022916 0.47081252 0.65377971 0.667092511 0.9763263
[2,] -1.3660477 -1.6343049 -0.03873229 0.05769705 1.007613043 -0.7728774
[3,] -0.7819609 -0.1900618 1.02538262 -1.39609184 1.071512561 0.7603875
[4,] 0.4292753 -0.1538429 0.54877491 -1.31320055 -0.001472576 -2.0340845
[5,] 0.6153797 -0.9747876 -0.02550221 -0.38095233 0.429697425 1.0858623
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.7999442 -0.0683211 -0.02224031 0.1791133 1.1199770 1.3443008
[2,] 0.4004284 -1.3480209 -0.01262725 1.2940002 0.6948310 -1.6973207
[3,] 0.7825236 -0.3051710 -0.68060317 0.3494955 0.8535471 0.6272094
[4,] 0.7991977 -0.8080492 -0.56080228 -1.3457786 1.2465695 -1.0374342
[5,] -0.5861572 -0.2442965 0.07680300 1.2091451 2.3845178 0.4233012
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.05845252 0.4896511 0.5960485 -1.12789504 -0.5057074 -0.09854835
[2,] -0.20305684 0.5768018 1.7514469 0.23140957 -0.2518374 -0.31868455
[3,] -1.09493262 0.7220983 0.3098371 -0.13396744 -1.1119428 -0.39470391
[4,] 0.12833395 -0.3443155 0.2310992 1.70993500 -0.5563448 -0.60922463
[5,] -0.75326543 0.6227771 2.5720923 0.02487503 1.6193146 -1.94120100
[,19] [,20]
[1,] -0.4498530 0.4485537
[2,] 0.2994083 -0.9952112
[3,] 0.5145507 0.5273318
[4,] 1.6358911 -1.5997862
[5,] 1.0577905 -0.9128823
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/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: /Users/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: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/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.570741 -0.5536664 0.2140707 1.169098 0.02941916 -0.6631223 1.031151
col8 col9 col10 col11 col12 col13 col14
row1 -0.8436448 -1.2648 0.7207717 0.2720536 -0.958633 0.6272726 0.415224
col15 col16 col17 col18 col19 col20
row1 -0.6938582 -0.2566422 -1.087975 0.2759027 -0.4647207 1.247393
> tmp[,"col10"]
col10
row1 0.7207717
row2 -1.0158841
row3 -0.7673625
row4 1.7456786
row5 -1.0935952
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.5707410 -0.55366637 0.2140707 1.1690982 0.02941916 -0.6631223
row5 -0.5836259 -0.02094405 1.5446532 -0.5372241 -0.14396480 1.5040290
col7 col8 col9 col10 col11 col12 col13
row1 1.031151 -0.8436448 -1.2647995 0.7207717 0.2720536 -0.9586330 0.6272726
row5 -1.518312 0.9922236 0.7673996 -1.0935952 1.6770361 -0.9772034 0.5454828
col14 col15 col16 col17 col18 col19
row1 0.4152240 -0.6938582 -0.2566422 -1.0879752 0.2759027 -0.4647207
row5 -0.1063261 0.2343672 2.1078216 -0.0570919 -0.4528007 0.4847816
col20
row1 1.247393
row5 -0.215788
> tmp[,c("col6","col20")]
col6 col20
row1 -0.6631223 1.24739333
row2 1.9688349 -2.91558745
row3 1.6063190 0.03867267
row4 2.5023467 0.81423216
row5 1.5040290 -0.21578798
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.6631223 1.247393
row5 1.5040290 -0.215788
>
>
>
>
> 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.38474 51.48729 51.42518 50.66977 49.85132 104.9247 50.33148 49.52053
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.35404 50.23441 48.93446 51.66793 49.66436 49.47934 50.16672 49.50146
col17 col18 col19 col20
row1 48.81761 49.45352 49.83179 104.1645
> tmp[,"col10"]
col10
row1 50.23441
row2 29.51937
row3 30.11778
row4 30.14081
row5 49.50806
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.38474 51.48729 51.42518 50.66977 49.85132 104.9247 50.33148 49.52053
row5 50.71923 51.80908 49.43319 50.02576 48.01156 103.0132 49.29167 51.00804
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.35404 50.23441 48.93446 51.66793 49.66436 49.47934 50.16672 49.50146
row5 51.54044 49.50806 49.30300 49.92929 49.45389 49.75021 51.55519 52.17056
col17 col18 col19 col20
row1 48.81761 49.45352 49.83179 104.1645
row5 49.80501 50.03813 50.09065 106.4883
> tmp[,c("col6","col20")]
col6 col20
row1 104.92473 104.16453
row2 74.81410 75.30887
row3 75.47173 75.91495
row4 76.16156 72.83863
row5 103.01318 106.48831
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.9247 104.1645
row5 103.0132 106.4883
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.9247 104.1645
row5 103.0132 106.4883
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.5892122
[2,] -1.1233569
[3,] -0.4868520
[4,] -0.6279073
[5,] 0.8859768
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.33662702 0.5936699
[2,] 0.01636654 0.2817192
[3,] -2.03775803 1.6676477
[4,] 1.97014824 2.4051381
[5,] 0.49858745 0.3682673
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.3866049 -0.05541815
[2,] 0.1846515 -1.21250687
[3,] -0.3662746 -0.58714232
[4,] -0.7701600 0.21120206
[5,] -0.2444438 -1.37352733
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.386605
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.3866049
[2,] 0.1846515
>
>
>
> 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] [,7]
row3 -0.88662230 -2.141875 0.4424092 1.3618147 0.2601518 2.6018025 0.5739398
row1 0.06662611 0.449011 -0.9970888 0.1397304 0.3333300 0.4296586 1.1438981
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.1738380 0.6490833 1.515044 -1.3962059 0.74734205 0.2116052 1.038319
row1 0.1874228 1.7925882 2.177262 -0.6435693 0.06654442 -0.5713216 1.035173
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.5169855 -0.930696 1.231940 -0.5776176 -0.2811202 -1.246531
row1 -0.0425018 -1.119010 -1.108915 0.3770127 -2.1430169 1.096664
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.13551 -0.06361637 0.1827135 -0.2264926 0.3007516 -0.5469244 1.066385
[,8] [,9] [,10]
row2 -0.3221995 -0.02616159 -0.8066028
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.1909125 -0.09836786 0.2037295 0.2529072 -0.8617493 0.2587244 -0.697261
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.157473 0.830469 -0.273531 0.5591103 -1.122143 -1.58416 -0.4407532
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.072727 -0.3241823 -2.004316 0.279475 1.517394 0.4752307
>
>
> 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: 0x60000031c000>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a432057d9b"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a467964c5"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a4bc6c4d5"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a426a481fd"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a47a521cdc"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a424e4ee41"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a431d60053"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a458af62b4"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a4627944e8"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a479b0dda"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a454aa671c"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a47f578ab0"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a44c526a20"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a436b58205"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMb9a4466b3252"
>
>
> ### 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: 0x6000003d8000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000003d8000>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000003d8000>
> rowMedians(tmp)
[1] 0.168264779 -0.352578088 -0.277211823 0.482136302 -0.595757207
[6] -0.142307147 0.200279223 0.141354333 0.395334374 0.327912839
[11] -0.617477891 0.033022291 0.020881173 0.234232016 0.036823161
[16] -0.190468077 0.094230135 -0.257588493 0.360276155 0.058593563
[21] -0.424817464 -0.682506528 0.026861167 -0.190420060 -0.013488621
[26] 0.142408068 0.526564914 0.303379857 -0.365427999 0.182736059
[31] 0.268448600 0.335905331 -0.026854095 0.345286855 0.624337058
[36] 0.382669248 -0.107938188 -0.398259836 0.134971997 0.351549352
[41] 0.523152077 0.090053464 0.054623148 0.203700707 -0.513703858
[46] 0.012568660 -0.137490500 -0.096951758 0.282849565 -0.005762483
[51] 0.431842837 0.067014503 0.309310538 0.285331494 0.223276180
[56] 0.018286103 -0.216690407 -0.150670906 -0.230896835 -0.397129500
[61] 0.395999818 0.197207806 -0.145176069 0.493264743 0.096018445
[66] -0.444500776 0.154859806 -0.396371876 -0.610670641 -0.001618696
[71] -0.129800652 0.242234691 0.058949671 0.276890429 -0.119979634
[76] -0.155452762 0.537584302 0.107286672 0.195599808 0.007154170
[81] 0.013023349 0.186921909 0.114973905 0.161919285 -0.386196494
[86] 0.123405318 0.412957596 -0.113136437 0.786259190 -0.286242490
[91] 0.293702733 -0.247813818 -0.986891187 0.374857425 -0.171098834
[96] -0.114096111 -0.063009180 0.419729957 0.276279217 0.481550547
[101] -0.294531789 0.505735195 -0.473447704 -0.031021880 0.162207701
[106] 0.454642459 0.766973825 0.405263569 0.482806539 0.358885256
[111] 0.223139172 0.342576459 0.037792826 0.164296668 0.307497324
[116] 0.062654191 -0.293937304 0.007219336 0.037365171 -0.287347136
[121] -0.075015048 0.239186511 0.199422347 -0.174394233 -0.114910226
[126] -0.331694847 -0.476221049 0.343023829 -0.403639002 0.073882579
[131] -0.099924799 0.500305386 0.144920271 0.396869431 0.219839640
[136] -0.155622465 -0.006896515 0.160821223 0.008267811 0.381778279
[141] 0.018121488 0.513046749 0.104620265 -0.210679165 0.555911121
[146] 0.382458126 -0.150523493 0.315759976 -0.360425442 -0.257745130
[151] 0.314879379 0.253705382 -0.290706817 -0.426170256 -0.110421420
[156] 0.012620553 -0.309668881 0.023011449 0.069986501 0.134407648
[161] 0.374261524 0.600053404 0.007341958 -0.235163389 0.192437090
[166] 0.289422367 0.492152425 0.557984222 -0.115206641 -0.217891988
[171] -0.115175588 0.361222997 -0.291021020 -0.525757771 -0.166858417
[176] 0.345702895 -0.030221369 0.262529513 0.237606924 0.600520099
[181] -0.171755161 -0.672334673 0.102641606 0.104584912 -0.104003980
[186] 0.414469647 0.250101539 0.102298379 0.284311707 0.093882400
[191] -0.137177244 0.158754901 -0.155831345 -0.052166514 -0.194010251
[196] 0.292924358 0.023315966 -0.527305760 -0.049824331 -0.102030387
[201] -0.162112560 -0.157314518 0.296762687 -0.273949223 0.218696663
[206] 0.410563983 0.017170655 -0.052696097 -0.238710212 0.288651584
[211] -0.104753458 -0.381728729 0.553679340 -0.150220620 -0.507142159
[216] 0.564202516 -0.445376679 0.225012490 0.450042879 -0.095359767
[221] 0.425853663 -0.157959094 -0.416678648 0.136900418 -0.133435366
[226] -0.342571174 -0.478389693 -0.311485748 0.139913891 0.427832328
>
> proc.time()
user system elapsed
2.772 16.365 19.846
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
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: 0x600002184000>
> .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: 0x600002184000>
> .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: 0x600002184000>
> .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: 0x600002184000>
> 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: 0x600002198000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002198000>
> .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: 0x600002198000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002198000>
> .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: 0x600002198000>
> 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: 0x600002198180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002198180>
> .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: 0x600002198180>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002198180>
> .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: 0x600002198180>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600002198180>
> .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: 0x600002198180>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600002198180>
> .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: 0x600002198180>
> 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: 0x600002194000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002194000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002194000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002194000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilebf683c8c37e7" "BufferedMatrixFilebf687675fe53"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilebf683c8c37e7" "BufferedMatrixFilebf687675fe53"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000021d00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000021d00c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000021d00c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000021d00c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000021d00c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000021d00c0>
> .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: 0x6000021f8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000021f8180>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000021f8180>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000021f8180>
> 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: 0x6000021f8300>
> .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: 0x6000021f8300>
> rm(P)
>
> proc.time()
user system elapsed
0.345 0.150 0.487
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20
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.377 0.100 0.470