Kısa yanıt, xts:::align.time.xts
işlevini aradığınızdır.
Uzun yanıt
Eğer
methods
arayarak
align.time
için var olan yöntemleri öğrenebilmenizdir:
> methods(align.time)
[1] align.time.POSIXct* align.time.POSIXlt* align.time.xts*
Non-visible functions are asterisked
Bu ad ihraç edilmeyen bir yöntemdir align.time.xts
olduğunu söyler. Bu noktada o paketin xts
bulunabilir tahmin muhtemelen, ancak getAnywhere
ile teyit edebiliriz:
> getAnywhere("align.time.xts")
A single object matching 'align.time.xts' was found
It was found in the following places
registered S3 method for align.time from namespace xts
namespace:xts
with value
function (x, n = 60, ...)
{
if (n <= 0)
stop("'n' must be positive")
.xts(x, .index(x) + (n - .index(x)%%n), tzone = indexTZ(x),
tclass = indexClass(x))
}
<environment: namespace:xts>
Elbette, doğrudan kaynak okuyabilir, ancak işlevi olduğu için ihraç değil, sen package:::function
(yani üç nokta üst üste) kullanmanız gerekir:
> xts:::align.time.xts
function (x, n = 60, ...)
{
if (n <= 0)
stop("'n' must be positive")
.xts(x, .index(x) + (n - .index(x)%%n), tzone = indexTZ(x),
tclass = indexClass(x))
}
<environment: namespace:xts>
Ayrıca bkz bu çok benzer soruyu: http://stackoverflow.com/q/5835312/602276 http – Andrie
Çemberi 7: // www. burns-stat.com/pages/Tutor/R_inferno.pdf size yardımcı olabilir Genel işlevlerin ve yöntemlerin ne olduğu hakkında bir fikir. –
@PatrickBurns Teşekkürler, yararlı bir okumaya benziyor. –