REditorSupport / REditorSupport/vscode-R
View() fails to handle lubridate Period objects within a data structure
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 139
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 5
Description
Describe the bug
In VS Code, View() displays only the seconds of Period objects when in some sort of larger data structure, like a tibble, data frame or a list. Haven't tested with other data structures.
View(tibble(x=lubridate::period(num = 20, unit="hours")))
Behaviour in VS Code with the R extension:
To Reproduce
Steps to reproduce the behavior:
- Use VS Code with the R Extension
- Try to View a Period object within some data structure like so: View(tibble(x=period(num=20, unit="hours")))
- See View() output
Can you fix this issue by yourself? (We appreciate the help)
No :(
Expected behavior
Normal Rstudio behaviour:
Environment (please complete the following information):
- OS: Ubuntu 22.04.3 LTS
- VSCode Version: 1.81
- R Version: 4.3.0
- vscode-R version: 2.8.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
First reproduce View(tibble(x=lubridate::period(num=20, unit="hours"))) in the VS Code R extension and compare the displayed Period with the expected RStudio behavior. Trace the View() data-display path to find where Period values inside structures are converted, then verify that hours are preserved in the output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100