posit-dev / positron

Positron, a next-generation data science IDE
Other
2.54k stars 79 forks source link

Variables pane: misleading representation of labeled numeric variables #5010

Open grasshoppermouse opened 4 days ago

grasshoppermouse commented 4 days ago

System details:

Positron and OS details:

Positron Version: 2024.10.0 (Universal) build 14 Code - OSS Version: 1.93.0 Commit: 901ab5d11d694212d32e53b97f771c5d601e428e Date: 2024-10-09T15:26:55.363Z Electron: 30.4.0 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Darwin arm64 23.6.0

Interpreter details:

R 4.4.0

Describe the issue:

Labeled numeric variables are rendered as if they are character variables (in quotes): Image

Steps to reproduce the issue:

mtcars$cyl_lab <- haven::labelled(mtcars$cyl, label = "Cylinders")

Expected or desired behavior:

Numeric values should not be in quotes.

Were there any error messages in the UI, Output panel, or Developer Tools console?

No.

juliasilge commented 4 days ago

Here is what the classes are:

mtcars$cyl_lab <- haven::labelled(mtcars$cyl, label = "Cylinders")

class(mtcars$cyl_lab)
#> [1] "haven_labelled" "vctrs_vctr"     "double"
class(mtcars$cyl)
#> [1] "numeric"

Created on 2024-10-11 with reprex v2.1.1

Note that the new labeled thing does have "double" in its classes.