[問題] 渲染plot問題
[軟體熟悉度]:
有使用經驗約1-2年
[問題敘述]:
當在做圖時,只要資料是時間格式,例如下方的snippet
air_visits %>%
filter(visit_date > as.POSIXct(as.Date("2016-04-15")) & visit_date <
as.POSIXct(as.Date("2016-06-15"))) %>%
group_by(visit_date) %>%
summarise(all_visitors = sum(visitors)) %>%
ggplot(aes(x = visit_date, y = all_visitors)) +
geom_line(color = "steelblue", size = 1) +
theme_fivethirtyeight() +
geom_smooth(method = "loess", color = "black", span = 1/7, alpha = 0.3)
x軸不管為Date格式或POSIXct,圖片render出來x軸都是中文例如 四月15
我希望是羅馬數字或英文的例如 April 15
我的環境為
"LC_COLLATE=Chinese (Traditional)_Taiwan.950;LC_CTYPE=Chinese
(Traditional)_Taiwan.950;LC_MONETARY=Chinese
(Traditional)_Taiwan.950;LC_NUMERIC=C;LC_TIME=Chinese
(Traditional)_Taiwan.950"
我是覺得轉成英文環境就可以
但我輸入以下
Sys.setlocale(category = "LC_ALL", locale = "UTF-8")
Console就會回應
In Sys.setlocale(category = "LC_ALL", locale = "UTF-8") :
OS reports request to set locale to "UTF-8" cannot be honored
覺得很煩目前無解中,請問有時麼方法上在做圖時渲染出來不要是用中文顯示阿
--
推 maxxV3:說真的 有人總統想選一個女人家嗎 = = 04/19 21:48
→ teremy:韓國總統都是女的了。韓國還不夠大男人嗎? 04/19 21:49
噓 miler22020:樓上是遠古時帶來的嗎 04/19 21:49
→ miler22020:樓樓上 04/19 21:49
推 Top5566:樓樓樓上 04/19 21:50
→ miler22020:樓樓樓樓 幹 算了 04/19 21:50
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.112.167
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1558351499.A.1BF.html
推
05/20 19:42,
6年前
, 1F
05/20 19:42, 1F
推
05/20 19:44,
6年前
, 2F
05/20 19:44, 2F
→
05/20 23:47,
6年前
, 3F
05/20 23:47, 3F
推
05/21 01:06,
6年前
, 4F
05/21 01:06, 4F
→
05/21 10:30,
6年前
, 5F
05/21 10:30, 5F
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章