r - 将时间戳转换为 POSIXct 格式返回双精度
问题描述
我想ltraj
使用 R 包将数据框转换为列表adehabitatLT
,为此我必须将时间戳转换为POSIXct
格式。我正在编写以下代码:
martin_df$timestamp <- as.POSIXct(martin_df$timestamp,
format="%Y-%m-%d %H:%M:%OS", tz="GTM")
并且没有错误。但是当我要求:
typeof(martin_df$timestamp)
它告诉我是双倍的。
martin.ltraj <- as.ltraj(martin_df, typeII = TRUE)
as.ltraj(martin_df, typeII = TRUE) 中的错误:对于类型 II 的对象,日期应属于“POSIXct”类
有谁知道错误在哪里?
解决方案
推荐阅读
- r - 如何绘制职业概率?
- c# - 在 Audit.Net 中有没有办法使用多个输出提供程序?
- json-simple - 如何使用 JSON Simple 制作一个常量 json 数组
- javascript - 为什么滑块不显示在地图上?
- c - PEM_read_RSAPublicKey() 在主应用程序代码中崩溃,但在示例代码中运行良好。我该如何解决这个问题?
- visual-studio-2010 - 为什么我的可视化项目只能在调试模式下运行?
- sql - 使用新列派生新列
- mysql - 更新将一列中的部分字符串替换为另一列中的部分字符串
- python - Python子进程模块将路径作为字符串发送
- spring-boot - 使用 Spring Reactive 为 ClientCredentials 获取访问令牌