Skip to content

Getting Started

Installation and basic setup for Roughly

This guide will walk you through installing and configuring Roughly for your R projects.

Roughly CLI

Installation

  1. Download the pre-built binary for your platform from the GitHub Releases page
  2. Add the binary to your system PATH

Usage

Roughly provides several commands to format code, check for issues, and run a language server:

Terminal window
# Format R files
roughly fmt # Format files in current directory
roughly fmt path/to/files # Format files at the specific path
# Check for issues
roughly check # Lint files in current directory
# Run the language server
roughly server # Start the LSP server

Editor Integrations

VS Code Extension

Roughly is available as a VS Code extension:

  1. Download the latest roughly.vsix from the GitHub Releases page
  2. Install in VS Code:
    Terminal window
    code --install-extension roughly.vsix
  3. Configure in VS Code settings:
    {
    "roughly.path": "/path/to/roughly"
    }

RStudio (formatter only)

You can configure Roughly as an external formatter in RStudio:

  1. Open RStudio and navigate to:

    Options > Code > Formatting > Format with an External Tool

    Set the reformat command to: path/to/roughly fmt

  2. To enable format-on-save, go to:

    Options > Code > Saving > Format with an External Tool

    Check the Reformat documents on save option

Project Configuration

Create a roughly.toml file in your project root to customize Roughly’s behavior:

case = "snake_case" # or "camelCase"
spaces = 2

For detailed configuration options, see the Configuration documentation.