Displaying 20 results from an estimated 700 matches similar to: "Minor portability patch"
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
The patch below adds support for custom HTTP headers in
download.file() and url().
My main motivation for this is performing basic http authentication.
Some web sites do not support embedding the credentials into the URI
itself, they only work if the username and password are sent in the
HTTP headers. In fact specifying the username and password in the URI
has been
2019 Jan 11
0
strtoi output of empty string inconsistent across platforms
>>>>> Michael Chirico
>>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes:
> Identified as root cause of a bug in data.table:
> https://github.com/Rdatatable/data.table/issues/3267
> On my machine, strtoi("", base = 2L) produces NA_integer_
> (which seems consistent with ?strtoi: "Values which cannot
> be
2019 Jan 12
0
strtoi output of empty string inconsistent across platforms
Thanks Martin.
For what it's worth, this extremely representative, highly scientific
Twitter poll suggests the Mac/Linux split is pretty stark (NA on Mac, 0 on
Linux)
https://twitter.com/michael_chirico/status/1083649190117306369?s=17
On Sat, Jan 12, 2019, 2:00 AM Martin Maechler <maechler at stat.math.ethz.ch
wrote:
> >>>>> Martin Maechler
> >>>>>
2017 Aug 31
2
Converting character to numeric using the package "XLConnect"
Thanks very much for your answer.
I?m trying the function ?strtoi? but it fails to convert character to numeric after the command "set[index] <- strtoi(set[index])".
> strtoi(set[index]) ## This works: all values are numeric !!!
[1] 1 2 3 4 2 8 9 7
> set[index] <- strtoi(set[index])
> print(set[10,1]) ## Problem: must be numeric !!!!
[1] "1"
Thanks
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
>>>>> Martin Maechler
>>>>> on Fri, 11 Jan 2019 09:44:14 +0100 writes:
>>>>> Michael Chirico
>>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes:
>> Identified as root cause of a bug in data.table:
>> https://github.com/Rdatatable/data.table/issues/3267
>> On my machine, strtoi("", base =
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
Identified as root cause of a bug in data.table:
https://github.com/Rdatatable/data.table/issues/3267
On my machine, strtoi("", base = 2L) produces NA_integer_ (which seems
consistent with ?strtoi: "Values which cannot be interpreted as integers or
would overflow are returned as NA_integer_").
But on all the other machines I've seen, 0L is returned. This seems to be
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in
patch-vec-subset. I've fixed this (I now see one does need to
duplicate index vectors sometimes, though one can avoid it most of the
time). I also split this patch in two, since it really has two
different and independent parts. The patch-vec-subset patch now has
only some straightforward (locally-checkable) speedups for
2007 Sep 13
1
chartr better
For example, the following changes are necessary when i convert a
Japanese hiragana into katakana in chattr.
R code:
> chartr("\u3041-\u3093","\u30a1-\u30f3","\u3084\u3063\u305f\u30fc")
--- R-alpha.orig/src/main/character.c 2007-09-05 07:13:27.000000000 +0900
+++ R-alpha/src/main/character.c 2007-09-13 16:10:21.000000000 +0900
@@ -2041,6 +2041,16 @@
2011 Nov 17
1
how to read a free text file into individual variables
hi ,I am writing a soft package based on R.
But when I try to read a configure file showed as below.
How can I read the parameter in this text file.
How can I read the parameter into each variable in this file ?
configinfo<-scan(file(configfile),ok=TRUE,n=-1)
scan seems need every line have same column ?
configinfo <- readLines(configfile,ok=TRUE,n=-1)
methodnum <-
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
I'd like to propose a change to the R language so that calling
'parent.env<-' on a package namespace or package imports is a runtime
error.
Currently the documentation warns that it's dangerous behaviour and
might go away:
The replacement function ?parent.env<-? is extremely dangerous as
it can be used to destructively change environments in ways that
violate
2011 Aug 14
0
Improved version of Rprofmem
The Rprofmem facility is currently enabled only if the configuration
option --enable-memory-profiling is used. However, the overhead of
having it enabled is negligible when profiling is not actually being
done, and can easily be made even smaller. So I think it ought to be
enabled all the time.
I've attached a patch doing this, which also makes a number of other
improvements to Rprofmem,
2010 Mar 05
2
[PATCH] R ignores PATH_MAX and fails in long directories (PR#14228)
Full_Name: Murray Stokely
Version: 2.10.1
OS: Linux
Submission from: (NULL) (216.239.45.4)
The Defn.h header includes limits.h for PATH_MAX and then checks if it hasn't
been defined and if not sets something manually. Some of the R code uses
PATH_MAX but a lot of other functions in unix/sys-unix.c and main/startup.c just
hardcodes a limit of 256 characters.
In my environment this is not
2011 Mar 18
1
[Patch suggestion] Adding 3rd arg to tempfile() to set extension
The other day I was working on an example which used tempfile() to create
file for use by the graphics device. And while I love tempfile()---as it is
portable and clever and the files get cleaned by R and all that---I noticed
one missing feature I would like to see: beside a starting name pattern, and
an optional directory, an 'file extension' argument would be nice to have.
As e.g. in
2017 Aug 30
0
Converting character to numeric using the package "XLConnect"
Hi Nelly,
Are you trying to convert hexadecimal to decimal?
nrdf
Setting Value
1 Parameters a
2 Parameters b
3 Parameters c
4 Parameters d
5 Parameters e
6 Parameters 2
7 Parameters 8
8 Parameters 9
9 Parameters 7
10 1 a
11 2 b
12 3 c
13 4 d
strtoi(nrdf$Value,16)
[1] 10 11 12 13 14 2 8 9
2009 Mar 19
1
.Internal
I was trying to find source for optimize and I ran across
function (f, interval, ..., lower = min(interval), upper = max(interval),
maximum = FALSE, tol = .Machine$double.eps^0.25)
{
if (maximum) {
val <- .Internal(fmin(function(arg) -f(arg, ...), lower,
upper, tol))
list(maximum = val, objective = f(val, ...))
}
else {
val <-
2009 Dec 10
1
switch() called with just the EXPR argument causes R to hang (PR#14124)
Dear all,
switch() called with just the EXPR argument causes R to hang so that the
only way to stop it is to kill R.
Reproducible example:
> switch(EXPR="a")
the internal C subroutine behind switch is do_switch located in
R/src/main/builtin.c
For convenience I reproduce it below.
*****************************************************************************
SEXP attribute_hidden
2012 Dec 15
1
Could Rstd_Busy do something (src/unix/sys-std.c)?
Currently the function Rstd_Busy() does nothing (src/unix/sys-std.c):
void attribute_hidden Rstd_Busy(int which)
{
}
The function is called through a pointer and R interfaces can change
this pointer and, thus, use a different function. I don't plan to
create a whole new interface to R, but I maintain a package whose aim
is to provide a new feature to R when it's running in a
2019 Jun 04
0
[External] undefined symbol errors when compiling package using ALTREP API
Hi Mark,
So depending pretty strongly on what you mean by "ALTREP aware", packages
aren't necessarily supposed to be ALTREP aware. What I mean by this is that
as of right now, ALTREP objects are designed to be interacted with by
non-ALTREP-implementing package code, *more-or-less *exactly as standard
(non-AR) SEXPs are: via the published C API. The more or less comes from
the fact
2019 Jun 04
2
undefined symbol errors when compiling package using ALTREP API
Hello,
I'm developing a package (lazyvec) that makes full use of the ALTREP
framework (R >= 3.6.0).
One application of the package is to wrap existing ALTREP vectors in a new
ALTREP vector and pass all calls from R to the contained object. The
purpose of this is to provide a diagnostic framework for working with
ALTREP vectors and show information about internal calls.
The package builds
2010 Oct 07
2
Truncating leading zeros in strings
I am new to R. I thing this will be simple, but I don't yet know my way
around.
I am generating character strings from the system clock that represent
integers, and I want to convert them to integer values. Strtoi works
well, except when there are leading zeros on the string. Could anyone
suggest a way to remove those leading zeros?
Thanks
Paul
--
E. Paul Wileyto, Ph.D.