Documentation about .Rproj files

Hi,

I am a vim user, but most of my collaborators use RStudio and R projects.

To properly support .Rproj files with a vim plugin, I would need to parse some options (e.g., UseSpacesForTab or NumSpacesForTab) that have an equivalent in vim.

Unfortunately, I was not able to find a proper documentation a .Rproj files (mostly a list of available options and value that they can take).

Any idea where I could find that?

2 Likes

Unfortunately we don't document the actual underlying format of the .Rproj file, but it is effectively just a Debian control file. What fields in particular do you need to parse? (UseSpacesForTab and NumSpacesForTab will always be integers when they exist)

If there is no documentation of the format, is there any chance that I could get my hands on a list of available fields (and the values that they can take)?

Essentially, I would need all the fields that are not RStudio-specific, and looking at e.g., https://github.com/r-lib/devtools/blob/master/devtools.Rproj, it looks like no field is really specific to RStudio (except EnableCodeIndexing and BuildType, although I still plan on using the former).

Or is the devtools.Rproj "complete" (i.e., it has all the potential options)?

Since the field names are pretty self explanatory, I think that just having their possible values would be more than enough.

PS: UseSpacesForTab does not look like an integer.

Sorry -- you are of course correct...

The closest thing we have to documentation of the format is the code that reads the .Rproj file:

It might be a useful reference, at least.

1 Like

It's perhaps also worth saying that support for .editorconfig is on the horizon, so in the future we may take that as a source of truth for editor preferences in lieu of what's in the .Rproj file.

Thanks for the link to RProjectFile.cpp, it's more than enough for now.

It is true that using .editorconfig would be much easier :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.