File: PORTING

package info (click to toggle)
chron 2.3-42-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 228 kB
  • sloc: ansic: 127; makefile: 1
file content (92 lines) | stat: -rw-r--r-- 2,477 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
* Put the unpaste part of chron_strs.c in a separate file, and rewrite
for R internal object handling.  Code for unpaste() from strings.inUX
is no longer needed.

* Copy ALL.FUNCTIONS -> chron.R.

* In chron.R, replace all occurrences of
	!length(something)
by
	!as.logical(length(something))
In Emacs, you can do
	(query-replace-regexp 
	 "!length(\\([a-z\.]*\\))" "!as.logical(length(\\1))" nil)

* The same problem (`!' only defined for logical arguments) occurs in
cut.dates():
	if(!(i <- pmatch(breaks[1], valid, 0)))
seq.dates():
	if(!(i <- pmatch(by, valid, 0)))
=> add `as.logical' after the `!'.

* In Ops.dates,
	if(any(o1 != o2))
does not work in R if one of the origins is NULL.  Change to
	if(any(o1 - o2))

* Change .Machine$single.eps to .Machine$double.eps

* Change .Options to options()

* In julian(), replace
	if(missing(origin.))
by
	if(missing(origin.) || is.null(origin.))

* Change occurences of
	UseMethod(generic, object, ...)
to
	UseMethod(generic)

* Make the following functions generic in the R distribution:
	cut diff hist mean quantile seq trunc
Comment the corresponding definitions for the generic funs and their
default methods.

* In cut.dates(), it seems that R's cut.default() which uses intervals
closed on the right by default produces results which are one off.
Adding `right = FALSE' to the call to cut.default() seems to fix this.

* character(n=0) in R is character(length=0) in S;  fix chron.R
accordingly

* In c.dates() and c.times(), add `recursive = FALSE' argument.

* In leap.year(), fix typo.

* In format<-(), format<-.times() and origin<-(), replace `val' by
`value'.

* Y2K update: comment convert.dates(), format.dates(), parse.format(),
and replace by updated functions by David James.


* DOCUMENTATION FIXES (after conversion via Sd2Rd):

chron.Rd:
  Add alias.
cut.dates.Rd:  
  Add alias.
dates.Rd:
  Fix \name.
  Add aliases (dates, times).
  Delete 1st \seealso.
day.of.week.Rd:
  Add aliases (day.of.week, julian, leap.year, month.day.year).
  REMOVE julian.Rd, leap.year.Rd, month.day.year.Rd.
days.Rd:
  Fix \name.
  Add aliases (days, months, quarters, weekdays, years).
  Merge in all \seealso{}'s (dates chron is.holiday is.weekend cut.dates
    seq.dates).
  REMOVE months.Rd quarters.Rd weekdays.Rd years.Rd.
hours.Rd:
  Fix \name.
  Add aliases (hours minutes seconds).
is.holiday.Rd:
  Add aliases (is.holiday is.weekend).
  REMOVE is.weekend.Rd.
seq.dates.Rd:
  Add alias.    

Fix examples everywhere!