【问题标题】:Hours by Person按人计算的小时数
【发布时间】:2020-10-01 19:38:28
【问题描述】:

您好,我可以将我的时间列导入为时间格式或 date_time 格式它返回 NA,我该怎么做,first_form 应该是时间格式,并且在预览中看起来像 last_form(当前是字符) ? enter image description here

Inmigrations <- read_excel("Inmigrations.xlsx", 
    col_types = c("skip", "skip", "skip", 
        "skip", "text", "date", "text", "text", 
        "numeric", "text", "numeric", "date"))

【问题讨论】:

  • 尝试将其作为字符导入并在 R 中转换。我们无权访问您的 Excel 文件,因此很难为您调试。

标签: r ggplot2 tidyverse mosaic


【解决方案1】:

将其作为字符类型导入后尝试 lubridate:

library(lubridate)

df$first_form <- hms(df$first_form) 

【讨论】:

    猜你喜欢
    • 2012-11-14
    • 2018-05-11
    • 2020-09-09
    • 1970-01-01
    • 1970-01-01
    • 2018-11-29
    • 1970-01-01
    • 2020-04-15
    • 1970-01-01
    相关资源
    最近更新 更多