Code in `.First()` function is not run in `.Rprofile`

Open
#6,417 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
r

Research direction

Start with the reproduction in the issue: compare a .Rprofile containing a .First() function with one containing a bare assignment, and consult discussion #6394 for context. Trace how Positron starts an R session and loads .Rprofile; done means code inside .First() runs and defines x as expected.

Written by the indexing model from the issue text.

Description

bug lang: r support

In https://github.com/posit-dev/positron/discussions/6394 we have a report of code not getting run if it is in the .First() function in .Rprofile.

For example, if your .Rprofile has this in it:

.First <- function(){
    x <- 1
}

that variable is not actually defined.

If you have x <- 1 in your .Rprofile but "bare" then it does get executed.

Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

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.

More from posit-dev/positron

All issues in posit-dev/positron

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.