Herve Pages wrote:
> In my experience, and more generally speaking, the desire to treat
> 0-length vectors as a special case that deviates from the
> non-zero-length case has never been productive.
Good idea.
Gabriel Becker Wrote:
> > nrow(rbind(aa = c("a", "b", "c"), AA = character()))
> [1] 1
Hi Gabriel
> Personally, no I wouldn't. I would consider m==0 a degenerate case, where
there is no data, but I personally find matrices (or data.frames) with rows
but no columns a very strange concept.
This distinction between matrix and data.frames is the crux in this case.
>From the dimensional
On 5/16/19 17:48, Gabriel Becker wrote:
Hi Herve,
Inline.
On Thu, May 16, 2019 at 4:45 PM Pages, Herve
mailto:hpa...@fredhutch.org>> wrote:
Hi Gabe,
ncol(data.frame(aa=c("a", "b", "c"), AA=c("A", "B", "C")))
# [1] 2
ncol(data.frame(aa="a", AA="A"))
# [1] 2
ncol(data.frame(aa
Hi Herve,
Inline.
On Thu, May 16, 2019 at 4:45 PM Pages, Herve wrote:
> Hi Gabe,
>
>ncol(data.frame(aa=c("a", "b", "c"), AA=c("A", "B", "C")))
># [1] 2
>
>ncol(data.frame(aa="a", AA="A"))
># [1] 2
>
>ncol(data.frame(aa=character(0), AA=character(0)))
># [1] 2
>
>nc
Hi Gabe,
ncol(data.frame(aa=c("a", "b", "c"), AA=c("A", "B", "C")))
# [1] 2
ncol(data.frame(aa="a", AA="A"))
# [1] 2
ncol(data.frame(aa=character(0), AA=character(0)))
# [1] 2
ncol(cbind(aa=c("a", "b", "c"), AA=c("A", "B", "C")))
# [1] 2
ncol(cbind(aa="a", AA="A"))
On Thu, May 16, 2019 at 3:47 PM Gabriel Becker
wrote:
> Hi Hadley,
>
> Thanks for the counterpoint. Response below.
>
> On Thu, May 16, 2019 at 1:59 PM Hadley Wickham
> wrote:
>
>> The existing behaviour seems inutitive to me. I would consider these
>> invariants for n vector x_i's each with siz
Jiefei,
Inline.
On Thu, May 16, 2019 at 2:30 PM 介非王 wrote:
> Hello Luke and Gabriel,
>
> Thank you very much for your quick responses. The explanation of STDVEC is
> very helpful and I appreciate it! For the wrapper, I have a few new
> questions.
>
>
> 1. Like Luke said a mutable object is not
Hi Hadley,
Thanks for the counterpoint. Response below.
On Thu, May 16, 2019 at 1:59 PM Hadley Wickham wrote:
> The existing behaviour seems inutitive to me. I would consider these
> invariants for n vector x_i's each with size m:
>
> * nrow(rbind(x_1, x_2, ..., x_n)) equals n
>
Personally, no
Hi,
Sorry for overflow the mailbox. Please ignore the second question, I
misunderstand Gabriel answer.
Best,
Jiefei
On Thu, May 16, 2019 at 5:29 PM 介非王 wrote:
> Hello Luke and Gabriel,
>
> Thank you very much for your quick responses. The explanation of STDVEC is
> very helpful and I appreciat
Hello Luke and Gabriel,
Thank you very much for your quick responses. The explanation of STDVEC is
very helpful and I appreciate it! For the wrapper, I have a few new
questions.
1. Like Luke said a mutable object is not possible. However, I noticed that
there is one extra argument *deep* in the
Gabriel, you ask an insightful and instructive question. One of R's
great strengths is that we have a forum where this kind of edge-case
can be fruitfully discussed.
My interest in this would be the names of the arguments; in the magic
package I make heavy use of the dimnames of zero-extent arrays.
The existing behaviour seems inutitive to me. I would consider these
invariants for n vector x_i's each with size m:
* nrow(rbind(x_1, x_2, ..., x_n)) equals n
* ncol(rbind(x_1, x_2, ..., x_n)) equals m
Additionally, wouldn't you expect rbind(x_1[i], x_2[i]) to equal
rbind(x_1, x_2)[, i, drop = F
Hi all,
Apologies if this has been asked before (a quick google didn't find it for
me),and I know this is a case of behaving as documented but its so
unintuitive (to me at least) that I figured I'd bring it up here anyway. I
figure its probably going to not be changed, but I'm happy to submit a
Hi Jiefei,
Thanks for tryingout the ALTREP stuff and letting us know how it is going.
That said I don't think either of these are bugs, per se, but rather a
misunderstanding of the API. Details inline.
On Thu, May 16, 2019 at 11:57 AM 介非王 wrote:
> Hello,
>
> I have encountered two bugs when u
On Thu, 16 May 2019, 介非王 wrote:
> Hello,
>
> I have encountered two bugs when using ALTREP APIs.
>
> 1. STDVEC_DATAPTR
>
> From RInternal.h file it has a comment:
>
> /* ALTREP support */
>> void *(STDVEC_DATAPTR)(SEXP x);
>
>
> However, this comment might not be true, the easiest way to verify it
Hello,
I have encountered two bugs when using ALTREP APIs.
1. STDVEC_DATAPTR
>From RInternal.h file it has a comment:
/* ALTREP support */
> void *(STDVEC_DATAPTR)(SEXP x);
However, this comment might not be true, the easiest way to verify it is to
define a C++ function:
void C_testFunc(SEX
In R-3.6.0 autoprinting was changed so that print methods for the storage
modes are not called when there is no explicit class attribute. E.g.,
% R-3.6.0 --vanilla --quiet
> print.function <- function(x, ...) { cat("Function with argument list ");
cat(sep="\n", head(deparse(args(x)), -1)); i
17 matches
Mail list logo