Title: | compression for very small Strings |
---|---|
Description: | This package implements short string compression algorithms. |
Authors: | David Schoch [aut, cre] , Salvatore Sanfilippo [cph] (Author of SMAZ library), Arundale Ramanathan [cph] (Author of Unishox2 library) |
Maintainer: | David Schoch <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-10-25 05:16:02 UTC |
Source: | https://github.com/schochastics/strzip |
strzip class access vector
## S3 method for class 'strzip' x[i]
## S3 method for class 'strzip' x[i]
x |
character |
i |
element |
strzip class access list
## S3 method for class 'strzip' x[[i]]
## S3 method for class 'strzip' x[[i]]
x |
character |
i |
element |
strzip class assign
## S3 replacement method for class 'strzip' x[i] <- value
## S3 replacement method for class 'strzip' x[i] <- value
x |
character |
i |
element |
value |
value |
Encode strzip
## S3 method for class 'strzip' format(x, ...)
## S3 method for class 'strzip' format(x, ...)
x |
strzip object |
... |
urther arguments passed to or from other methods. |
Print a compressed string
## S3 method for class 'strzip' print(x, ...)
## S3 method for class 'strzip' print(x, ...)
x |
A compressed string object |
... |
additional arguments to print |
This function compresses each string in a vector using the Unishox2 compression algorithm.
str_compress(x)
str_compress(x)
x |
A character vector of strings to be compressed. |
A character vector of compressed strings.
str_compress(c("Hello", "world", "Unishox2"))
str_compress(c("Hello", "world", "Unishox2"))
Compress a string using SMAZ algorithm
str_compress_raw(x)
str_compress_raw(x)
x |
A character vector string to compress. |
A list of raw vectors containing the compressed data.
str_compress_raw(c("Hello", "world", "smaz"))
str_compress_raw(c("Hello", "world", "smaz"))
This function reads compressed binary data from a file and decompresses it using Unishox2.
str_compress_read(file)
str_compress_read(file)
file |
The filename containing the compressed binary data. |
A decompressed character string.
This function compresses a string using Unishox2 and writes the compressed binary data to a file.
str_compress_write(x, file)
str_compress_write(x, file)
x |
A character vector to be compressed. |
file |
filename where the compressed data will be written. |
The length of the compressed data written to the file (invisibly).
This function decompresses each string in a compressed character vector that was compressed using Unishox2.
str_decompress(x)
str_decompress(x)
x |
A character vector of compressed strings to be decompressed. |
A character vector of decompressed strings.
compressed_vec <- str_compress(c("Hello", "world", "Unishox2")) str_decompress(compressed_vec)
compressed_vec <- str_compress(c("Hello", "world", "Unishox2")) str_decompress(compressed_vec)
Decompress a raw vector using SMAZ algorithm
str_decompress_raw(x)
str_decompress_raw(x)
x |
A list of raw vectors to decompress. |
A character vector of strings containing the decompressed data.
compressed_lst <- str_compress_raw(c("Hello", "world", "smaz")) str_decompress_raw(compressed_lst)
compressed_lst <- str_compress_raw(c("Hello", "world", "smaz")) str_decompress_raw(compressed_lst)
This package implements short string compression algorithms.
strzip(x = character())
strzip(x = character())
x |
character |
Maintainer: David Schoch [email protected] (ORCID)
Other contributors:
Salvatore Sanfilippo (Author of SMAZ library) [copyright holder]
Arundale Ramanathan (Author of Unishox2 library) [copyright holder]
Useful links:
Summary for strzip
## S3 method for class 'strzip' summary(object, type = "mean", ...)
## S3 method for class 'strzip' summary(object, type = "mean", ...)
object |
strzip object |
type |
either "mean" for average compression rate, "all" for all individual rates, "summary" for min/max/average rates |
... |
additional arguments affecting the summary produced. |