Q:

YYYYMMDD format

structure(list(date = c(20140717L, 20140611L, 20140611L, 20140704L, 
20140411L, 20140906L, 20140512L, 20140717L, 20140819L, 20140415L, 
20140812L, 20140403L, 20140424L, 20140818L, 20140922L, 20140625L, 
20141006L, 20140918L, 20140811L, 20140819L, 20140602L, 20140626L, 
20140729L, 20140624L, 20140909L, 20140705L, 20140920L, 20140515L, 
20140531L, 20140628L, 20140822L, 20140508L, 20140809L, 20140627L, 
20140727L, 20140711L, 20140714L, 20140710L, 20140403L, 20140525L, 
20140428L, 20140501L, 20140915L, 20140510L, 20140601L, 20140921L, 
20140815L, 20140610L, 20140418L, 20140812L, 20140614L, 20140814L, 
20140626L, 20140412L, 20140912L, 20140514L, 20140919L, 20140706L, 
20140411L, 20140711L, 20140624L, 20140430L, 20140521L, 20140418L, 
20140713L, 20140424L, 20140601L, 20140923L, 20140406L, 20140905L, 
20140613L, 20140412L, 20140407L, 20140402L, 20140813L, 20140903L, 
20140827L, 20140521L, 20140524L, 20140404L, 20140419L, 20140412L, 
20140902L, 20140623L, 20140925L, 20140528L, 20140731L, 20140513L, 
20140821L, 20140703L, 20140724L, 20140818L, 20140801L, 20140628L, 
20140801L, 20140521L, 20140906L, 20140725L, 20140522L, 20140927L, 
20140615L, 20140920L, 20140813L, 20140815L, 20140924L, 20140614L, 
20140912L, 20140710L, 20140807L, 20140501L, 20140420L, 20140630L, 
20140704L, 20140401L, 20140605L, 20140928L, 20140806L, 20140614L, 
20140907L, 20140704L, 20140403L, 20140804L, 20140603L, 20140728L, 
20140919L, 20140731L, 20140426L, 20140930L, 20140502L, 20140827L, 
20140815L, 20140628L, 20140902L, 20140616L, 20140613L, 20140726L, 
20140721L, 20140425L, 20140715L, 20140607L, 20140913L, 20140621L, 
20140708L, 20140427L, 20140506L, 20140425L, 20140411L, 20140615L, 
20140713L, 20140424L, 20140406L, 20140711L, 20140415L, 20140909L, 
20141004L, 20140725L, 20140602L, 20140405L, 20140525L, 20140605L, 
20140521L, 20140506L, 20140414L, 20140916L, 20140512L, 20140830L, 
20140722L, 20140711L, 20140628L, 20140613L, 20140618L, 20140719L, 
20140416L, 20140727L, 20140521L, 20140718L, 20140814L, 20140515L, 
20140501L, 20140725L, 20140507L, 20140619L, 20140525L, 20140609L, 
20140614L, 20140402L, 20140914L, 20140517L, 20140826L, 20140602L, 
20140920L, 20140718L, 20140915L, 20140715L, 20140708L, 20140419L, 
20140819L, 20140501L, 20140807L, 20140404L)), .Names = "date", row.names = c(NA, 
-200L), class = "data.frame")

This data frame has date values as class of integer. This data set is just one column of my data set. The original data set also has another variable called "total sales". I want to make a plot which has dates in X axis and on Y axis, total sales.
However, because the dates are regarded as integer, the plot is bad. So I want to let R understand the date column as date variables so I can get improved plot.
How can it be possible? Please give me help. Thank you very much.

A:

You might have better luck with as.Date.  If df is the data, then you can do
df$date <- as.Date(as.character(df$date), format = "%Y%m%d")
with(df, plot(date))

