Troubleshooting
Most problems during setup and early use are one of a handful of things. Find the one that matches yours below. This page grows over time.
Security warnings when downloading or installing
Installing R or RStudio for the first time can bring up a warning or two — a browser prompt, a blue “Windows protected your PC” box, or a request for a password on a work machine. This is normal for brand-new software from a source your computer hasn’t seen you use before; none of it means anything is wrong. Open the box that matches your situation:
When an installer finishes downloading, your browser may ask whether to keep the file. Keep it — it’s the installer you just requested.
Running the R installer, Windows may show a blue SmartScreen box offering, at first, only a Don’t run button. This is reputation-based, not a virus alert: it appears because the file is newly released and too few people have downloaded it yet for Windows to recognize it — not because anything is wrong with it. Click More info and the box expands to show the app name and the publisher, along with a Run anyway button. Only ever do this for installers you downloaded yourself from the official sources — cran.r-project.org for R and posit.co for RStudio.

On some machines — most often university- or employer-managed ones — the blue box appears with no More info link at all: just a Don’t run button and no way past it. This usually happens when the installer is launched from the browser’s download list. The fix is to launch it from your Downloads folder instead: open File Explorer, go to Downloads, and double-click the installer there. If the box still offers no way through even from the Downloads folder, you’re in the managed-computer situation — see the next box down.
Next, Windows asks permission to make changes to your computer — the User Account Control box. It opens with No highlighted, so you have to click Yes on purpose. Where it names a verified publisher, that’s Windows confirming the installer’s digital signature checked out. (RStudio’s permission box looks the same. You generally won’t see the SmartScreen step for RStudio, because its publisher is already widely recognized.)

One last thing, if you ever download an installer twice: the second copy comes back with a number added to its name, like R-4.6.1-win (1).exe. Any copy is fine to run — the (1) is just your browser avoiding a name clash, not a different or altered program.
On a university or workplace computer you may not be allowed to install software yourself. What happens depends on how the machine is set up:
- Look first in your organization’s self-service software catalog — on Windows this is often an app called Company Portal. If R is listed there, install it from the catalog: it goes in with your organization’s approval already in place, so you never meet the security boxes described above. Look for RStudio in the same place. Anything the catalog doesn’t offer goes through one of the routes below.
- The blue box shows no More info link at all, even when you launch the installer from your Downloads folder. This one looks worse than it is: the block has been set centrally, so there’s nothing to fix at your end — and it’s a routine request for IT, often settled in a single phone call. Ask your IT service desk to unblock the R and RStudio installers, or to install them for you; going through them keeps everything in line with your organization’s policies. The note below is written for whoever picks it up.
- The install is blocked, but the screen offers a path to temporary administrator rights — usually a prompt for your own credentials, sometimes followed by a box asking why you’re installing. Both are routine; fill them in and carry on.
- There’s no self-service path, in which case R and RStudio are requested through your IT service desk, a software catalog, or your instructor. The note below is written for whoever handles that request — you can point them straight to it.
The rest of this entry is addressed to IT staff.
A student or researcher has asked to install R and RStudio Desktop, the standard open-source tools for statistical computing and the environment these guides teach. This note summarizes their provenance to support a software-approval assessment.
- Sources. R is published by the R Foundation through CRAN (cran.r-project.org); RStudio Desktop comes from Posit (posit.co / docs.posit.co). Both are long-established and in wide academic and government use.
- Signatures and integrity. The R for Windows installer is code-signed — the User Account Control dialog shows a verified publisher — and it is downloaded over HTTPS from CRAN, which also publishes checksums for verifying the download. RStudio Desktop is signed by Posit Software, PBC.
- Installing without administrator rights. Administrator rights aren’t strictly required. Run without them, the R for Windows installer installs into the user’s own file area instead of Program Files (administrator rights are needed only for a system-wide install and the optional registry entries). RStudio Desktop is additionally offered as a Windows
.ziparchive that can be unpacked and run without the installer; current deployment guidance is on Posit’s documentation site. - SmartScreen. Microsoft SmartScreen may flag a freshly released version until it accumulates download reputation; this resets with each release and is not an indication of malware. Where the user reports the warning with no More info option at all, that is typically SmartScreen configured to warn without a bypass rather than the default reputation check; the installers are code-signed and their provenance is above, so clearing it is at your discretion.
- Organizations operating under standards such as ISO/IEC 27001 will route this through their software-approval process; the information above is provided to support that assessment.
Installing jstats
During the install, the Console may print a red WARNING that Rtools is required to build R packages. It looks alarming, but it’s normal and not an error: it’s RStudio’s general-purpose check for build tools, and it fires on almost any package install on a Windows computer that doesn’t have Rtools. jstats doesn’t need Rtools — it contains no compiled code and installs as a ready-made binary — so the install completes and jstats runs fine. You can ignore the warning; there’s nothing to fix.
The answer to that question is No. Nothing is broken if you clicked Yes — the install may just stall, fail, or fill the Console with red text.
Run the install line on the Install jstats page again, and click No this time.
The simplest fix is to remove jstats and install it fresh:
remove.packages("jstats")
install.packages("jstats",
repos = c("https://jma61.r-universe.dev", "https://cloud.r-project.org"))
library(jstats)On many Windows computers the Documents folder is synced by OneDrive — and by default that is where R keeps its package library (the folder your installed packages live in). OneDrive can lock files while it syncs, and an install that runs into a lock fails part-way with messages like the ones above.
Fixes, from simplest to most durable:
Pause OneDrive and retry. Click the OneDrive cloud icon near the clock, choose Pause syncing, run the install line again, then resume syncing.
Give R a package library outside the synced folder. This one-time setup ends the problem for good. Create a plain folder directly on your drive, such as
C:\Rlibs. Then create a plain text file named.Renvironin your Documents folder containing this single line:R_LIBS_USER=C:/Rlibs(Note the forward slash — that’s how R writes paths.) Restart R and run the install line again; packages now install to the new folder, out of OneDrive’s reach.
A related, rarer cause of the same errors: a Windows username containing accented or non-English characters can break the library path in the same way. The same fix applies — a package library at a simple location like C:/Rlibs.
On managed work or lab computers, two things can stop the install: your account may not be allowed to install software, or the network may block downloads from sites it doesn’t recognize. Neither is anything you did wrong — and the request to your IT support is a small one. jstats installs as a ready-made binary (no compilers or build tools are needed), fetched from the two addresses in the install line: the r-universe repository (jma61.r-universe.dev) and an ordinary CRAN mirror (cloud.r-project.org). Ask IT either to allow those two addresses or to run the install line for you; either way it’s a quick job for them.
Restart R first. A session that had jstats loaded keeps running the copy it loaded, even after an install or jupdate() puts a newer one on your computer — and packageVersion("jstats") reports the new number all the same, because it reads the installed copy, not the one the session is running. Choose Session > Restart R, then run library(jstats); the startup line names the version now in use. If it still names the old one, read on.
R keeps installed packages in a library — a folder on your computer — and there can be more than one. That’s normally invisible and harmless: jstats installs into one of them and runs fine from there.
It only matters if you end up with two copies in two libraries — then R can keep loading an older copy from one while a newer copy sits unused in the other, and you appear stuck on the old version. jupdate() does not cause this: it updates the copy of jstats that R is using, wherever that copy lives. A second copy usually comes from running the install line again by hand. To see which copy R is using, and every library R searches:
find.package("jstats") # the folder of the copy R loads
.libPaths() # every library R searches, in orderIf those reveal a second, older copy, remove it from the library it sits in and restart R:
remove.packages("jstats", lib = "paste-the-other-library-path-here")Then load jstats again and confirm the version with packageVersion("jstats").
“R cannot write to the folder where jstats is installed.” The message names the folder, and it means your account isn’t allowed to change files there — common when jstats sits in a system-wide folder, or on a work or lab computer. Nothing has been changed. The message gives the two usual ways through: run R with permission to write to that folder, or ask your IT department to run the update, which is a quick job for them.
If neither is open to you, there is a third way: run the install line again.
install.packages("jstats",
repos = c("https://jma61.r-universe.dev", "https://cloud.r-project.org"))This puts the new version in your own personal library (if R asks whether to create one, answer Yes), and R loads that newer copy from then on. The old copy stays where it was, unused. That is the two-copies situation from the entry above, entered on purpose; it does no harm as long as you know it is there.
“The update did not complete.” The copy on your computer is unchanged. Read the line under R reported: — it is R’s own account of what stopped the download, usually a web address it could not reach. On a university or work network, that line is the one to show your IT department.
Starting RStudio and loading jstats
This almost always means an install command was put in your .Rprofile. That file runs every time R starts, so an install line tries to reinstall on every startup and can loop. Your .Rprofile should only ever hold lightweight startup lines like library(jstats) — never an install command. To recover: close RStudio, open your Project folder in your computer’s file manager, open the .Rprofile file in a plain text editor (Notepad on Windows, TextEdit on Mac), delete the install line, keeping the library(jstats) line (and its reminder comment, if your .Rprofile has one), save, and reopen RStudio.
Two things account for most surprises here, and neither means anything is wrong.
RStudio reopens your last Project. By default, RStudio starts up inside whichever Project you had open last time, so your working directory is that Project’s folder. To work somewhere else, open the Project you want (File > Open Project) or close the current one (File > Close Project). To stop RStudio doing this, go to Tools > Global Options > General and untick Restore most recently opened project at startup.
The Console header and getwd() spell the same folder differently. The top of the Console shows your working directory in a short form that begins with ~, which stands for your home folder. getwd() prints the same address written out in full. On most Windows computers home is your Documents folder; on some it has been moved elsewhere, such as a OneDrive folder or another drive, so the full address can look unfamiliar. To see where ~ points on your computer, run path.expand("~"). Loading, Saving, Converting Data has more on how R writes file paths.
While jstats is still in development it installs from an r-universe repository, and each time it loads it briefly checks that repository for a newer version. The package itself works fully offline, but on a machine that is connected to a network yet has no route to the open internet — common on locked-down lab or server installations — that check has to time out before loading finishes, so library(jstats) can pause for a few seconds.
To skip the check and load immediately, set this option before loading the package:
options(jstats.check_updates = FALSE)
library(jstats)Putting the options(...) line above the library(jstats) line in your .Rprofile makes it the default every session. On an ordinary internet connection you can leave it out — the check is fast there, and it’s how you learn an update is available.
This is specific to this pre-CRAN version. Once jstats reaches CRAN, installing and updating happen the normal CRAN way, with no startup check of this kind.
When you load jstats, R may print a warning that the package was built under R version 4.x.x. It’s normal and not an error: the ready-made copy you downloaded was built on a slightly newer version of R than the one on your computer. jstats is loaded and working, and there’s nothing to fix. The warning will reappear each time you load the package until your own R catches up, and it clears the next time you update R.
This shows up two ways: you run library(jstats) in the Console and get this error, or — if your .Rprofile loads jstats automatically — the same error greets you every time RStudio starts. Either way, the usual cause is that R itself was updated. Your installed packages live in a folder called a library, and each version of R gets its own — so updating R starts a fresh, empty one, and jstats (along with everything else you had installed) is no longer there.
The rule in plain words: R’s version numbers have three parts, like 4.5.2. Only a change to the middle number (4.5 → 4.6) starts a fresh package library; a last-number update (4.5.1 → 4.5.2) changes nothing about your packages. And this is about R, not RStudio — RStudio updates are always safe and never touch your packages. R has no built-in update notifier, so updating R is a separate, deliberate act; if you did it recently, this reinstall is the one follow-up chore.
(Why jupdate() can’t rescue you here: jupdate() is itself a jstats command, and jstats isn’t installed in the new library yet.)
The fix is the same install line as the first time — run it once and you’re back:
install.packages("jstats",
repos = c("https://jma61.r-universe.dev", "https://cloud.r-project.org"))
library(jstats)Don’t confuse this error with the harmless warning that jstats was built under R version 4.x.x — that one just means the ready-made copy was built on a slightly different R patch, needs no action, and clears on its own. This callout is about the actual error where jstats can’t be found at all.
For the bigger picture on updating R — when to do it, and the fresh-library chore that follows — see the Updating page.
jstats probably isn’t loaded in this session. Run:
library(jstats)If it still isn’t found, check spelling and capitalization — R is case-sensitive, so jfreq and jFreq are different names.
The shipped datasets become available once the package is loaded. Run library(jstats) first, then try again. (If you’re working with your own data instead, make sure you’ve loaded it — see Loading, Saving, Converting Data.)
Typing commands in the Console
If you press Enter and the Console answers with a + instead of the usual > prompt, R thinks your command isn’t finished — nearly always a closing quotation mark or a closing parenthesis is missing. Press the Escape key (Esc) to cancel and get a fresh > prompt, then retype or re-paste the whole command. (Typing more into the + line rarely ends well; Escape and a clean start is quicker.)
These errors are R’s way of saying the punctuation in a command doesn’t add up — most often a missing comma between two inputs, or a missing or extra parenthesis or quotation mark. Compare your line character by character against the example you copied it from; the difference is usually one small mark.
A reading tip that helps with R errors in general: in a long error message, the most useful part usually comes after the final colon — start reading there, then work backward only if you need to.
You typed or pasted a Windows file path with backslashes — something like jload("C:\Users\you\Documents\survey.csv") — and R answered with one of these:
Error: '\U' used without hex digits in character string
Error: '\J' is an unrecognized escape in character string
Error: \500 exceeds maximum allowed octal value \377
(The letter or number after the backslash will be whatever follows a backslash in your own path.) Nothing is wrong with your file. Inside quotation marks, R reads a backslash as the start of a special character, not as part of a path, so it stops before the command runs at all.
The fix is to type the path with forward slashes:
jload("C:/Users/you/Documents/survey.csv")Forward slashes work in R on every kind of computer, Windows included.
Some backslash pairs are ones R accepts — \t is a tab, \n a new line — so a path such as "C:\temp\new.csv" gets past R and reaches jstats. jload(), jsave() and joptions(data.dir = ) then stop with a message of their own, saying how R read the backslashes and showing the path with forward slashes to type instead.
The rule in jstats is short: a variable goes without quotes, after its data frame; anything that is not a variable — a format, a convention, a map, a file name — goes in quotes. So jfreq(community, Region) has no quotation marks, and jload("community.rds") or jconvert(community, to = "stata") does.
Mix the two up and jstats says which way round it should be, with the line to run:
Error: jconvert(): stata is not in quotes.
to = takes a format name in quotes:
jconvert(community, to = "stata")
Error: jdesc(): "community" is in quotes.
A data frame's name goes without them:
jdesc(community, Age)
One more rule goes with it: jstats analyzes the variables of a data frame. A single vector can be described with jdesc(), jfreq() or jscreen(); anything else is added to the data frame first.
Chinese, Japanese and Korean text
R reads only the plain brackets, commas, quotation marks and other punctuation of an English keyboard. An input method left in Chinese (or Japanese, or Korean) mode types the full-width forms instead — (, ,, “ — and R stops before any function runs:
Error: unexpected input in "jfreq(community,"
Type R code with the input method switched to English, and switch to Chinese only for the words inside quotation marks — a label, a category, a file name. If a full-width ; or = gets inside a map = or labels = string, jstats stops with a message of its own that names the character and shows the line with the plain one.
R’s graphics may not have a font for the characters. In RStudio, set the graphics backend to AGG (Tools > Global Options > General > Graphics > Backend), then draw the plot again. If a character is still a box, name a font your computer has that includes it — on a Mac, Songti SC has worked:
jplot(result) + ggplot2::theme(text = ggplot2::element_text(family = "Songti SC"))Nothing is wrong with the numbers. jstats lines its columns up on the assumption that a Chinese character is exactly two letters wide, and many Console fonts draw it a little narrower, so each label pulls its row slightly out of line; R’s own print() drifts the same way. A Console font that draws the characters at exactly two letters’ width (Sarasa Mono SC or Noto Sans Mono CJK SC, for example) lines them up: Tools > Global Options > Appearance > Editor font.
Using jstats outside RStudio
jstats colors its table titles and notes only in the RStudio Console. Anywhere else — Positron, VS Code, a terminal window, or a document rendered with Quarto or R Markdown — the same output prints in plain text, because not every one of those displays color properly. Nothing is missing from the results.
If your program does show color and you would like it, run this once per session, or put it in your .Rprofile:
options(jstats.color = TRUE)(options(jstats.color = FALSE) does the opposite, and turns the color off in RStudio too.)