[R studio] How to define date column and plot that date column as x axis in R studio

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[R studio] How to define date column and plot that date column as x axis in R studio

Subhamitra Patra
 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",

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*

        [[alternative HTML version deleted]]

[hidden email] mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.