r - error 'nzchar()' requires a character vector lubridate -


i trying run code webpage https://r-forge.r-project.org/scm/viewvc.php/pkg/appliedpredictivemodeling/inst/chapters/creategrantdata.r?view=markup&revision=11&root=apm.

i error when run below line

month info starttime <- dmy(raw$start.date) 

error in parse_date_time(dates, orders, quiet = quiet, tz = tz, locale = locale, : 'nzchar()' requires character vector

code above webpage needs tweaks. 1 has copy file "unimelb_training.csv" on computer. file available @ http://www.kaggle.com/c/unimelb/data

i have contacted author. wasnt able reproduce error , therefore couldnt help. suggested me provide link of above webpage instead of copy-pasting entire code.the book site http://appliedpredictivemodeling.com/

please help...thanks

i emailed author of lubridate package. name , response below:

garrett grolemund

your error comes bug in lubridate working on. parsing functions can't handle factors @ moment. raw$start.date factor. can make code work putting as.character() around raw$start.date, e.g.

starttime <- dmy(as.character(raw$start.date)) 

i'll have fixed in next release of lubridate.

cheers, garrett


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -