similar to: Should c(..., recursive = TRUE) and unlist(x, recursive = TRUE) recurse into expression vectors?

Displaying 20 results from an estimated 4000 matches similar to: "Should c(..., recursive = TRUE) and unlist(x, recursive = TRUE) recurse into expression vectors?"

2016 Sep 26
2
Undocumented 'use.names' argument to c()
By "an argument named 'use.names' is included for concatenation", I meant something like this, that someone might try. > c(as.Date("2016-01-01"), use.names=FALSE) use.names "2016-01-01" "1970-01-01" See, 'use.names' is in the output. That's precisely because 'c.Date' doesn't have 'use.names', so
2012 May 06
2
unlist crashes 32-bit R on WinXP when use.names=TRUE
Hi all, I experienced a crash in R-2.15.0 on 32-bit Windows XP (sessionInfo below) when running the piece of code below. I cannot replicate the error on 64-bit Linux, 64-bit Windows, or 32-bit R running under 64-bit Windows. I do not have, and could not find, a 32-bit version of Linux to test this. > NOW <- Sys.time() > FUTURE <- NOW+1:1e7 > crash <- as.character(FUTURE)
2016 Sep 25
1
Undocumented 'use.names' argument to c()
>From comments in http://stackoverflow.com/questions/24815572/why-does-function-c-accept-an-undocumented-argument/24815653 : The code of c() and unlist() was formerly shared but has been (long time passing) separated. From July 30, 1998, is where do_c got split into do_c and do_unlist. With the implementation of 'c.Date' in R devel r71350, an argument named 'use.names' is
2016 Sep 26
0
Undocumented 'use.names' argument to c()
>>>>> Suharto Anggono Suharto Anggono <suharto_anggono at yahoo.com> >>>>> on Mon, 26 Sep 2016 14:51:11 +0000 writes: > By "an argument named 'use.names' is included for concatenation", I meant something like this, that someone might try. >> c(as.Date("2016-01-01"), use.names=FALSE) > use.names >
2008 Aug 20
0
unlist on nested pairlists
unlist(recursive=FALSE) returns NULL elements when passed a nested pairlist containing non-NULL data: x <- pairlist(pairlist(1:2)) unlist(x, recursive=FALSE) ## [[1]] ## NULL version 2.7.2 RC (2008-08-18 r46382) under linux I'm unaware of any motivation for constructing the above data structure, but if unlist is going to operate on it without error I would be surprised if that is the
2011 May 04
4
Recursive objects
Hi all, Does anyone have a comprehensive list of recursive-type objects in R? is.recursive defines them as by exclusion: "most types of objects are regarded as recursive, except for vector types, ?NULL? and symbols (as given by ?as.name?)." I think this that means recursive objects are: * lists * pairlists * calls * expressions Did I miss anything? Hadley -- Assistant
2004 Mar 26
4
cbind/rbind fail on matrixes containing lists (PR#6702)
Today's R 1.9.0 beta: > m1 [,1] [,2] [,3] [,4] [1,] NA NA NA NA [2,] NA NA NA NA [3,] NA NA NA NA [4,] NA NA NA NA > class(m1[1,1]) [1] "list" > cbind(m1,m1) Error in cbind(...) : cannot create a matrix from these types > rbind(m1,m1) Error in rbind(...) : cannot create a matrix from these types > version _
1999 Jul 08
1
summary.default & is.recursive (PR#221)
Paul Gilbert <pgilbert@bank-banque-canada.ca> writes: > is.recursive(list(z, a=list(1:3)) ) > > R64.2:> [1] FALSE > Splus3.3> [1] T Yup, it's a bug. Cc'ed to r-bugs so that we don't forget. > is.recursive(list(1,2)) [1] FALSE > is.recursive(pairlist(1,2)) [1] TRUE [maybe Martin would want to add a check that is.whatever works identically on lists
2006 Oct 29
1
Help with unlist
Dear r-helpers, I have a list whose elements are > str(durCut[[1]]) Ord.factor w/ 5 levels "vLow"<"low"<"med"<..: 3 2 5 2 2 2 4 4 3 5 ... How do I unlist durCut into an ordered factor? > str(unlist(durCut)) int [1:3024] 3 2 5 2 2 2 4 4 3 5 ... _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology
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") >
2007 Oct 23
1
How to unlist Dates
Hi, I am trying to get a vector of dates that I can use for the xaxis in matplot (e.g. axis.Date(1,dates) ) I have a list of dates ... e.g. > dates [[1]] [1] "2015-02-15" [[2]] [1] "2015-08-15" [[3]] [1] "2015-11-15" But when I unlist it I "lose" the Dates and get numbers instead > unlist(dates) [1] 16481 16662 16754 Am I doing something wrong
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
2016 Sep 10
1
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
>>>>> John Chambers <jmc at r-project.org> >>>>> on Sat, 10 Sep 2016 09:16:38 -0700 writes: > (Brief reply, I'm traveling but as per below, this is on my radar right now so wanted to comment.) > Two points regarding "dotsMethods". > 1. To clarify the limitation. It's not that all the arguments have to be of the same
2018 May 08
2
unlist errors on a nested list of empty lists
Reproducible example: x <- list(list(list(), list())) unlist(x) *> Error in as.character.factor(x) : malformed factor* What should happen: unlist(x) > NULL R.version platform x86_64-apple-darwin15.6.0 arch x86_64 os darwin15.6.0 system x86_64, darwin15.6.0 status major 3 minor 5.0 year 2018 month 04 day
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 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
2019 Dec 20
0
list.files(., pattern=<>, recursive = TRUE, include.dirs = TRUE)
Hi all, I ran into a weird corner-case of list.files today and I'm wondering what people think about it and a potential wishlist enhancement related to it. Consider the case where we call list.files with recursive and include.dirs both TRUE and we supply a pattern. In this case pattern is applied to directory names when deciding whether to list the directory return value but NOT when
2011 Apr 14
1
Possible bug in 'relist()' and/or 'as.relistable()'
Dear list, I think I just stumbled across a bug in either 'relist()' and/or 'as.relistable()'. It seems that 'pairlists' can only be un- and relisted as long as they're not nested: Good: a <- as.relistable(as.pairlist(list(a=1, b=2))) a <- unlist(a) relist(a)# Works Bad: a <- as.relistable(as.pairlist(list(a=1, b=2, c=list(c.1=1, c.2=2)))) a <- unlist(a)
2012 Oct 09
2
Error in matrix (unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, : attempt to set an attribute on NULL
I am using Donlp2 package to solve a non-linear problem, but there's an error I always meet: Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, : attempt to set an attribute on NULL I have been suffering from this bug for a long time. I'll be very grateful if somebody could help me -_- -- View this message in context:
2009 Mar 20
2
struggling with pairlists
I would like to create a vector of pairlist (flag, binary_value) like: (variable ="TrendOff", value = 0) (variable ="MOdwt", value = 1) (variable ? "ZeroPadding", value =1) ................................................ I tried the following syntax but the emcompassing list (that I called "flags") is not made up of pairlists. Instead it