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
Pivoting longer is an operation that is useful when a single row contains multiple observations or measurements. For example:
time
left_temp
right_temp
1
10
20
2
15
18
The columns left_temp and right_temp are really the combination of a "feature" (location) and a "measurement" (temp). We can pivot longer to extract these into their own columns:
time
location
temp
1
left
10
1
right
20
2
left
15
2
right
18
The addition of this capability should make it possible to fully bind tidyr's pivot_longer and pivot_wider (the latter can be expressed using a combination of project and aggregate). However, there is a considerable amount of convenience that could still be added and much of this is captured in the parent issue #34265
Component(s)
C++
The text was updated successfully, but these errors were encountered:
It appears that DuckDb has tackled the pivot feature at the same time (and their implementation is much more complete). They use unnest for pivot longer but it's not clear to me that we could do the same thing here. It relies on the ability to create a sort of list comprehension out of field references to convert field references to elements into a field reference to a list element (I'm not sure exactly what this syntax is called). It's quite impressive :)
Describe the enhancement requested
Pivoting longer is an operation that is useful when a single row contains multiple observations or measurements. For example:
The columns
left_temp
andright_temp
are really the combination of a "feature" (location
) and a "measurement" (temp
). We can pivot longer to extract these into their own columns:The addition of this capability should make it possible to fully bind tidyr's pivot_longer and pivot_wider (the latter can be expressed using a combination of
project
andaggregate
). However, there is a considerable amount of convenience that could still be added and much of this is captured in the parent issue #34265Component(s)
C++
The text was updated successfully, but these errors were encountered: