私は深夜から時刻を秒に変換しようとしています。私は、仕事にchronパッケージからtimes()関数を取得するのに苦労しています。使用方法は次のとおりです。R chron times()関数が機能しません
> library(chron)
> 24 * 24 * 60 * (times(50))
Error in 24 * 24 * 60 * (times(50)) :
non-numeric argument to binary operator
>
>
> library(chron)
> 24 * 24 * 60 times(5000)
Error: unexpected symbol in "24 * 24 * 60 times"
お勧めはありますか?
UPDATE:
> sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RODBC_1.3-3 nnet_7.3-1 doSNOW_1.0.3 foreach_1.3.0
[5] codetools_0.2-8 iterators_1.0.3 snow_0.3-7 randomForest_4.6-2
[9] chron_2.3-42
loaded via a namespace (and not attached):
[1] tools_2.14.0
UPDATE 2:
> find("times")
[1] "package:foreach" "package:chron"
> times
function (n)
{
if (!is.numeric(n) || length(n) != 1)
stop("n must be a numeric value")
foreach(icount(n), .combine = "c")
}
<environment: namespace:foreach>
UPDATE 3:
> sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] chron_2.3-42
> find("times")
[1] "package:chron"
> 24 * 24 * 60 * (times * (50))
Error in times * (50) : non-numeric argument to binary operator
私はJoshと同じ結果を得ています。 check.built = TRUEでRと 'update.packages'を更新する必要があるかもしれません。最低でも 'sessionInfo()'を提供する必要があります –
最初のバージョン、 '24 * 24 * 60 *(times(50))'は、私にとってはうまく動作し、 '[1] 1728000'などを返します。 'find(" times ")'を試したり、 'package:chron" 'からRが期待する関数を見つけていることを' times'とタイプするだけです。 –