Replace parts of bigdist
bigdist_replace(x, i, j, value, k)
x | Object of class 'bigdist' |
---|---|
i | (integer vector) row positions |
j | (integer vector) column positions |
value | (integer/numeric vector) Values to replace |
k | (integer vector) positions |
bigdist object
There are two modes to specify the positions:
ij-mode where i and j are specified and k is missing. If i or j are missing, they are interpreted as all values of i or j (similar to matrix or dataframe subsetting). Lengths of i, j are required to be same. If 'value' is singleton, then it is extended to the length of i or j. Else, 'value' should have same length as i or j.
k-mode where k is present and both i and k are missing. k is the positions in the dist object. If 'value' is singleton, then it is extended to the length of k. Else, 'value' should have same length as k.
set.seed(1) amat <- matrix(rnorm(1e3), ncol = 10) td <- tempdir() temp <- bigdist(mat = amat, file = file.path(td, "temp_ex7"))#>#>#>#>#>#>bigdist_replace(temp, 1, 2, 10)#> $fbm #> A Filebacked Big Matrix of type 'float' with 100 rows and 100 columns. #> #> attr(,"class") #> [1] "bigdist"#> [,1] #> [1,] 10bigdist_replace(temp, 1:2, 3:4, 11:12)#> $fbm #> A Filebacked Big Matrix of type 'float' with 100 rows and 100 columns. #> #> attr(,"class") #> [1] "bigdist"#> [1] 11 12