The vt generic does a matrix or array transpose by modifying virtual attributes rather than by physically copying matrix elements.

vt(x, ...)
# S3 method for class 'ff'
vt(x, ...)
# Default S3 method
vt(x, ...)
# S3 method for class 'ff'
t(x)

Arguments

x

an ff or ram object

...

further arguments (not used)

Details

The vt.ff method does transpose through reversing dim.ff and dimorder. The vt.default method is a wrapper to the standard transpose t.
The t.ff method creates a transposed clone.
If x has a virtual window vw defined, vt.ff returns an ff object with a transposed virtual window, the t.ff method return a transposed clone of the virtual window content only.

Value

an object that behaves like a transposed matrix

Author

Jens Oehlschlägel

See also

Examples

  x <- ff(1:20, dim=c(4,5))
  x
#> ff (open) integer length=20 (20) dim=c(4,5) dimorder=c(1,2)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    5    9   13   17
#> [2,]    2    6   10   14   18
#> [3,]    3    7   11   15   19
#> [4,]    4    8   12   16   20
  vt(x)
#> ff (open) integer length=20 (20) dim=c(5,4) dimorder=c(2,1)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    2    3    4
#> [2,]    5    6    7    8
#> [3,]    9   10   11   12
#> [4,]   13   14   15   16
#> [5,]   17   18   19   20
  y <- t(x)
  y
#> ff (open) integer length=20 (20) dim=c(5,4) dimorder=c(2,1)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    2    3    4
#> [2,]    5    6    7    8
#> [3,]    9   10   11   12
#> [4,]   13   14   15   16
#> [5,]   17   18   19   20
  vw(x) <- cbind(c(1,3,0),c(1,4,0))
  x
#> ff (open) integer length=12 (20) offset=c(1,1) dim=c(3,4) totaldim=c(4,5) dimorder=c(1,2)
#>      [,1] [,2] [,3] [,4]
#> [1,]    6   10   14   18
#> [2,]    7   11   15   19
#> [3,]    8   12   16   20
  vt(x)
#> ff (open) integer length=12 (20) offset=c(1,1) dim=c(4,3) totaldim=c(5,4) dimorder=c(2,1)
#>      [,1] [,2] [,3]
#> [1,]    6    7    8
#> [2,]   10   11   12
#> [3,]   14   15   16
#> [4,]   18   19   20
  y <- t(x)
  y
#> ff (open) integer length=12 (12) dim=c(4,3) dimorder=c(2,1)
#>      [,1] [,2] [,3]
#> [1,]    6    7    8
#> [2,]   10   11   12
#> [3,]   14   15   16
#> [4,]   18   19   20
  rm(x,y); gc()
#>           used (Mb) gc trigger  (Mb) max used  (Mb)
#> Ncells 1182159 63.2    1994352 106.6  1994352 106.6
#> Vcells 2206616 16.9    8790397  67.1  8790397  67.1