我尝试使用此question中提供的答案@Greg Snow,但无论我做什么,我都会收到警告。有人可以帮忙解决这个问题:?
> 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”
我想确保“方法”包是加载的(看起来像setAs依赖它),我得到了这个:
> getOption("defaultPackages")
[1] "datasets" "utils" "grDevices" "graphics" "stats" "methods"
TIA