Specify that your input is of class yearmon (as opposed to Date class) and also correct the format specification as per the percent codes in ?strptime
library(zoo) z <- read.zoo("clipboard", FUN = as.yearmon, format = "%b-%y") On Tue, Dec 1, 2009 at 12:55 PM, Megh <megh700...@yahoo.com> wrote: > > In my Excel file, I have data in following format : > > Feb-07 38.49 > Mar-07 39.95 > Apr-07 37.47 > May-07 35.77 > Jun-07 32.96 > Jul-07 33.27 > > I tried to copy this data as a time series using following code : > > library(zoo) > dat <- read.zoo(file="clipboard", format="%m-%y") > > However getting following error : > > Error in read.zoo(file = "clipboard", format = "%m-%y") : > index has bad entries at data rows: 1 2 3 4 5 6 > > Can anyone please guide me what is the right way to do that? > > Thanks, > > -- > View this message in context: > http://n4.nabble.com/Problem-in-reading-data-tp932386p932386.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.