From 259ebb40316110f1bca88c9d1ad0a0f84c1c7f3d Mon Sep 17 00:00:00 2001 From: mef Date: Thu, 1 Jun 2023 12:52:39 +0000 Subject: [PATCH] (math/R-xts) Updated 0.12.2 to 0.13.1 ################################################################################ Changed in xts 0.13.1: o Ignore attribute order in `all.equal()`. Attribute order shouldn't matter. That can be checked with `identical()`. o Only call `tzone()` and `tclass()` once in `check.TZ()`. Calling these functions multiple times throws multiple warnings for xts objects created before the tclass and tzone were attached to the index instead of the xts object. (#306) o Add instructions to update old objects. Old xts objects do not have tclass and tzone attributes on the index. Add a function to update the object attributes and add a note to the warning to show how to use it. (#306) o Return 'POSIXct' if object has no 'tclass'. An empty string is not a valid 'tclass', so it can cause an error. o Add notes on `plot.xts()` nomenclature and structure. Also add ASCII art to illustrate definitions and layout. (#103) o Remove 'tis' support. The implementation was not even a bare minimum, and it's not clear it even worked correctly. (#398) o Register missing S3 methods and update signatures. With R-devel (83995-ish), `R CMD check` notes these S3 methods are not registered. It also notes that the signatures for `as.POSIXct.tis()` and `str.replot_xts()` do not match the respective generics. It also thinks `time.frequency()` is a S3 method because `time()` is a generic. The function isn't exported, so renaming won't break any external code. Thanks to Kurt Hornik for the report. (#398) o Format each column individually before printing. The top/bottom rows could have a different number of decimal places and there are often multiple variying spaces between columns. For example: close volume ma bsi 2022-01-03 09:31:00 476.470 803961.000 NA 54191.000 2022-01-03 09:32:00 476.700 179476.000 NA 53444.791 2022-01-03 09:33:00 476.540 197919.000 NA -16334.994 ... 2023-03-16 14:52:00 394.6000 46728.0000 392.8636 28319.4691 2023-03-16 14:53:00 394.6500 64648.0000 392.8755 15137.6857 2023-03-16 14:54:00 394.6500 69900.0000 392.8873 -1167.9368 There are 4 spaces between the index and the 'close' column, 2 between 'close' and 'volume', 4 between 'volume' and 'ma', and 2 between 'ma' and 'bsi'. There should be a consistent number of spaces between the columns. Most other classes of objects print with 1 space between the columns. The top rows have 3 decimals and the bottom rows have 4. These should also be the same. (#321) o Only convert printed index values to character. Converting the entire index to character is time-consuming for xts objects with many observations. It can take more than a second to print an xts object with 1mm observations. o Make column names based on number of columns. The original code was a lot more complicated because it tried to account for truncating the number of printed columns. That functionality was removed because of how complicated it was. So now we can simply create printed column names from the number of columns. (#395) o Fix `xts()` for zero-row data.frame. The `xts()` constructor would create an object with a list for coredata when 'x' is a data.frame with no rows. It needs to convert 'x' to a matrix and throw an error if 'x' is a list. (#394) o Reduce instances when `dplyr::lag()` warning is shown. The warning was shown whenever it detected dplyr is installed, even if the user wasn't actively using dplyr. That caused an excessive amount of noise when other packages attached xts (e.g. quantmod). Thanks to Duncan Murdoch for the report and suggested fix! (#393) o Keep colname when only one non-time-based column. The subset `x[, -which.col]` would return a vector when the data frame has a time-based column and only one additional column. Do not drop dimensions, so 'x' will still be a data.frame in this case. (#391) o Treat NA the same as NULL for start or end values. NULL represents an undefined index value. NA represents an unknown or missing index value. xts does not allow NA as index values. Subsetting an xts or zoo object by NA returns a zero-length object. So a NA (unknown) index value is essentially the same as an undefined index value. (#383, #345) o Warn and remove NA when `periodicity()` called on date-time with NA. Otherwise the uninformative error below will be thrown. (#289) Error in try.xts(x, error = "'x' needs to be timeBased or xtsible") : 'x' needs to be timeBased or xtsible o Account for TZ when making names for `split.xts()`. `as.yearmon.POSIXct()` always sets `tz = "GMT"` when calling `as.POSIXlt()`, regardless of the xts' index tzone. That can cause the `as.yearmon()` results to be different days for GMT and the index's timezone. Use `format.POSIXct()` for "months" because it checks for a 'tzone' attribute before converting to POSIXlt and calling `format.POSIXlt()`. The conversion to POSIXlt is important because it checks and uses the 'tzone' attribute before considering the 'tz' argument. So it effectively ignores the `tz = "GMT"` setting in `as.yearmon()`. This is also the reason for calling `as.POSIXlt()` before calling `as.yearqtr()`. (#392) ################################################################################ Changed in xts 0.13.0: ### New Features o Added a xts method for `na.fill()` to significantly increase performance when 'fill' is a scalar. (#259) o `as.xts()` will look for a time-based column in a data.frame if it cannot create an index from the row names. (#381) o Change `print()` xts method to only show the first and last 'show.rows' rows if number of rows is > 'max.rows'. (#321) o Made `str()` output more descriptive for xts objects. It now differentiates between xts objects that are empty, zero-width, or zero-length, and defines each type of object. It also adds column names to the output. (#168, #378) o Add startup warning that `dplyr::lag()` breaks method dispatch, which means calls to `lag(my_xts)` won't work any more. o Added open-ended time of day subsetting ranges. This allows users to subset by time of day from the start/end of the day without providing the start/end times (00:00:00.000/23:59:59.999). For example: x["/T1800"] # between the start of the day and 5pm x["T0500/"] # between 5am and the end of the day Thanks to Chris Katsulis for the suggestion! (#243) o Updated `to.period()` to accept custom 'endpoints' via the 'period' argument. Now you can aggregate on something other than the times that 'endpoints()' supports. Thanks to Ethan B. Smith for the suggestion! (#302) ### Fixes o Fixed typo and expand `period.apply()` documentation. (#205) The original description has: * "the data from INDEX[k] to INDEX[k+1]" But that's not consistent with the code. It should be: * "the data from INDEX[k]+1 to INDEX[k+1]" o Calls to `merge.xts()` on zero-width objects now match `merge.zoo()`. Previously, `merge.xts()` would return empty xts objects if called on two or more zero-width xts objects. `merge.zoo()` would return a zero-width object with the correct index. (#227, #379) o Fixed `Ops.xts()` so it always returned an object with the same class as the first (left-hand side) argument. It previously returned an xts object even if the first argument was a subclass of xts. (#49) ### Other o Migrated unit tests from RUnit to tinytest. Thanks Mark van der Loo! o Updated the `endpoints()` documentation to make it clearer that the result is based on the UNIX epoch (midnight 1970, UTC). Thanks to GitHub user Eluvias for the suggestion! (#299) o Fixed `reclass()` to ensure it always adds index attributes from the 'match.to' argument. It was not copying `tclass`, `tzone`, or `tformat` from 'match.to' to the result object. (#43) o Removed an unnecessary check in `na.locf()` (which is not user-facing). Thanks to GitHub user @cgiachalis for the suggestion! (#307) o Updated C entry points so they're not able to accidentally be found via dynamic lookup (i.e. `.Call("foo", ...)`). This makes each call to the C code a few microseconds faster, which is nice. (#260) o Made `merge.xts()` results consistent with `merge.zoo()` for zero-length xts objects with columns. The result of `merge.xts()` did not include the columns of any objects that had one or more columns, but zero rows. A join should include all the columns of the joined objects, regardless of the number of rows in the object. This is consistent with `merge.zoo()`. Thanks to Ethan B. Smith for the report and testing! (#222) --- math/R-xts/Makefile | 4 ++-- math/R-xts/distinfo | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/math/R-xts/Makefile b/math/R-xts/Makefile index fafabbb590e6..010406bcef48 100644 --- a/math/R-xts/Makefile +++ b/math/R-xts/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.14 2022/12/18 13:06:35 mef Exp $ +# $NetBSD: Makefile,v 1.15 2023/06/01 12:52:39 mef Exp $ R_PKGNAME= xts -R_PKGVER= 0.12.2 +R_PKGVER= 0.13.1 MAINTAINER= pkgsrc-users@NetBSD.org COMMENT= eXtensible Time Series diff --git a/math/R-xts/distinfo b/math/R-xts/distinfo index d0a69e627bdc..568374f645ff 100644 --- a/math/R-xts/distinfo +++ b/math/R-xts/distinfo @@ -1,5 +1,5 @@ -$NetBSD: distinfo,v 1.14 2022/12/18 13:06:35 mef Exp $ +$NetBSD: distinfo,v 1.15 2023/06/01 12:52:39 mef Exp $ -BLAKE2s (R/xts_0.12.2.tar.gz) = 119affb7774138cfc27aaf8ee0d85e1a5b67662e6fd2d3126faf41fa71f23bec -SHA512 (R/xts_0.12.2.tar.gz) = e1dd29a01e7e3ca3f5121bb0d48aea31e0992dcaba83c62bba6bda3bb899e19db7d1d5db8f076e8a4d657412a87873ede86ccb038e2c3eb92652cfc1d8436159 -Size (R/xts_0.12.2.tar.gz) = 438931 bytes +BLAKE2s (R/xts_0.13.1.tar.gz) = 53a99900760503a2370d3a1bdbf882ff8410aee4b4ae25bc911a28326d5b13fb +SHA512 (R/xts_0.13.1.tar.gz) = de296c432cfd447063f7ec74d0c6af79570ee81434fdaa62c9af9d37c5ee716fcb6c8183b670bb82e88ee084ce1ac2561b918e1bb3b3f21da25ff6b4f73a37e9 +Size (R/xts_0.13.1.tar.gz) = 456115 bytes