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

R语言 TeachingDemos包 cal()函数中文帮助文档(中英文对照)

  [复制链接]
发表于 2012-10-1 08:47:13 | 显示全部楼层 |阅读模式
cal(TeachingDemos)
cal()所属R语言包:TeachingDemos

                                         Plot a month or year calendar
                                         绘制一个月或一年的日历

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

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

Plot a calendar of the specified year or month.  Monthly calendars can have additional information (text/plots) added to the individual cells.
画出指定的年份或月份的日历。每月的日历,可以添加到单个单元的其他信息(文/图)。


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


cal(month, year)



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

参数:month
The month for the calendar, if ommitted will do a yearly calendar, can either be a number from 1 to 12 or a character string that will be matched (using pmatch) against month.name.  
为期一个月的日历,如果省略,会做的年历,可以是从1到12的数字或字符串将匹配(使用pmatch)对month.name。


参数:year
The year for the calendar.  If ommitted and month is an integer less than or equal to 12 then month will be used as the year.  
这一年的日历。如果省略,month是一个整数,小于或等于12,那么month将用作年内。


Details

详细信息----------Details----------

This function plots on the current (or default) graphics device a yearly or monthly calendar.  It tries to guess what you want, if both year and month are ommitted then it will plot the current month.  If month is an integer greater than 12 and no year is specified then that value will be used as the year for a yearly calendar.  The month can be either an integer from 1 to 12 or a character string that will be matched against month.name using pmatch.
此函数曲线上的电流(或默认)的图形设备每年或每月的日历。它试图猜测你想要什么,如果两个year和month省略,然后将绘制当前的月份。如果month是一个大于12的整数,没有year指定,则该值将作为今年的年历。 month可以是从1到12之间的整数或字符的字符串,将匹配month.name使用pmatch。

Each day of the monthly calendar is a plotting frame that can be added to using stardard low level functions, the coordinates of the plotting region (the entire box) are from 0 to 1 in both dimensions.  The updateusr function can be used to change the coordinates.  The return from the function (when creating a monthly calendar) can be used to select the day.
每一天的每月日历是一个绘制的帧可以被添加到使用stardard的低级别的功能,绘图区域的坐标(整个框)是从0到1的两个维度中。 updateusr函数可以用来改变坐标。从函数返回的(当创建一个每月日历)可以用来选择一天。


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

Nothing is returned when a whole year calendar is created.  When the month calendar is created a function is returned invisibly that if passed an integer corresponding to a day of the month will set the graphics parameters so the corresponding day in the calendar becomes the current plotting figure.  See the examples below.
没有被创建时,将返回一个整年的日历。当月份的日历创建了一个函数返回不可见的,如果传递一个整数对应一个月份的一天,将设置的图形参数,所以相应的日历中的日期将成为当前的绘制图。请参见下面的例子。


(作者)----------Author(s)----------


Greg Snow, <a href="mailto:greg.snow@imail.org">greg.snow@imail.org</a>



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

Sys.time, as.POSIXlt, par, updateusr
Sys.time,as.POSIXlt,par,updateusr


实例----------Examples----------


cal(2011)

cal('May')

setday <- cal(11, 2011)

setday(3)
text(0.5,0.5, 'Some\nCentered\nText')

setday(8)
text(1,1,'Top Right',adj=c(1,1))

setday(18)
text(0,0,'Bottom Left', adj=c(0,0) )

setday(21)
tmp.x <- runif(25)
tmp.y <- rnorm(25, tmp.x, .1)
mrgn.x <- 0.04*diff(range(tmp.x))
mrgn.y <- 0.04*diff(range(tmp.y))
updateusr( 0:1, 0:1, range(tmp.x)+c(-1,1)*mrgn.x, range(tmp.y)+c(-1,1)*mrgn.y)
points(tmp.x, tmp.y)

setday(30)
tmp <- hist(rnorm(100), plot=FALSE)
updateusr( 0:1, 0:1, range(tmp$breaks), range(tmp$counts*1.1,0) )
lines(tmp)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-13 11:26 , Processed in 0.023744 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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