From tom@@@k@||ber@ @end|ng |rom gm@||@com  Fri Nov  1 17:21:11 2019
From: tom@@@k@||ber@ @end|ng |rom gm@||@com (Tomas Kalibera)
Date: Fri, 1 Nov 2019 17:21:11 +0100
Subject: [Rd] Getting error in rbindlist
In-Reply-To: <CAJyEKho5zp9d=TC5Vv-cpQV7my2riFQVbVgzEs4AF5X3c1R2eQ@mail.gmail.com>
References: <CAJyEKho5zp9d=TC5Vv-cpQV7my2riFQVbVgzEs4AF5X3c1R2eQ@mail.gmail.com>
Message-ID: <abb8128c-cd28-b7f4-47ad-3d30326ea424@gmail.com>

On 11/1/19 1:11 PM, Anshul Saravgi wrote:
> Hi All
>
> Can you help me understand the meaning of the below error message then I
> will try to figure out what is going wrong:
>
> *Input Code:*
>> bodlane2 <- lapply(
> +   lapply(split(lctolc2, lctolc2$Item), function(x) graph.data.frame(x[,
> 2:3])),
> +   function(x) lapply(
> +     V(x)[degree(x, mode = "in") == 0],
> +     function(s) all_simple_paths(x, from = s,
> +                                  to = V(x)[degree(x, mode = "out") == 0])
> %>%
> +       lapply(
> +         function(y) as.data.table(t(names(y))) %>% setnames(paste0("LC",
> seq_along(.)))
> +       ) %>%
> +       rbindlist(use.names=TRUE,fill = TRUE)
> +   ) %>% rbindlist(use.names=TRUE,fill = TRUE)
> + ) %>% rbindlist(use.names=TRUE,fill = TRUE, idcol = "Item")
>
> *Error message:*
> Error in rbindlist(., use.names = TRUE, fill = TRUE, idcol = "Item") :
>    attempt to set index 8424/8424 in SET_STRING_ELT
> In addition: There were 50 or more warnings (use warnings() to see the
> first 50)
>
> I am not understanding what is in SET_STRING_ELT which it is trying to
> throw an error.
> Please help me

The code is trying to write beyond the end of a string vector (to an 
element the vector does not have). This is typically a bug in native 
code of a package.

Best
Tomas

>
>
> *Regards,*
>
> *Anshul Saravgi*
>
> Consulting
> m: 7757030307
>
> <https://www.o9solutions.com/>
> AI powered solutions that predict, prescribe, learn and are 100x faster,
> smarter and easier to use
>



[Rd] Getting error in rbindlist
Tomas Kalibera