posit-dev / posit-dev/positron

Data Explorer - scientific notation - does not adhere to options(scipen = xxx)

Open
#4,818 8 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: data explorer enhancement lang: r support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Description

System details:

Positron and OS details:

Positron Version: 2024.09.0 (Universal) build 27
Code - OSS Version: 1.92.0
Commit: d996153f3be6bcc9af460300e61103425323b973
Date: 2024-09-11T02:38:46.408Z
Electron: 30.1.2
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0

Interpreter details:

R 4.4.1

Describe the issue:

I am trying to use Positron for some data wrangling and the data explorer is great in general. However, I have multiple columns in various data frames that are of the type "double". These are typically 9-digit integers in my data, but this happens when they grow to over 7 digits.

The data explorer seems to always want these doubles in scientific notation. I have tried specifying the option(scipen=999) without any change.

If I change the data type of a column to integer then the scientific notation goes away.

I have found no setting in Positron nor anything on the google that gives me a hint that there is a setting somewhere else.

In RStudio if I set the scipen option and then run View(x) on a data frame it will respect the scipen option in the display.

Steps to reproduce the issue:

options(scipen = 999)
test_data <- data.frame(
                    order_proc_id = as.double(sample(11528843:11528943, 100, replace = TRUE)),
                    order_inst = sample(seq(as.POSIXct('2020-01-01'), as.POSIXct('2023-01-01'), by="day"), 100, replace = TRUE),
                    department_name_ahpl_combined = sample(c("Cardiology", "Neurology", "Oncology", "Pediatrics"), 100, replace = TRUE)
                ) |> View()

Expected or desired behavior:

Data Explorer should display numeric data in accordance with the scipen option setttings.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Data Explorer entry point by reproducing the issue with the provided R options(scipen = 999) and View() example, then trace how double values are formatted for display. Done means numeric values follow the R scipen setting instead of always using scientific notation, while integer and date columns continue to display correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.