2017-04-20 4 views

答えて

1

我々はscalesパッケージからdate_formatを使用することができます。空白が先行し、単一の数字で

%k 24時間のクロック時間:

library(ggplot2) 
library(scales) 

# dummy data 
set.seed(1) 
df1 <- data.frame(
    x = as.POSIXct(runif(10, 0, 24 * 60 * 60), origin = "2017/04/20"), 
    y = 1:10 
) 

# use scales::date_format 
ggplot(df, aes(x = x, y = y)) + 
    geom_point() + 
    scale_x_datetime(labels = date_format("%l:%M")) 

?strptime
%l 1桁の空白で始まる12時間の時計時刻。

enter image description here

関連する問題