[R] [R studio] How to define date column and plot that date column as x axis in R studio
Subhamitra Patra
@ubh@mitr@@p@tr@ @ending from gm@il@com
Fri Dec 14 05:37:29 CET 2018
Dear R users,
I have half-hourly time series data; 48 data points in a day. The total
time period starts from 4/6/2018 (i.e day/month/year) to 2/12/2018. I want
to create a time series object. I am using ts function.
However, I am unable to define the frequency. As I know, frequency=1 for
yearly data, but unable to define in my half-hourly data.
After creating a time series object (i.e. date column), I want to plot it
with the corresponding data series.
How to plot my result (in R object) on Y-axis and time period on the
X-axis? For your convenience, I am providing my code as follows.
R <- function(x){
return(FDWhittle(x, method="discrete", sdf.method="multitaper"))
}
plot(R[,i],type="l",col = "Black", xlab="Time",
ylab="Return",main=names(R)[,i])
When I am plotting by using the above code, the results in the object "R"
is coming on the Y-axis, and some values like (100, 200, 300--------) are
coming on the X-axis. I want to get the time period on my X axis, but
unable to define the intra-day date column having 48 data points in a day.
Further, kindly suggest me what can be the frequency level for defining the
date column of the daily data?
A kind help is highly appreciated.
Thanks in advance.
--
*Best Regards,*
*Subhamitra Patra*
*Phd. Research Scholar*
*Department of Humanities and Social Sciences*
*Indian Institute of Technology, Kharagpur*
*INDIA*
[[alternative HTML version deleted]]
More information about the R-help
mailing list