Displaying 20 results from an estimated 1000 matches similar to: "unlist errors on a nested list of empty lists"
2018 May 08
2
unlist errors on a nested list of empty lists
On 08/05/2018 2:58 PM, Duncan Murdoch wrote:
> On 08/05/2018 1:48 PM, Steven Nydick wrote:
>> Reproducible example:
>>
>> x <- list(list(list(), list()))
>> unlist(x)
>>
>> *> Error in as.character.factor(x) : malformed factor*
>
> The error comes from the line
>
> structure(res, levels = lv, names = nm, class = "factor")
>
2018 May 09
2
unlist errors on a nested list of empty lists
On 08/05/2018 4:50 PM, Steven Nydick wrote:
> It also does the same thing if the factor is not on the first level of
> the list, which seems to be due to the fact that the islistfactor is
> recursive, but if a list is a list-factor, the first level lists are
> coerced into character strings.
>
> > x <- list(list(factor(LETTERS[1])))
> > unlist(x)
> Error in
2018 May 08
0
unlist errors on a nested list of empty lists
It also does the same thing if the factor is not on the first level of the
list, which seems to be due to the fact that the islistfactor is recursive,
but if a list is a list-factor, the first level lists are coerced into
character strings.
> x <- list(list(factor(LETTERS[1])))
> unlist(x)
Error in as.character.factor(x) : malformed factor
However, if one of the factors is at the top
2018 May 09
0
unlist errors on a nested list of empty lists
I do not have access to the bug reporting system. If somebody can get me
access, I can create a formal bug report.
The latter issues seem like duplicates of:
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=12572 (with slightly
different output), but as that bug was reported nearly 10 years ago, it
might be worth creating an update under R version 3. I could not find the
first issue when
2010 Jun 19
1
more powerful iconv
R community,
As you may know, R's iconv doesn't work well converting to and from
encodings that allow embedded nulls. For example
> iconv("foo", to="UTF-16")
Error in iconv("foo", to = "UTF-16") :
embedded nul in string: '\xff\xfef\0o\0o\0'
However, I don't believe embedded nulls are at issue here, but rather
that R's iconv
Control statements with condition with greater than one should give error (not just warning) [PATCH]
2017 Mar 03
2
Control statements with condition with greater than one should give error (not just warning) [PATCH]
I'd like to propose that the whenever the length of condition passed
to an if or a while statement differs from one, an error is produced
rather than just a warning as today:
> x <- 1:2
> if (x == 1) message("x == 1")
x == 1
Warning message:
In if (x == 1) message("x == 1") :
the condition has length > 1 and only the first element will be used
There are
2024 Apr 27
1
Should c(..., recursive = TRUE) and unlist(x, recursive = TRUE) recurse into expression vectors?
Reading the body of function 'AnswerType' in bind.c, called from 'do_c'
and 'do_unlist', I notice that EXPRSXP and VECSXP are handled identically
in the recurse = TRUE case.
A corollary is that c(recursive = TRUE) and unlist(recursive = TRUE)
treat expression vectors like expression(a, b) as lists of symbols and
calls. And since they treat symbols and calls as
2002 Feb 08
5
Smp kernel on up machine???
Can anyone tell me if there has been testing of using an SMP kernel on a UP
machine and if that is bad? I have an ext3 filesystem that keeps getting
corrupt. Certain directories only get I/O errors, trying to access beyond
the end of the device.
Thanks,
Gabe
2002 Jan 17
3
Change defaults to data=journal on /
How come if I install a fresh redhat 7.2 system and change fstab from
defaults to data=journal for the / file system, it breaks everything?
Thanks,
---------------------
Gabe E. Nydick
Systems Lead
ClubPhoto, Inc.
P: 408.423.6611
F: 408.557.6799
----------------------
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
2013 May 24
1
Problem with Rboolean in c++ code
I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is
properly deleted after use. However, I run into some problems when
trying to pass in the third argument which is an Rboolean. The line
'R_RegisterCFinalizerEx(p, finalizer, TRUE);' generates the following
error when trying to compile using R CMD SHLIB:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O2 -pipe
2011 Feb 11
1
Writting my own package - 64 bit problem with R_GetCCallable
Hello list,
I've been working on a package of my own. It works fine on the 32bit
linux machines that I've tested it on. Someone using 64bit ubuntu
wanted to try it, and surprising segfaults happened. My test code
results in no segfault, errors, or leaks from my calls when run under
valgrind (I recompiled R with the level 2 valgrind instruments). R
and packages are compiled from source,
2012 Sep 03
1
Possible page inefficiency in do_matrix in array.c
In do_matrix in src/array.c there is a type switch containing :
case LGLSXP :
for (i = 0; i < nr; i++)
for (j = 0; j < nc; j++)
LOGICAL(ans)[i + j * NR] = NA_LOGICAL;
That seems page inefficient, iiuc. Think it should be :
case LGLSXP :
for (j = 0; j < nc; j++)
for (i = 0; i < nr; i++)
LOGICAL(ans)[i + j * NR] = NA_LOGICAL;
or more simply :
case
2001 Dec 07
2
Memory problem
Dear all,
I have written a little R program to convert images. See below. Within the
loop over j (the filenames) memory consumption grows constantly. rm( ... )
inside the loop did not help. Memory does not grow if I remove the writeBin
statements between the two #-------- marks. But obviously this is not
solution I want...
Thanks for any advice.
Manfred Baumstark
P.S. As I'm new to R:
2008 Aug 20
0
unlist on nested lists of factors (PR#12572)
Here is a description and a proposed solution for a bug in unlist().
I've used version 2.7.2 RC (2008-08-18 r46382) to look at this, under
linux.
unlist(recursive=TRUE) incorrectly returns a factor with zero levels
when passed either a nested list of factors, or a data frame
containing only factor columns. You can't print() the result.
x <- list(list(v=factor("a")))
2007 May 30
5
Possible changes to connections
When I originally implemented connections in R 1.2.0, I followed the model
in the 'Green Book' closely. There were a number of features that forced
a particular implementation, and one was getConnection() that allows one
to recreate a connection object from a number.
I am wondering if anyone makes use of this, and if so for what?
It would seem closer to the R philosophy to have
2010 Aug 23
1
Speeding up sum and prod
Looking for more ways to speed up R, I've found that large
improvements are possible in the speed of "sum" and "prod" for long
real vectors.
Here is a little test with R version 2.11.1 on an Intel Linux system
> a <- seq(0,1,length=1000)
> system.time({for (i in 1:1000000) b <- sum(a)})
user system elapsed
4.800 0.010 4.817
> system.time({for (i
2009 Jan 19
1
patch for textspecial and defaultfont in xfig
Hello,
The current xfig device lacks the functionality to set the
textspecial flag and use the defaultfont in xfig. This is necessary
when you want to export to xfig and use interpreted text (e.g., $
\frac{1}{e}$ gets interpreted by latex). The attached patch adds this
functionality.
Why would you like to do this?
- Use math in labels (e.g., name your variables $r_{xy}$, do a
2003 Dec 16
1
Memory issues in "aggregate" (PR#5829)
Full_Name: Ed Borasky
Version: 1.8.1
OS: Windows XP Professional
Submission from: (NULL) (208.252.96.195)
R 1.8.1 seems to be running into a memory allocation problem in the "aggregate"
function. I have a rather large dataset (14 columns by 223,000 rows -- almost 40
megabytes) and a script that performs some processing on it. The system is a 768
MB Pentium 4. Here's the console
2009 Jan 30
2
Problem installing RMySQL ("S4R.h:40:17: error: S.h: No such file or directory"?)
Hi,
I'm trying to install RMySQL and I keep hitting errors. My computer is:
uname -a
Linux cricket 2.6.18-92.1.22.el5PAE #1 SMP Tue Dec 16 12:36:25 EST 2008 i686
i686 i386 GNU/Linux
I have set the following environment settings:
export PKG_LIBS="-L/usr/lib/mysql -lmysqlclient"
export PKG_CPPFLAGS="-I/usr/include/mysql"
I run the following command:
R CMD INSTALL