# Disable Scientific Notation in R (2 Examples) | How to Prevent Exponential Numbers

In this tutorial, you will learn how to **disable scientific notation** (e.g. e+10) in the R programming language. The article will be structured as follows:

- Creation of Example Data
- Disable Scientific Notation with R Options (Example 1)
- Disable Scientific Notation with format Function (Example 2)
- Further Resources for the Handling of Exponential Notation in R

Figure 1 shows a **quick overview** of the following examples:

**Figure 1: Overview of Number Representations in R.**

However, for further explanations keep on reading…

## Create Example Data

In the examples of this article, I will use the following numeric data object:

x <- 123456789101112131415 # Example data object x # Print example data to console # 1.234568e+20 |

x <- 123456789101112131415 # Example data object x # Print example data to console # 1.234568e+20

We will use the number 123456789101112131415, which is stored in the data object x.

As you can see based on the previous RStudio console output, base R formats this number automatically to an **exponential notation** (i.e. 1.234568e+20).

In the following examples, I will show you two ways how to disable this notation in R.

So without further ado, let’s move on to the examples…

## Example 1: Modify R Options to Disable Scientific Notation

A general approach is to change the options within R. You just need to execute the following syntax in order to tell R that it should not show scientific notation anymore:

options(scipen = 999) # Modify global options in R |

options(scipen = 999) # Modify global options in R

Let’s see what happens when we print our example data to the RStudio console again:

x # Print example data once more # 123456789101112131415 |

x # Print example data once more # 123456789101112131415

The exponential representation was removed and all digits of our example data are shown. Look’s good!

**Note:** With the previous code, we changed the general R settings. If you want to move back to the old settings you can either restart RStudio; Or you can back up the default options before changing them; Or…

…you might use the syntax shown in the next example, where we switch off scientific notation for only one specific number!

## Example 2: Disable Scientific Notation with the format R Function

The R format function enables us to prevent R from showing an exponential representation. Have a look at the following R code:

format(x, scientific = FALSE) # Apply format function in R # "123456789101112131584" |

format(x, scientific = FALSE) # Apply format function in R # "123456789101112131584"

As you can see, the whole number with all digits was returned to the RStudio console.

**Note:** This number was converted to the character class. If you want to perform calculations with the converted output, you need to transform this character back to numeric.

## Further Resources for Dealing with Exponential Notation

Handling scientific notation can be confusing. If you want to learn more about scientific notation in general, I can recommend the following YouTube video of Tyler DeWitt. In the video he explains how scientific notation works in general:

Furthermore, you might have a look at the other articles of this website. I’m publishing R tutorials on the handling of numeric data regularly:

- Format Decimal Places in R
- Convert Character to Numeric in R
- sprintf R Function
- List of R Commands (+ Examples)
- The R Programming Language

In this tutorial, I have shown you how to get rid of exponential notation in R. However, if you have further questions on this or any other statistical topic, don’t hesitate to let me know in the comments below!

### Subscribe to my free statistics newsletter:

### R Tutorials

abs Function in R

all & any R Functions

Set Aspect Ratio of Plot

attach & detach R Functions

attr, attributes & structure in R

cbind R Command

Change ggplot2 Legend Title

Character to Numeric in R

Check if Object is Defined

col & row sums, means & medians

Complete Cases in R

Concatenate Vector of Strings

Convert Date to Weekday

cumsum R Function

Data Frame Column to Numeric

diff Command in R

difftime R Function

dim Function in R

dir R Function

Disable Scientific Notation

Draw Segments in R

droplevels R Example

Evaluate an Expression

Extract Characters from String

Factor to Numeric in R

Format Decimal Places

get, get0 & mget in R

is.na R Function

is.null Function in R

jitter R Function

Join Data with dplyr Package

length Function in R

lowess R Smoothing Function

max and min Functions in R

NA Omit in R

nchar R Function

ncol Function in R

nrow Function in R

outer Function in R

pairs & ggpairs Plot

parse, deparse & R expression

paste & paste0 Functions in R

pmax and pmin R Functions

polygon Plots in R

pretty R Function

R Find Missing Values

R Functions List (+ Examples)

R NA – Values

R Replace NA with 0

rbind & rbind.fill in R

Read Excel Files in R

readLines, n.readLines & readline

Remove Element from List

Remove Legend in ggplot2

Rename Column Name in R

Replace Last Comma of String

rev R Command

Round Numeric Data in R

Save & Load RData Workspace

scan R Function

setdiff R Function

setNames vs. setnames in R

sink Command in R

Sort, Order & Rank Data in R

sprintf Function in R

Square Root in R

str_c Function of stringr Package

str_sub Function of stringr Package

strptime & strftime Functions

substr & substring R Commands

sweep R Function

Transform Data Frames

union Function in R

unlist in R

weekdays, months, quarters & julian in R

with & within R Functions

Write Excel File in R