search for: rawconnectionvalue

Displaying 4 results from an estimated 4 matches for "rawconnectionvalue".

2025 Jan 31
0
Compression data to variable using gzcon
...quot;w"?. > Use a writable ?rawConnection? to compress data into a variable. But I can't seem to get this to work: > data <- as.raw(sample(0:255, 100)) > con <- rawConnection(raw(0), "wb") > zz <- gzcon(con) > writeBin(data, zz) > val <- rawConnectionValue(con) Error in rawConnectionValue(con) : internal connection is not a rawConnection The documentation of gzcon does mention that the original connection becomes unusable. Ok, so this error is to be expected. But how do I get to the compressed data? As I mentioned memCompress(data) does what I...
2014 Feb 04
0
capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?
...lose(file) rval }, envir=envir) } # captureViaText() captureViaRaw <- function(..., local=TRUE, envir=parent.frame()) { eval({ # Basically what capture.output() does by default file <- rawConnection(raw(0L), open="w") capture.output(..., file=file) res <- rawConnectionValue(file) close(file) res <- rawToChar(res) res <- unlist(strsplit(res, split="\n", fixed=TRUE)) res }, envir=envir) } # captureViaRaw() data <- data.frame(size=10^seq(from=3, to=7.9, by=0.1), captureViaText=NA, captureViaRaw=NA) names <- colnames(data)[-1] for...
2008 Oct 20
2
R 2.8.0 is released
...ts for univariate t-statistics rather than a confidence region for all the parameters (and not just those being profiled). o quantile.default() allows 'probs' to stray just beyond [0, 1], to allow for computed values. o New functions rawConnection() and rawConnectionValue() allow raw vectors to be treated as connections. o read.dcf() now consistently gives an error for malformed DCF. o read.fwf() no longer passes its default for 'as.is' to read.table(): this allows the latter's default to be used. o readBin(), writeBi...
2008 Oct 20
2
R 2.8.0 is released
...ts for univariate t-statistics rather than a confidence region for all the parameters (and not just those being profiled). o quantile.default() allows 'probs' to stray just beyond [0, 1], to allow for computed values. o New functions rawConnection() and rawConnectionValue() allow raw vectors to be treated as connections. o read.dcf() now consistently gives an error for malformed DCF. o read.fwf() no longer passes its default for 'as.is' to read.table(): this allows the latter's default to be used. o readBin(), writeBi...