Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support computing statistics for haven_labelled data types in data explorer for R #5327

Closed
wesm opened this issue Nov 11, 2024 · 1 comment
Closed
Assignees
Labels
area: data explorer Issues related to Data Explorer category. enhancement New feature or request lang: r

Comments

@wesm
Copy link
Contributor

wesm commented Nov 11, 2024

As noted in #5230, we don't show any summary sparklines for haven_labelled type columns loaded from read_sav, for example.

@wesm wesm added area: data explorer Issues related to Data Explorer category. enhancement New feature or request lang: r labels Nov 11, 2024
@dfalbel dfalbel self-assigned this Nov 11, 2024
@dfalbel dfalbel added this to the 2024.12.0 Pre-Release milestone Nov 22, 2024
lionel- added a commit that referenced this issue Nov 27, 2024
## Positron Notes

### Release Notes

#### New Features

- The variable pane now supports labels from the {haven} package
(#5327.

- The variable pane has improved support for formulas
(#4119).

#### Bug Fixes

- Assignments in function calls (e.g. `list(x <- 1)`) are now detected
by the missing symbol linter to avoid annoying false positive
diagnostics (#3048). The downside is that this causes
false negatives when the assignment happens in a call with local scope,
e.g. in `local()` or `test_that()`. In these cases the nested
assignments will incorrectly overlast the end of the call. We prefer to
be overly permissive than overly cautious in these matters.

- The following environment variables are now set in the same way that R
does:

  - `R_SHARE_DIR`
  - `R_INCLUDE_DIR`
  - `R_DOC_DIR`

  This solves a number of problems in situations that depend on these
variables being defined
(#3637).
lionel- added a commit that referenced this issue Nov 27, 2024
### Release Notes

#### New Features

- The variable pane now supports labels from the {haven} package
(#5327.

- The variable pane has improved support for formulas
(#4119).

#### Bug Fixes

- Assignments in function calls (e.g. `list(x <- 1)`) are now detected
by the missing symbol linter to avoid annoying false positive
diagnostics (#3048). The downside is that this causes
false negatives when the assignment happens in a call with local scope,
e.g. in `local()` or `test_that()`. In these cases the nested
assignments will incorrectly overlast the end of the call. We prefer to
be overly permissive than overly cautious in these matters.

- The following environment variables are now set in the same way that R
does:

  - `R_SHARE_DIR`
  - `R_INCLUDE_DIR`
  - `R_DOC_DIR`

This solves a number of problems in situations that depend on these
variables being defined
(#3637).

<!-- Thank you for submitting a pull request.
If this is your first pull request you can find information about
contributing here:
  * https://github.com/posit-dev/positron/blob/main/CONTRIBUTING.md

We recommend synchronizing your branch with the latest changes in the
main branch by either pulling or rebasing.
-->

<!--
  Describe briefly what problem this pull request resolves, or what
  new feature it introduces. Include screenshots of any new or altered
  UI. Link to any GitHub issues but avoid "magic" keywords that will 
  automatically close the issue. If there are any details about your 
approach that are unintuitive or you want to draw attention to, please
  describe them here.
-->
@testlabauto
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2025.01.0-2
OS Version          : OSX

Test scenario(s)

library(haven)
library(labelled)

# Create a haven-labeled dataframe
df <- data.frame(
  id = 1:5,
  gender = c(1, 2, 1, 2, 1),
  age = c(25, 30, 35, 40, 45),
  income = c(50000, 60000, 55000, 65000, 70000)
)

# Assign labels to individual variables
df$gender <- labelled(
  df$gender,
  labels = c("Male" = 1, "Female" = 2)
)
df$income <- labelled(
  df$income,
  labels = c(
    "Low Income" = 50000,
    "Medium Income" = 60000,
    "High Income" = 70000
  )
)

# Add variable-level labels
df <- set_variable_labels(
  df,
  gender = "Gender of the respondent",
  age = "Age in years",
  income = "Income level in USD"
)

Link(s) to TestRail test cases run or created:

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: data explorer Issues related to Data Explorer category. enhancement New feature or request lang: r
Projects
None yet
Development

No branches or pull requests

3 participants