8

我尝试使用此问题中提供的答案@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

4

0 回答 0