[R] date and time data on x axis

snowball0916 @nowb@ll0916 @ending from 163@com
Sun Oct 28 16:16:32 CET 2018


Hi, guys
How do you guys deal with the date and time data on x axis?
I have some trouble with it. Could you help with this?

=============
Sample Data
=============
The sample data look like this:

20181028_10:00:00 600 
20181028_10:00:01 500 
20181028_10:00:02 450 
20181028_10:00:03 660
......

=============
My Code
=============

library(lubridate)
mydata <- read.table("e:/R_study/graph_test2.txt")
xdata <- ymd_hms(mydata$V1)
ydata <- mydata$V2
plot(xdata, ydata, type="o")


=============
Questions:
=============

1. Why my x axis does not show me the correct date time like ""2018-10-28 10:00:00 UTC" ?
2. If my data is very huge(like data in every second and the data has the whole day , even the whole month), how can I display the x axis in a neat and clean way?

Thanks very much.
 



	[[alternative HTML version deleted]]



More information about the R-help mailing list