Getting Started
Installation and basic setup for Roughly
This guide will walk you through installing and configuring Roughly for your R projects.
Roughly CLI
Section titled “Roughly CLI”Installation
Section titled “Installation”- Download the pre-built binary for your platform from the GitHub Releases page
- Add the binary to your system PATH
Roughly provides several commands to format code, check for issues, and run a language server:
# Format R filesroughly fmt # Format files in current directoryroughly fmt path/to/files # Format files at the specific path
# Check for issuesroughly check # Lint files in current directory
# Run the language serverroughly server # Start the LSP server
Editor Integrations
Section titled “Editor Integrations”VS Code extension
Section titled “VS Code extension”Roughly can also be used as a VS Code extension.
From Marketplace (Recommended)
Section titled “From Marketplace (Recommended)”Install the extension from the VS Code Marketplace.
The VS Code extension from the marketplace includes a bundled version of the Roughly CLI only for Windows and Linux x64. If you are using macOS or a different architecture, you will need to install the Roughly CLI manually.
Manual Installation
Section titled “Manual Installation”Alternatively, build the extension from source (or download from releases):
bun run package
Install the generated VSIX file:
code --install-extension roughly.vsix
RStudio (formatter only)
Section titled “RStudio (formatter only)”You can configure Roughly as an external formatter in RStudio:
-
Open RStudio and navigate to:
Options > Code > Formatting > Format with an External ToolSet the reformat command to:
path/to/roughly fmt
-
To enable format-on-save, go to:
Options > Code > Saving > Format with an External ToolCheck the
Reformat documents on save
option
Configuration
Section titled “Configuration”For detailed configuration options, see the Configuration documentation.