Getting warning using setAs() to specify colClasse

2020-04-03 02:25发布

I tried using the answer @Greg Snow provided in this question, but I keep getting a warning regardless of what I do. Can someone help with this:?

> setAs("character","myDate",function(from) as.Date(from, format="%b %d, %Y %r"))
in method for ‘coerce’ with signature ‘"character","myDate"’: no definition for class “myDate”

I wanted to make sure that the "methods" package is load (it looks like setAs depends on it) and I got this:

> getOption("defaultPackages")
[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"

TIA

0条回答
登录 后发表回答