Re: [R] Functional Programming Problem Using purr and R's data.table shift function

2022-12-31 Thread Dénes Tóth
Hi Michael, Note that you have to be very careful when using by-reference operations in data.table (see `?data.table::set`), especially in a functional programming approach. In your function, you avoid this problem by calling `data.table(A)` which makes a copy of A even if it is already a dat

Re: [R] Functional Programming Problem Using purr and R's data.table shift function

2022-12-31 Thread Rui Barradas
Às 06:50 de 31/12/2022, Michael Lachanski escreveu: Hello, I am trying to make a habit of "functionalizing" all of my code as recommended by Hadley Wickham. I have found it surprisingly difficult to do so because several intermediate features from data.table break or give unexpected results usin

[R] Functional Programming Problem Using purr and R's data.table shift function

2022-12-31 Thread Michael Lachanski
Hello, I am trying to make a habit of "functionalizing" all of my code as recommended by Hadley Wickham. I have found it surprisingly difficult to do so because several intermediate features from data.table break or give unexpected results using purrr and its data.table adaptation, tidytable. Here