如何根据日期、时间、LTP 形式的矩阵中的可用数据绘制 LTP 与时间的关系图
How to plot LTP vs. time from data available in a matrix in the form of Date, time, LTP
我有3列数据:(如下图
- 日期时间 LTP
- 20180102 09:16 1800
- …………
我想在 R 中绘制它,以便在 x 轴上获得时间,在 y 轴上获得 LTP。由于每天大约有 360 行(每分钟 LTP 变化),x 变量应为 date:time
我是 R 的新手,我需要这方面的帮助。感谢期待
试试这个:
library(zoo)
z <- read.zoo("myfile.dat", header = TRUE, index = 1:2, format = "%Y%m%d %H:%M", tz = "")
# classic graphics
plot(z)
# ggplot2 graphics
autoplot(z)
备注
要为问题中提供的示例数据生成文件,试试这个;然而,只有一个点,你不会在折线图上看到任何东西。
cat("Date Time LTP\n20180102 09:16 1800", file = "myfile.dat")
我有3列数据:(如下图
- 日期时间 LTP
- 20180102 09:16 1800
- ………… 我想在 R 中绘制它,以便在 x 轴上获得时间,在 y 轴上获得 LTP。由于每天大约有 360 行(每分钟 LTP 变化),x 变量应为 date:time 我是 R 的新手,我需要这方面的帮助。感谢期待
试试这个:
library(zoo)
z <- read.zoo("myfile.dat", header = TRUE, index = 1:2, format = "%Y%m%d %H:%M", tz = "")
# classic graphics
plot(z)
# ggplot2 graphics
autoplot(z)
备注
要为问题中提供的示例数据生成文件,试试这个;然而,只有一个点,你不会在折线图上看到任何东西。
cat("Date Time LTP\n20180102 09:16 1800", file = "myfile.dat")