From cd4e83d620bc4e48c7cfbcceba46e489eabe9ba1 Mon Sep 17 00:00:00 2001 From: Victor Maus Date: Sun, 19 Sep 2021 14:56:11 +0200 Subject: [PATCH] Prepare CRAN release --- DESCRIPTION | 4 ++-- NEWS.md | 6 +++--- R/miscellaneous.R | 2 +- R/plotCostMatrix.R | 6 +++--- R/plotPaths.R | 4 ++-- cran-comments.md | 19 +++++++++++-------- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2ca4b86..3eb07a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: dtwSat Type: Package Title: Time-Weighted Dynamic Time Warping for Satellite Image Time Series Analysis -Version: 0.2.7.9999 -Date: 2021-09-18 +Version: 0.2.7 +Date: 2021-09-19 Authors@R: c(person('Victor', 'Maus', role = c('aut', 'cre'), email = 'vwmaus1@gmail.com', comment = c(ORCID = "0000-0002-7385-4723")), person('Marius', 'Appel', role = c('ctb'), comment = c(ORCID = "0000-0001-5281-3896")), person('Nikolas', 'Kuschnig', role = c('ctb'), comment = c(ORCID = "0000-0002-6642-2543")), diff --git a/NEWS.md b/NEWS.md index 8ec6c92..e642ceb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,11 +1,11 @@ # dtwSat v0.2.7 -* Adds support to user defined weight function - -* Adds a minimalist function called twdtwReduceTime that is 3x faster than twdtwApply +* Adds support to user defined TWDTW weight function * Drop support to parallel processing +* Adds a minimalist function called twdtwReduceTime that is 3x faster than twdtwApply. This function can be used for high level parallel processing implemented by users + # dtwSat v0.2.6 * Fixes error in to - from : non-numeric argument to binary operator in "twdtwAssess" diff --git a/R/miscellaneous.R b/R/miscellaneous.R index 0ca8c19..ab90d65 100644 --- a/R/miscellaneous.R +++ b/R/miscellaneous.R @@ -136,7 +136,7 @@ shiftDates.twdtwTimeSeries = function(x, year){ if(is(y, "data.frame")){ if(is.null(proj4string)){ warning("Missing projection. Setting the same projection as the raster time series.", call. = FALSE) - proj4string = CRS(projection(object)) + proj4string = CRS(projection(object@timeseries[[1]])) } if(!is(proj4string, "CRS")) proj4string = try(CRS(proj4string)) y = SpatialPointsDataFrame(y[,c("longitude","latitude")], y, proj4string = proj4string) diff --git a/R/plotCostMatrix.R b/R/plotCostMatrix.R index 4f85fcd..8f77808 100644 --- a/R/plotCostMatrix.R +++ b/R/plotCostMatrix.R @@ -90,7 +90,7 @@ plotCostMatrix = function(x, timeseries.labels=NULL, patterns.labels=NULL, matri ## Set axis breaks and labels x.labels = pretty_breaks()(range(df.m$tx, na.rm = TRUE)) timeline = unique( c(df.m$tx, x.labels) ) - x.breaks = zoo( c(unique(df.m$Var2), rep(NA, length(x.labels))), timeline ) + x.breaks = zoo( c(unique(df.m$Var2), rep(NA, length(x.labels))), order.by = timeline ) x.breaks = na.approx(x.breaks, rule = 2) x.axis = data.frame(x.breaks=x.breaks[x.labels], x.labels = names(x.labels)) @@ -101,8 +101,8 @@ plotCostMatrix = function(x, timeseries.labels=NULL, patterns.labels=NULL, matri y.axis = do.call("rbind", lapply(y, function(p){ df = df.m[df.m$Pattern==p,] y.labels = pretty_breaks()(range(df$ty, na.rm = TRUE)) - timeline = unique( c(df$ty, y.labels) ) - y.breaks = zoo( c(unique(df$Var3), rep(NA, length(y.labels))), timeline ) + timeline <- unique(merge(unique(df[,c("ty","Var3")]), data.frame(ty = y.labels[drop = FALSE]), by.x = "ty", by.y = "ty", all.x = TRUE, all.y = TRUE)) + y.breaks <- zoo(timeline$Var3, order.by = timeline$ty) y.breaks = na.approx(y.breaks, rule = 2) y.breaks = y.breaks[y.labels] data.frame(y.breaks, y.labels=names(y.labels)) diff --git a/R/plotPaths.R b/R/plotPaths.R index 7c4e84d..5438640 100644 --- a/R/plotPaths.R +++ b/R/plotPaths.R @@ -105,8 +105,8 @@ plotPaths = function(x, timeseries.labels=NULL, patterns.labels=NULL, k=NULL){ y.axis = do.call("rbind", lapply(y, function(p){ df = df.m[df.m$Pattern==p,] y.labels = pretty_breaks()(range(df$ty, na.rm = TRUE)) - timeline = unique( c(df$ty, y.labels) ) - y.breaks = zoo( c(unique(df$Var3), rep(NA, length(y.labels))), timeline ) + timeline <- unique(merge(unique(df[,c("ty","Var3")]), data.frame(ty = y.labels[drop = FALSE]), by.x = "ty", by.y = "ty", all.x = TRUE, all.y = TRUE)) + y.breaks <- zoo(timeline$Var3, order.by = timeline$ty) y.breaks = na.approx(y.breaks, rule = 2) y.breaks = y.breaks[y.labels] data.frame(y.breaks, y.labels=names(y.labels)) diff --git a/cran-comments.md b/cran-comments.md index 4945447..84fad68 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,9 @@ ## Test environments + +* Local Ubuntu 20.04 (64-bit), R 4.1.1 + devtools::check(args = '--as-cran') + devtools::submit_cran() + * win-builder devtools::check_win_release() devtools::check_win_devel() @@ -8,19 +13,17 @@ rhub::check_for_cran(check_args = '--as-cran') rhub::check_for_cran(check_args = '--as-cran', valgrind = TRUE) -* Ubuntu 20.04 (64-bit), R 4.1.1 - devtools::check(args = '--as-cran') - devtools::submit_cran() - ## REVIEWS # v0.2.7 -* Fixes error in cost TWDTW weighting function +* Fixes error in cost TWDTW weighting function + +* Drop support to parallel processing -* Drop support to parallel processing +* Drop projection method for twdtwRaster class as it was used only internally -* Fixes errors and warnings from https://cran.r-project.org/web/checks/check_results_dtwSat.html +* Fixes errors from https://cran.r-project.org/web/checks/check_results_dtwSat.html # v0.2.6 @@ -59,7 +62,7 @@ * build_win() latex compilation error: -I have successfully built and compiled the latex of the vignette using a personal Windows machine. However, 'build_win' gives an error while compiling the latex of vignette. The error message given by the server is unclear for me: +I have successfully built and compiled the latex of the vignette using a personal Windows machine. However, 'build_win' gives an error while compiling the latex of vignette. The error message given by the server is unclear to me: * checking re-building of vignette outputs ... WARNING