R &引用;“娜娜”;在ggplot2中使用sitools时的输出

R &引用;“娜娜”;在ggplot2中使用sitools时的输出,r,ggplot2,R,Ggplot2,我使用sitools格式化ggplot2图表上的刻度标签。当我处理大数字时,最大的主刻度标签是“NANA”,控制台中会显示一条警告消息: Warning message: In number/sifactor[ix] : longer object length is not a multiple of shorter object length 库(ggplot2) 图书馆(sitools) 这些帖子可以帮助你的数据(如果你没有看到的话):()()谢谢,第一篇实际上展示了如何避免问

我使用sitools格式化ggplot2图表上的刻度标签。当我处理大数字时,最大的主刻度标签是“NANA”,控制台中会显示一条警告消息:

Warning message:
  In number/sifactor[ix] :
  longer object length is not a multiple of shorter object length

库(ggplot2)
图书馆(sitools)

这些帖子可以帮助你的数据(如果你没有看到的话):()()谢谢,第一篇实际上展示了如何避免问题(而不是解决问题:)
library(ggplot2)
library(sitools)

data <- data.frame(list(
 Quarter=as.factor(c("Q1 2015","Q2 2015","Q3 2015","Q4 2015","Q1 2016")),
 Operations=c(23000000,54000000,120000000,450000000,12000000)
))

line_chart <- function(df, x, y, tit, xtit, ytit) {
  return(
    df %>% ggplot(aes_string(x=x, y=y)) +
      geom_bar(stat = "identity", size=1) +
      xlab(xtit) +
      ylab(ytit) +
      scale_y_continuous(labels = f2si) +
      ggtitle(tit)
  )
}

line_chart(df=data,
           x="Quarter",y="Operations",
           tit="OPERATIONS BY QUARTER",
           xtit="QUARTER", ytit="OPERATIONS")