为什么没有lubridate ::: update函数? [英] Why is there no lubridate:::update function?

查看:63
本文介绍了为什么没有lubridate ::: update函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如标题中所述:为什么没有这样的功能?或以另一种方式:函数的类型是什么?当我键入?update时,我从stats包中得到了一些东西,但是有润滑功能,如

As said in the title: Why is there no such function? Or in a different way: What is the type of the function? When I type ?update I get something from stats package, but there is a lubridate function as described here on page 7. There also seems to be a lubridate:::update.Date function, but I can't find any explanations for that function.

背景:我在软件包中使用该功能,只有在解密文件中使用Depends:后,它才能正常工作.最初我想使用lubridate::update() ...

Backround: I use the function in a package and I only got it to work after I used the Depends: in the decription file. Initially I wanted to use lubridate::update()...

推荐答案

lubridate包提供了方法lubridate:::update.Date()lubridate:::update.POSIXt().这些函数未导出到名称空间中,但是我认为通过函数重载,在加载lubridate库时将update()应用于POSIXDate对象时,将调用这些函数.

The lubridate package provides the methods lubridate:::update.Date() and lubridate:::update.POSIXt(). Those functions are not exported into the namespace, but I assume that, by means of function overloading, they are invoked when update() is applied to a POSIXor Date object when the lubridate library is loaded.

帮助页面?lubridate:::update.POSIXt提供有关lubridate软件包中update功能的一些信息:

The help page ?lubridate:::update.POSIXt provides some information concerning the update function within the lubridate package:

说明

update.Date和update.POSIXt返回具有指定日期的日期 元素已更新.未指定的元素将保持不变. update.Date和update.POSIXt不会将指定的值添加到 现有日期,它们将它们替换为 现有日期.

update.Date and update.POSIXt return a date with the specified elements updated. Elements not specified will be left unaltered. update.Date and update.POSIXt do not add the specified values to the existing date, they substitute them for the appropriate parts of the existing date.

用法

##类"POSIXt"的S3方法

## S3 method for class 'POSIXt'

update(object,...,simple = FALSE)

update(object, ..., simple = FALSE)

用法部分和帮助页面中的示例表明,这些功能不需要单独解决,因为在加载lubridate库时只需使用update()即可调用这些功能.

The usage section and the examples in the help page indicate that these functions don't need to be addressed individually, as they are called by simply using update() when the lubridate library is loaded.

要检查这些功能,可以在控制台中键入例如lubridate:::update.POSIXt(不传递参数,不带括号).

To inspect these functions one can type, e.g., lubridate:::update.POSIXt in the console (without passing arguments, and without the parentheses).

这篇关于为什么没有lubridate ::: update函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆