如何在R plotly中使用当前区域设置设置时间格式
在R plotly中,如果我绘制基本时间序列:如何在R plotly中使用当前区域设置设置时间格式,r,locale,plotly,r-plotly,R,Locale,Plotly,R Plotly,在R plotly中,如果我绘制基本时间序列: library(plotly) today <- Sys.Date() tm <- seq(0, 600, by = 10) x <- today - tm y <- rnorm(length(x)) plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today")) 我得到“28 mars 2019”,因为我所在的地区是法国。如何告诉p
library(plotly)
today <- Sys.Date()
tm <- seq(0, 600, by = 10)
x <- today - tm
y <- rnorm(length(x))
plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today"))
我得到“28 mars 2019”,因为我所在的地区是法国。如何告诉plotly使用当前区域设置显示轴?例如,我想用“Avr 2018”而不是“Apr 2018”作为勾选标签。您可以使用
config
plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today")) %>% config(locale = 'fr')
plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today")) %>% config(locale = 'fr')