Skip to content
Back to formatted view

Raw Message

Message-ID: <56E85475.4030606@gmail.com>
Date: 2016-03-15T18:29:09Z
From: Duncan Murdoch
Subject: doubt clarification
In-Reply-To: <CAOOMz7MgVL6a3w3Qi6up9jQCfhOEKJNb_tw0GjQhv8HaG4PcSw@mail.gmail.com>

On 15/03/2016 12:53 PM, MEHER DIVYA BARATAM wrote:
> dear sir/madam,
>
>                          i am a new learner of r software. while plotting a
> graph of data which contains date. i have dates on X-axis, while learning i
> got to know i have to convert into R understandable language. i got an
> error while converting
>
>
> "as.Date(all.2015$Day,%d-%m-%y)
>    Error: unexpected SPECIAL in "as.Date(all.2015$Day,%d-%"

You need to put the format in quotes.  R sees %d-% as a "SPECIAL" 
operator, and it is an error for one of those to appear in that position.

So use

as.Date(all.2015$Day, "%d-%m-%y")

(and be careful of the quotes:  these are regular ASCII quotes, not directional quotes which some editors will insert).


Duncan Murdoch