emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] ob-R.el: extra empty data.frame columns generated from plain l


From: Johan Tolö
Subject: Re: [BUG] ob-R.el: extra empty data.frame columns generated from plain lists after recent change [9.6 (release_9.6-3-ga4d38e @ /usr/share/emacs/30.0.50/lisp/org/)]
Date: Tue, 13 Dec 2022 14:29:44 +0100
User-agent: mu4e 1.8.11; emacs 30.0.50

Greg Minshall <minshall@umich.edu> writes:
list(1,2,3)
[[1]]
[1] 1

[[2]]
[1] 2

[[3]]
[1] 3

c(1,2,3)
[1] 1 2 3
----
(where =c= is the "concatenation operator".)

so, to me, at least, "proper list" is not a well-defined term in R.

cheers, Greg

=c= is "a generic function which combines its arguments" according to the R documentation. It could do different things depending on the input.

=list()= will create an actual R list which are "Generic Vectors" according to the R documentation. Each element of a list can be any other R data structure including other lists, expressions and symbols.

"Proper list" in the context of this discussion and pertaining to R would be a =list()=, not a vector which is what is usually returned by =c()=. A =data.frame()= is a special case of a =list()= where every column has to have the same length.


Johan

--
Johan Tolö



reply via email to

[Prev in Thread] Current Thread [Next in Thread]