You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to r-lib/vctrs#27 and #196 but I feel that a separate discussion is warranted here.
I would like to see a very simple sparse tibble where constant columns could be stored as a single value. So a tibble like this:
> tibble(a=1:3, b=1)
# A tibble: 3 x 2ab<int><dbl>111221331>
is internally stored as:
>list(a=1:3, b=1)
$a
[1] 123$b
[1] 1
This way you could store attributes along the data itself without extra space requirements and completely avoid dealing with R attributes. If such an attribute is an atomic singleton most vectorized operations should automatically propagate due to R's recycling rules and behave as if it's a proper column.
For what it's worth, I would need this for a more lightweight and more generic version of periods than what's currently implemented in lubridate.
The text was updated successfully, but these errors were encountered:
I think this is out of scope for tibble - I think it will be a lot of work to implement (and it can't work for any C functions that don't call as.data.frame()), so it's worth starting incubating somewhere else. If the incubation is successful we could consider incorporating into tibble.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
This is related to r-lib/vctrs#27 and #196 but I feel that a separate discussion is warranted here.
I would like to see a very simple sparse tibble where constant columns could be stored as a single value. So a tibble like this:
is internally stored as:
This way you could store attributes along the data itself without extra space requirements and completely avoid dealing with R attributes. If such an attribute is an atomic singleton most vectorized operations should automatically propagate due to R's recycling rules and behave as if it's a proper column.
For what it's worth, I would need this for a more lightweight and more generic version of periods than what's currently implemented in lubridate.
The text was updated successfully, but these errors were encountered: