posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.67k stars 80 forks source link

Add "row names" to Data viewer and extend support to other objects such as xts #4120

Open abrahammbs93 opened 3 months ago

abrahammbs93 commented 3 months ago

It will be a great addition for packages such as zooand xts that use data.frames/matrix and leverage row names attributes.

Including a filter / sorting / aggregation may also be great in general for rownames.

So far the Data viewer dont allow any filtering at all.

image

image

dfalbel commented 3 months ago

We currently look for the row.names attribute when querying info for the data explorer:

https://github.com/posit-dev/ark/blob/75de9287cbfc6fd53e2bf7189cb5f0b7d743fcc3/crates/ark/src/data_explorer/r_data_explorer.rs#L1035-L1052

We could special case it to use index when dealing with xts/zoo objects.

To add support for filtering we'd want to make sure xts/zoo objects are treated as numbers here:

https://github.com/posit-dev/ark/blob/1c8817c664c3fa6f50d8e12b8421509dabe3063b/crates/ark/src/data_explorer/r_data_explorer.rs#L1091-L1102

abrahammbs93 commented 3 months ago

I believe that zoo/xta support would be a great enabler for econometric and financial applications.

Thanks for you answer

juliasilge commented 2 months ago

This came up in discussions here: https://github.com/posit-dev/positron/discussions/4315