Importing Data into R Commander: CSV, Excel, Clipboard

Quick answer: In R Commander: Data → Import data → from text file/CSV (or paste from Excel via from clipboard), tick headings if row 1 has column names, and the imported table becomes the active data set instantly. Most beginner failures are separator or decimal quirks — fixed in the same dialog. This guide covers every import route plus the three cleaning moves you’ll need right after. First-time setup: the R Commander install guide.

Every import route, ranked by use case

Your data lives in…Menu path
CSV fileData → Import data → from text file, clipboard, or URL → select file → separator = comma
Excel copy-pasteSelect range in Excel → copy → Data → Import data → from clipboard
Excel file directlyData → Import data → from Excel, with the Rcmdr misc plug-in; or save as CSV first (simplest)
Another R data setData → Load data set → pick .rda from a package or disk
Built-in practice dataData → Data in packages → read data set from package (try mtcars)

The import dialog’s three options decide everything: Variable names in first line (tick it — unticked gives columns named V1, V2), separator (comma for CSV, semicolon on many European locales), and decimal point (period vs comma — mismatched decimals silently turn numbers into text). After import, the toolbar shows your data set as active; click View data set to eyeball it.

The three cleaning moves for fresh data

  • Fix variable types: Data → Manage variables in active data set → Convert numeric variables to factors (and back). If a numeric column imports as text, stray characters are usually why — re-export clean or use Convert.
  • Relabel for reports: Data → Manage variables → Rename variables; and Set variable labels gives your output tables human column names.
  • Subset to what matters: Data → Active data set → Subset active data set — keep rows matching a condition (e.g., one treatment group) or drop columns entirely.

Quick health check before analysis: Statistics → Summaries → Active data set shows every variable’s type, n, and distribution at a glance — a text-mode version of the data types logic in our data types guide. Note that R under the hood handles dates, factors and missing values differently from Excel — the foundations are in the data frames guide.

From import to first result

With data active and clean, follow the tour in what R Commander is and how its window works, run descriptives per the descriptive statistics guide, then run your first test from the statistical tests catalog. Prefer zero-install point-and-click for teaching? Compare with our jamovi setup guide.

For one-to-one help cleaning and structuring real research data, Ampersand Academy teaches R programming and statistics one-to-one.

Frequently asked questions

How do I import a CSV file into R Commander?

Data menu, Import data, from text file. Choose the file, set the separator to comma, tick variable names in first line, and OK. The data becomes the active data set and appears in the toolbar label.

Why do my numeric columns import as text?

Usually a decimal-point mismatch (comma versus period) or stray characters like currency symbols and thousands separators. Re-check the dialog decimal setting, clean the source file, or convert types afterward from the Manage variables menu.

Can I paste data directly from Excel into R Commander?

Yes – copy the range in Excel, then use Data, Import data, from clipboard. Keep one header row and avoid merged cells for a clean result.

How do I open an SPSS .sav file in R Commander?

Through code: the import SPSS menu item or the haven package reads .sav files into a data frame, which R Commander then treats as the active data set.

What does the active data set mean?

R Commander runs every menu action on the currently active data set, shown in the toolbar. Analyses failing with variable-not-found errors almost always mean a different data set is active than you think.