[R] Function bug when sourcing

peter dalgaard pdalgd at gmail.com
Sat Dec 27 21:28:34 CET 2014


A pair of braces: {} would seem required.
-pd

> On 27 Dec 2014, at 21:07 , Ernie Stokely <wizardchef at gmail.com> wrote:
> 
> I am unable to figure out why I get this error in the code below:
> 
> Error in as.Date(data.dates.x, format = "%m/%d/%Y") :
>  object 'data.dates.x' not found
> 
> Here is the code with comments deleted:
> -----------------------------------------------------
> 
> ConvertExcelDateData <- function(ticker.prices, data.dates)
> 
>     data.dates.x <- as.vector(unlist(data.dates))
> 
>     data.dates.x <- as.Date(data.dates.x, format = "%m/%d/%y")
> 
> return(match(data.dates.x,time(ticker.prices)))
> 
> --------------------------------------------------------
> 
> I'm sure it is something obvious, but I am blind to it. Help appreciated.
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list