找回密码
 注册
查看: 3844|回复: 0

R语言:axis.POSIXct()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:19:19 | 显示全部楼层 |阅读模式
axis.POSIXct(graphics)
axis.POSIXct()所属R语言包:graphics

                                        Date and Date-time Plotting Functions
                                         日期和时间日期绘图功能

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Functions to plot objects of classes "POSIXlt", "POSIXct" and "Date" representing calendar dates and times.
图类对象的函数"POSIXlt","POSIXct"和"Date"表示日历日期和时间。


用法----------Usage----------


axis.POSIXct(side, x, at, format, labels = TRUE, ...)
axis.Date(side, x, at, format, labels = TRUE, ...)



参数----------Arguments----------

参数:x, at
A date-time or date object.
日期时间或日期对象。


参数:side
See axis.
看到axis。


参数:format
See strptime.
看到strptime。


参数:labels
Either a logical value specifying whether annotations are to be made at the tickmarks, or a vector of character strings to be placed at the tickpoints.
无论是逻辑值,指定是否注释要在tickmarks作出,或一个字符串向量被放置在tickpoints的。


参数:...
Further arguments to be passed from or to other methods, typically graphical parameters.
进一步的参数被传递或其他方法,通常是图形参数。


Details

详情----------Details----------

axis.POSIXct and axis.Date work quite hard to choose suitable time units (years, months, days, hours, minutes or seconds) and a sensible output format, but this can be overridden by supplying a format specification.
axis.POSIXct和axis.Date工作相当难以选择合适的时间单位(年,月,日,小时,分钟或秒)和一个明智的输出格式,但可以提供一个format覆盖规范。

If at is supplied it specifies the locations of the ticks and labels whereas if x is specified a suitable grid of labels is chosen. Printing of tick labels can be suppressed by using labels = FALSE.
如果at提供指定的刻度和标签的位置,而如果x指定的标签适合电网选择。刻度线标签印刷可以使用labels = FALSE抑制。

The date-times for a "POSIXct" input are interpreted in the timezone give by the "tzone" attribute if there is one, otherwise the current timezone.
解释时区的日期时间"POSIXct"输入"tzone"属性给,如果有一个,否则目前的时区。

The way the date-times are rendered (especially month names) is controlled by the locale setting of category "LC_TIME" (see Sys.setlocale.
日期时间的呈现方式(尤其是月份名称)控制类的区域设置"LC_TIME"(见Sys.setlocale。


值----------Value----------

The locations on the axis scale at which tick marks were drawn.
轴刻度的位置刻度得出。


注意----------Note----------

These functions are the workhorse for methods for Axis. Prior to R 2.12.0 there were also plot methods for the date-time classes, but the default method has also handled those for a long time.
这些功能是Axis方法的主力。 ŕ2.12.0之前有plot日期时间类的方法,但默认的方法也很长一段时间来处理。


参见----------See Also----------

DateTimeClasses, Dates for details of the classes.
DateTimeClasses类的详细信息,日期。

Axis.
Axis。


举例----------Examples----------


with(beaver1, {
time <- strptime(paste(1990, day, time %/% 100, time %% 100),
                 "%Y %j %H %M")
plot(time, temp, type="l") # axis at 4-hour intervals.[轴在4小时的间隔。]
# now label every hour on the time axis[现在每隔一小时的时间轴标注]
plot(time, temp, type="l", xaxt="n")
r <- as.POSIXct(round(range(time), "hours"))
axis.POSIXct(1, at=seq(r[1], r[2], by="hour"), format="%H")
})

plot(.leap.seconds, seq_along(.leap.seconds), type="n", yaxt="n",
     xlab="leap seconds", ylab="", bty="n")
rug(.leap.seconds)
## or as dates[#或作为日期]
lps <- as.Date(.leap.seconds)
plot(lps, seq_along(.leap.seconds),
     type = "n", yaxt = "n", xlab = "leap seconds",
     ylab = "", bty = "n")
rug(lps)

## 100 random dates in a 10-week period[#100日期在10个星期的时间内随机]
random.dates <- as.Date("2001/1/1") + 70*sort(stats::runif(100))
plot(random.dates, 1:100)
# or for a better axis labelling[或一个更好的轴标签]
plot(random.dates, 1:100, xaxt="n")
axis.Date(1, at=seq(as.Date("2001/1/1"), max(random.dates)+6, "weeks"))
axis.Date(1, at=seq(as.Date("2001/1/1"), max(random.dates)+6, "days"),
     labels = FALSE, tcl = -0.2)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-6 17:33 , Processed in 0.030461 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表