i am tring to plot data, which range between 1e15-2e15, unfortunately i am not able to plot a nice line graph.How to make y-axis to be abbreviated into 1e15 instead of 1000000000000000in graph DATA Link
>library(readxl)
>library("xlsx")
>library(ggplot2)
>test <- read.xlsx2("/filepath/test.xlsx", 1, header=TRUE)
>ggplot(test,aes(x=NO2, y= SA)) + geom_point()
>class(test$SA)
[1] "factor"
> dput(test)
structure(list(NO2 = structure(1:11, .Label = c("2008", "2009",
"2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017",
"2018"), class = "factor"), Bangladesh = structure(c(1L, 4L,
3L, 6L, 7L, 2L, 9L, 5L, 8L, 10L, 11L), .Label = c("1927189454271550",
> scientific <- function(x) {
parse(text=gsub("e", " %*% 10^", scales::scientific_format()(x)))
}
> ggplot(test,aes(x=NO2, y= SA)) + geom_point() +scale_y_continuous(label=scientific)
Error: Discrete value supplied to continuous scale
> ggplot(test,aes(x=NO2, y= SA)) + geom_point() +scale_y_continuous(label=scales::scientific_format())
Error: Discrete value supplied to continuous scale
>ggplot(test,aes(x=NO2, y= as.numeric(SA)))+scale_y_continuous(label=scientific_10)