Displaying 20 results from an estimated 24 matches for "rawconnection".
2018 Nov 12
2
Better cleanup of example session during check
I have a couple of packages (?fiery? and ?reqres') that uses a mock of a rook request for their examples. The mock is an R6 object containing a rawConnection, along with a finalizer that closes this connection when the object is removed. So far so good. I?ve recently been getting CRAN errors due to the rawConnection not being closed in examples
> cleanEx()
Error: connections left open:
content (rawConnection)
and the only way to remove this is by...
2014 Feb 04
0
capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?
I've noticed that the processing time for the default capture.output()
grows exponentially in the number of characters outputted/captured.
The default settings sinks to a temporary textConnection(). When
instead sinking to a rawConnection(), the processing time becomes
linear. See below example and attached PNG figure [also at
http://xfer.aroma-project.org/tmp/20140203/capture.output_text-vs-raw.png].
I know little about text encoding, but I wouldn't be surprised I'm
overseeing encoding issues when sinking to raw followed...
2005 Sep 18
0
Updated rawConnection() patch
Here's an update of my rawConnection() implementation. In addition to
providing a raw version of textConnection(), this fixes two existing
issues with textConnection(): one is that the current textConnection()
implementation carries around unprotected SEXP pointers, the other is
a performance problem due to prolific copying of the ou...
2018 Nov 12
0
Better cleanup of example session during check
On 12/11/2018 8:09 AM, Thomas Lin Pedersen wrote:
> I have a couple of packages (?fiery? and ?reqres') that uses a mock of a rook request for their examples. The mock is an R6 object containing a rawConnection, along with a finalizer that closes this connection when the object is removed. So far so good. I?ve recently been getting CRAN errors due to the rawConnection not being closed in examples
>
>> cleanEx()
> Error: connections left open:
> content (rawConnection)
>
> and the o...
2019 Dec 06
2
long vector support
...#issuecomment-562659134,
writeBin() still prohibits long vectors. Are there any plans to add long
vector support to R 4.0.0?
x <- raw(2^31)
writeBin(x, con = nullfile())
# Error in writeBin(x, con = nullfile()) :
# long vectors not supported yet: connections.c:4430
x <- raw(2^31)
con <- rawConnection(raw(0L), "w")
writeBin(raw(2^31), con = con)
# Error in writeBin(raw(2^31), con = con) :
# long vectors not supported yet: connections.c:4430
Will
[[alternative HTML version deleted]]
2020 May 01
4
Request: tools::md5sum should accept connections and finally in-memory objects
...#39;?
Suggestions:
As a first step, it would be great if tools::md5sum would support
connections (credit goes to Henrik for the idea). E.g., instead of the
signature tools::md5sum(files), we could have tools::md5sum(files, conn
= NULL), which would allow:
x <- runif(10)
tools::md5sum(conn = rawConnection(serialize(x, NULL)))
To avoid the inconsistency between 'files' (which computes the hash
digests in a vectorized manner, that is, one for each file) and 'conn'
(which expects a single connection), and to make it easier to extend the
hashing for other algorithms without changing...
2012 Jan 11
1
Rook: software and specification for R web applications and servers
Dear ?useRs,
Rook version 1.0-3 has been submitted to CRAN. In the mean time you
can get it here:
https://github.com/jeffreyhorner/rRack/blob/master/Rook_1.0-3.tar.gz
The latest release contains support for deployment with rApache. Please see
3.6.5 and 3.6.6 under section 'Configuring rApache' in the manual:
http://www.rapache.net/manual.html#Configuring_rapache
What is Rook? A
2012 Jan 11
1
Rook: software and specification for R web applications and servers
Dear ?useRs,
Rook version 1.0-3 has been submitted to CRAN. In the mean time you
can get it here:
https://github.com/jeffreyhorner/rRack/blob/master/Rook_1.0-3.tar.gz
The latest release contains support for deployment with rApache. Please see
3.6.5 and 3.6.6 under section 'Configuring rApache' in the manual:
http://www.rapache.net/manual.html#Configuring_rapache
What is Rook? A
2019 Dec 07
0
long vector support
...Will, for the reminder!
Martin Maechler
ETH Zurich and R Core Team
> x <- raw(2^31)
> writeBin(x, con = nullfile())
> # Error in writeBin(x, con = nullfile()) :
> # long vectors not supported yet: connections.c:4430
> x <- raw(2^31)
> con <- rawConnection(raw(0L), "w")
> writeBin(raw(2^31), con = con)
> # Error in writeBin(raw(2^31), con = con) :
> # long vectors not supported yet: connections.c:4430
> Will
> [[alternative HTML version deleted]]
> ______________________________________________...
2020 Jun 29
0
A warning in gzcon but not in gzfile
...e data to a file
> file_path <- tempfile()
> writeBin(data, file_path)
>
## Read the data using `gzfile`
> con1 <- gzfile(file_path)
> str(readLines(con1, 1000))
>
## Read the data using `gzcon`
> ## We create a raw connection from the raw vector
> con2 <- gzcon(rawConnection(data))
> str(readLines(con2, 1000))
output:
> > str(readLines(con1, 1000))
> chr [1:1000] "##fileformat=VCFv4.2" "##hailversion=0.2.24-9cd88d97bedd"
> ...
> > str(readLines(con2, 1000))
> chr [1:884] "##fileformat=VCFv4.2" "##hailversi...
2005 Aug 17
0
Raw data type transformations
...of data types and
didn't implement byte swapping).
[aside: Rinternals.h does not export RAW() for packages]
I first thought there might be a way to do this via connections but
didn't want to actually read and write files just to map between data
types. One option would be to implement a rawConnection() analog of
the current textConnection(), which would associate raw vectors with
binary connections, and allow readBin()/writeBin().
Looking at the text connection code, it seems to me that it could be
extended to handle this fairly easily. For input connections, it
appears that all that needs to...
2020 May 01
0
Request: tools::md5sum should accept connections and finally in-memory objects
...rst step, it would be great if tools::md5sum would support
> connections (credit goes to Henrik for the idea). E.g., instead of the
> signature tools::md5sum(files), we could have tools::md5sum(files, conn
> = NULL), which would allow:
>
> x <- runif(10)
> tools::md5sum(conn = rawConnection(serialize(x, NULL)))
>
> To avoid the inconsistency between 'files' (which computes the hash
> digests in a vectorized manner, that is, one for each file) and 'conn'
> (which expects a single connection), and to make it easier to extend the
> hashing for other algori...
2020 May 01
0
Request: tools::md5sum should accept connections and finally in-memory objects
...s:
> As a first step, it would be great if tools::md5sum would support connections (credit goes to Henrik for the idea). E.g., instead of the signature tools::md5sum(files), we could have tools::md5sum(files, conn = NULL), which would allow:
>
> x <- runif(10)
> tools::md5sum(conn = rawConnection(serialize(x, NULL)))
>
> To avoid the inconsistency between 'files' (which computes the hash digests in a vectorized manner, that is, one for each file) and 'conn' (which expects a single connection), and to make it easier to extend the hashing for other algorithms without ch...
2010 Aug 19
2
Does R always insist on sending plot output to a file?
I need to write the output of a R plot to a Java OutputStream. It looks like
R insists on sending it's output to a file. Is there anyway to get bytes
directly from the output of a plot so I can write it with Java? Writing it
to a file is too slow.
Is there a parameter in the graphics device function png(..) that directs
output to a variable in memory?
x <- plot(.) would make sense.
--
2019 Dec 12
4
R 3.6.2 is released
...better. Reported by
Robert and confirmed by Nic Rochette in PR#16953.
* canCoerce(obj, cl) no longer assumes length(class(obj)) == 1.
* plot.formula(*, subset = *) now also works in a boundary case
reported by Robert Schlicht (TU Dresden).
* readBin() and writeBin() of a rawConnection() now also work in
large cases, thanks to a report and proposal by Taeke Harkema in
PR#17665.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk Priv...
2019 Dec 12
4
R 3.6.2 is released
...better. Reported by
Robert and confirmed by Nic Rochette in PR#16953.
* canCoerce(obj, cl) no longer assumes length(class(obj)) == 1.
* plot.formula(*, subset = *) now also works in a boundary case
reported by Robert Schlicht (TU Dresden).
* readBin() and writeBin() of a rawConnection() now also work in
large cases, thanks to a report and proposal by Taeke Harkema in
PR#17665.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk Priv...
2019 Dec 12
4
R 3.6.2 is released
...better. Reported by
Robert and confirmed by Nic Rochette in PR#16953.
* canCoerce(obj, cl) no longer assumes length(class(obj)) == 1.
* plot.formula(*, subset = *) now also works in a boundary case
reported by Robert Schlicht (TU Dresden).
* readBin() and writeBin() of a rawConnection() now also work in
large cases, thanks to a report and proposal by Taeke Harkema in
PR#17665.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk Priv...
2020 May 01
1
Request: tools::md5sum should accept connections and finally in-memory objects
...t if tools::md5sum would support
>> connections (credit goes to Henrik for the idea). E.g., instead of the
>> signature tools::md5sum(files), we could have tools::md5sum(files,
>> conn = NULL), which would allow:
>>
>> x <- runif(10)
>> tools::md5sum(conn = rawConnection(serialize(x, NULL)))
>>
>> To avoid the inconsistency between 'files' (which computes the hash
>> digests in a vectorized manner, that is, one for each file) and 'conn'
>> (which expects a single connection), and to make it easier to extend
>> the ha...
2019 Dec 12
2
R 3.6.2 is released
...nd confirmed by Nic Rochette in PR#16953.
>
> * canCoerce(obj, cl) no longer assumes length(class(obj)) == 1.
>
> * plot.formula(*, subset = *) now also works in a boundary case
> reported by Robert Schlicht (TU Dresden).
>
> * readBin() and writeBin() of a rawConnection() now also work in
> large cases, thanks to a report and proposal by Taeke Harkema in
> PR#17665.
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
>...
2015 Jan 02
3
Benchmark code, but avoid printing
Dear all,
I am trying to benchmark code that occasionally prints on the screen
and I want to
suppress the printing. Is there an idiom for this?
If I do
sink(tempfile)
microbenchmark(...)
sink()
then I'll be also measuring the costs of writing to tempfile. I could
also sink to /dev/null, which is probably fast, but that is not
portable.
Is there a better solution? Is writing to a