Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid Scientific notation in cut function in R

How to avoid scientific notation present in the Intervals created by the cut function.

a<-seq(10000,50000, by=500 )
cut(a, breaks = seq(0,max(a)+300, by = 300))

I have tried the below but it doesn't help.

options("scipen"=100, "digits"=4)
like image 518
Shoaibkhanz Avatar asked Mar 12 '15 08:03

Shoaibkhanz


People also ask

How do I turn off scientific notation in R?

First of all, create a vector and its plot using plot function. Then, use options(scipen=999) to remove scientific notation from the plot.

How do I stop e+ in R?

Remove notation in the entire R session You can disable scientific notation in the entire R session by using the scipen option. Global options of your R workspace. Use options(scipen = n) to display numbers in scientific format or fixed.

How do you cancel scientific notation?

(1) Right-click a cell where you want to remove scientific notation, and (2) choose Format Cells… 2. In the Format Cells window, (1) select the Number category, (2) set the number of decimal places to 0, and (3) click OK. Now the scientific notation is removed.

How do I get rid of scientific notation in ggplot2?

The scale_x_continuous() and scale_y_continuous() methods can be used to disable scientific notation and convert scientific labels to discrete form.


1 Answers

As suggested by Pascal,

Try with adding the argument dig.lab = 5 to cut function.

like image 121
Shoaibkhanz Avatar answered Sep 28 '22 02:09

Shoaibkhanz