Displaying 20 results from an estimated 9000 matches similar to: "incoherent conversions from/to raw"
2009 Mar 20
1
sprintf causes a segfault (PR#13613)
Full_Name: Wacek Kusnierczyk
Version: 2.8.0 and 2.10.0 r48163
OS: Ubuntu 8.04 Linux 32bit
Submission from: (NULL) (129.241.198.172)
the following code illustrates a problem with sprintf which consistently causes
a segfault when applied to certain type of arguments. it also shows
inconsistent consequences of the segfault:
(e = tryCatch(stop(), error=identity))
# e is an error object
2009 Mar 23
1
incoherent treatment of NULL
somewhat related to a previous discussion [1] on how 'names<-' would
sometimes modify its argument in place, and sometimes produce a modified
copy without changing the original, here's another example of how it
becomes visible to the user when r makes or doesn't make a copy of an
object:
x = NULL
dput(x)
# NULL
class(x) = 'integer'
# error: invalid
2009 Feb 23
1
are arithmetic comparison operators binary?
the man page for relational operators (see, e.g., ?'<') says:
"
Binary operators which allow the comparison of values in atomic vectors.
Arguments:
x, y: atomic vectors, symbols, calls, or other objects for which
methods have been written.
"
it is somewhat surprizing that the following works:
'<'(1)
# logical(0)
'<'()
#
2009 Feb 23
1
are arithmetic comparison operators binary?
the man page for relational operators (see, e.g., ?'<') says:
"
Binary operators which allow the comparison of values in atomic vectors.
Arguments:
x, y: atomic vectors, symbols, calls, or other objects for which
methods have been written.
"
it is somewhat surprizing that the following works:
'<'(1)
# logical(0)
'<'()
#
2009 Mar 29
2
if does not covert raw to logical (PR#13630)
Full_Name: Wacek Kusnierczyk
Version: 2.8.0 and 2.10.0 r48242
OS: Ubuntu 8.04 Linux 32 bit
Submission from: (NULL) (80.202.30.36)
The following raises an error:
if (as.raw(1)) 1
# error: unimplemented type 'raw' in 'asLogical'
However, ?'if' says:
"
Arguments:
cond: A length-one logical vector that is not 'NA'. Conditions of
length
2009 Apr 21
8
incorrect output and segfaults from sprintf with %*d (PR#13667)
Full_Name: Wacek Kusnierczyk
Version: 2.10.0 r48365
OS: Ubuntu 8.04 Linux 32bit
Submission from: (NULL) (129.241.110.141)
sprintf has a documented limit on strings included in the output using the
format '%s'. It appears that there is a limit on the length of strings included
with, e.g., the format '%d' beyond which surprising things happen (output
modified for conciseness):
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2008 Oct 26
4
odd behaviour of identical
given what ?identical says, i find the following odd:
x = 1:10
y = 1:10
all.equal(x,y)
[1] TRUE
identical(x,y)
[1] TRUE
y[11] = 11
y = y[1:10]
all.equal(x,y)
[1] TRUE
identical(x,y)
[1] FALSE
y
[1] 1 2 3 4 5 6 7 8 9 10
length(y)
[1] 10
looks like a bug.
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system
2010 Nov 16
2
Debugging segfault in foreach
Hi,
I'm using R-2.12 on a linux 64bit machine.
When I run a chunk of code inside a foreach() %do% { ...} or %dopar%
{...} (with doMC backend) I keep getting a segfault. Running the
*same* code within lapply(something, function(x) ... ) doesn't result
in any segfaults. I'll paste the output below, but I'm not sure it
would be helpful.
I'm more curious how to go about smoking
2008 Nov 17
4
functional (?) programming in r
the following is a trivialized version of some functional code i tried
to use in r:
(funcs = lapply(1:5, function(i) function() i))
# a list of no-parameter functions, each with its own closure environment,
# each supposed to return the corresponding index when applied to no
arguments
sapply(funcs, function(func) func())
# supposed to return c(1,2,3,4,5)
there is absolutely nothing unusual in
2009 May 13
3
where does the null come from?
m = matrix(1:4, 2)
apply(m, 1, cat, '\n')
# 1 2
# 3 4
# NULL
why the null?
vQ
2009 Mar 30
1
duplicated fails to rise correct errors (PR#13632)
Full_Name: Wacek Kusnierczyk
Version: 2.8.0 and 2.10.0 r48242
OS: Ubuntu 8.04 Linux 32 bit
Submission from: (NULL) (129.241.110.161)
In the following code:
duplicated(data.frame(), incomparables=NA)
# Error in if (!is.logical(incomparables) || incomparables)
.NotYetUsed("incomparables != FALSE") :
# missing value where TRUE/FALSE needed
the raised error is clearly not the
2009 Jan 02
1
[Fwd: Re: [R] Randomly remove condition-selected rows from a matrix]
Following Duncan's suggestion, I forward the below to R-devel.
vQ
-------- Original Message --------
Subject: Re: [R] Randomly remove condition-selected rows from a matrix
Date: Fri, 02 Jan 2009 10:34:52 -0500
From: Duncan Murdoch <murdoch at stats.uwo.ca>
To: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no>
CC: R help <R-help at stat.math.ethz.ch>
2008 Nov 17
2
assign("FALSE", TRUE)
It was recently pointed out by Wacek Kusnierczyk that although one is
prevented from doing
FALSE <- TRUE
one *can* do
assign("FALSE",TRUE)
and have an object named ``FALSE'' with value TRUE in one's workspace.
This apparently has no deleterious effects; e.g. doing
sample(1:7,replace=FALSE)
gives a random permutation of 1:7 as expected and desired. I.e. the
local
2009 Apr 02
2
actual argument matching does not conform to the definition (PR#13634)
Full_Name: Wacek Kusnierczyk
Version: 2.10.0 r48269
OS: Ubuntu 8.04 Linux 32 bit
Submission from: (NULL) (129.241.199.164)
In the following example (and many other cases):
quote(a=1)
# 1
the argument matching is apparently incorrect wrt. the documentation (The R
Language Definition, v 2.8.1, sec. 4.3.2, p. 23), which specifies the following
algorithm for argument matching:
1. Attempt to
2013 Jun 07
1
cannot load pbdMPI package after compilation
Hello,
I try to install pbdMPI.
Compilation successful, but load fails with segfault.
Is anyone can help me?
R version 3.0.0
pbdMPI version 0.1-6
Intel compiler version 13.1.1
OpenMPI version 1.6.4-1
CPU Intel x86_64
# R CMD INSTALL pbdMPI_0.1-6.tar.gz
..
....
checking for gcc... icc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name...
2008 Jun 20
5
Programming Concepts and Philosophy
I am wondering if people on the list could recommend books that they
have found helpful about programming concepts and style? I often find
that students write R programs by copying existing code but could really
benefit from the understanding of more general programming ideas. An
example would be to avoid writing functions which attempt to modify
their parameters. Another principle would be
2009 Mar 15
4
primitives again
Dear R Gurus:
How do I find the functions which are primitives, please?
Thanks,
Edna Bell
2018 Nov 23
1
[tryExcept] New try Function
Hi Emil,
First, thanks for the response. As you mentioned, a lot of times tryCatch
does the work, as you can return a value. However, sometimes it is useful
to assign several variables when an error occurs. You could do it with <<-,
but I prefer to reduce it's usage unless completely necessary.
I guess that the attachment was missed in the moderation. Here it is the
function: