| tileData | R Documentation |
Splits long and wide data files in lists of disjoint tiles for further processing.
tileData(readpath, writepath = NULL, rows, splits, ...)
readpath |
character length 1. Full path to the source file |
writepath |
character length 1. Full path to the destination file |
rows |
integer length 1. Number of rows in each subset. Internally, it determines the total number of subsets before the vertical split |
splits |
integer, length 1. Number of vertical data splits in each above subset. See splitV |
... |
extra arguments to splitH e.g. |
Facilitates local operations on small size tiles by partitioning the data horizontally and vertically.
The list of tiles can be written to disk as "rds" file when a writepath destination is given. The written
data can then be read entirely or in subsets (see Example 2).
NOTE: This utility uses background processing. Check "Security Considerations" in callr package documentation.
A listenv of "data.table" class tiles. When writepath is given, it produces
a "rds" file containing data tiles.
splitH, splitV, tileHot, readRDS
if (interactive()) {
# Make a 'csv' file
data(iris)
tmpf = tempfile(fileext = '.csv')
write.table(iris, tmpf , sep = ',', row.names = FALSE, quote = FALSE)
# 1. Tile data
a = tileData(tmpf, rows = 10, splits = 3) # 10x2 and 10x1 tiles
class(a) # listenv, environment
str(a) # nested list
tmpf1 = tempfile(fileext = '.rds') # new location
# 2. Write tiled data
tileData(tmpf, tmpf1, rows = 10, splits = 3)
a = readRDS(tmpf1)[[1]] # partial read from new location
print(a) # list component
unlink(tmpf)
unlink(tmpf1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.