extract_rectangle {autonomics} | R Documentation |
Extract rectangle from omics file, data.table, or matrix
extract_rectangle(x, ...) ## S3 method for class 'character' extract_rectangle( x, rows = seq_len(nrows(x, sheet = sheet)), cols = seq_len(ncols(x, sheet = sheet)), verbose = FALSE, transpose = FALSE, drop = FALSE, sheet = 1, ... ) ## S3 method for class 'data.table' extract_rectangle( x, rows = seq_len(nrow(x)), cols = seq_len(ncol(x)), transpose = FALSE, drop = FALSE, ... ) ## S3 method for class 'matrix' extract_rectangle( x, rows = seq_len(nrow(x)), cols = seq_len(ncol(x)), transpose = FALSE, drop = FALSE, ... )
x |
omics datafile or datatable |
... |
allow for S3 method dispatch |
rows |
numeric vector |
cols |
numeric vector |
verbose |
logical |
transpose |
logical |
drop |
logical |
sheet |
numeric or string |
matrix
# FROM FILE: extract_rectangle.character #======================================= # exprs require(magrittr) x <- download_data('halama18.metabolon.xlsx') extract_rectangle(x, rows = 11:401, cols = 15:86, sheet = 2) %>% extract(1:3, 1:3) # fids extract_rectangle(x, rows = 11:401, cols = 5, sheet = 2) %>% extract(1:3, ) # sids extract_rectangle(x, rows = 2, cols = 15:86, sheet = 2) %>% extract(,1:3) # fdata extract_rectangle(x, rows = 10:401, cols = 1:14, sheet = 2) %>% extract(1:3, 1:3) # sdata extract_rectangle(x, rows = 1:10, cols = 14:86, sheet = 2, transpose = TRUE) %>% extract(1:3, 1:3) # FROM MATRIX: extract_rectangle.matrix #====================================== # exprs x <-download_data('halama18.metabolon.xlsx') %>% extract_rectangle(sheet = 2) extract_rectangle(x, rows = 11:401, cols = 15:86, sheet = 2) %>% extract(1:3, 1:3) # fids extract_rectangle(x, rows = 11:401, cols = 5, sheet = 2) %>% extract(1:3, ) # sids extract_rectangle(x, rows = 2, cols = 15:86, sheet = 2) %>% extract(,1:3) # fdata extract_rectangle(x, rows = 10:401, cols = 1:14, sheet = 2) %>% extract(1:3, 1:3) # sdata extract_rectangle(x, rows = 1:10, cols = 14:86, sheet = 2, transpose = TRUE) %>% extract(1:3, 1:3)