SCM

[#6149] Cosmetic bug with .JULIAN in timeDate

Date:
2015-06-24 18:03
Priority:
3
State:
Closed
Submitted by:
Ian E (ene100)
Assigned to:
David Scott (dscott)
Hardware:
PC
Product:
None
Operating System:
Linux
Component:
None
Version:
None
Severity:
minor
Resolution:
Fixed
URL:
Summary:
Cosmetic bug with .JULIAN in timeDate

Detailed description
I run R with the options warnPartialMatchArgs, warnPartialMatchAttr, and warnPartialMatchDollar set to TRUE, in order to minimize the chances of assigning data to the wrong variable. However, this has the effect of generating warnings in cases where, for example, a function in a package calls another function with a partial variable name, or the variable name has been lengthened since the calling function was written.

In package timeDate, there is a hidden function .JULIAN() that contains the following three lines:

m <- c(origin[1], rep(m, length = max.len))
d <- c(origin[2], rep(d, length = max.len))
y <- c(origin[3], rep(y, length = max.len))

Right now these three calls to rep() are generating warnings when partial match warnings are enabled, when .JULIAN is called by holidayNYSE(). I believe changing the three lines to the following would fix the situation:

m <- c(origin[1], rep(m, length.out = max.len))
d <- c(origin[2], rep(d, length.out = max.len))
y <- c(origin[3], rep(y, length.out = max.len))

Thanks for your attention!

Comments:

Message  ↓
Date: 2018-11-29 09:50
Sender: David Scott

Changed as suggested

Attached Files:

Changes

Field Old Value Date By
ResolutionNone2022-07-28 06:53geobosh
status_idOpen2018-11-29 09:50dscott
close_dateNone2018-11-29 09:50dscott
assigned_tonone2018-11-29 09:50dscott
Thanks to:
Vienna University of Economics and Business Powered By FusionForge