Skip to content

Commit

Permalink
further updates required by CRAN
Browse files Browse the repository at this point in the history
change class to is
  • Loading branch information
Yuanchao-Xu committed Aug 12, 2023
1 parent 27329d8 commit 2b490b6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
frc[noRain] <- 0
} else {
warning('All the observations of this cell(station) are lower than the threshold,
no bias correction applied.')
}
return(frc)
}
frc_new4 <- biasCorrect(frc, hindcast, obs, method = 'gqm', preci = TRUE)
library(MASS)
Expand Down Expand Up @@ -510,3 +504,9 @@ httr::parse_url(r$url)
devtools::submit_cran()
undebug(devtools::submit_cran)
devtools::submit_cran()
devtools::check(remote = T, cran = T)
devtools::check(remote = T, cran = T)
devtools::check(remote = T, cran = T)
devtools::check(remote = T, cran = T)
devtools::check_win_devel()
devtools::submit_cran()
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.4.4
Date: 2023-07-19 14:24:10 UTC
SHA: 37791a34a0676a9a05cb6ee87291561f702e1bc7
Version: 1.4.5
Date: 2023-08-12 14:09:46 UTC
SHA: 27329d85193217a33e104c30a29bb1b154d91f0c
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: hyfo
Type: Package
Title: Hydrology and Climate Forecasting
Version: 1.4.4
Date: 2023-7-12
Version: 1.4.5
Date: 2023-8-11
Authors@R: person("Yuanchao", "Xu", email = "[email protected]",
role = c("aut", "cre"))
Description: Focuses on data processing and visualization in hydrology and
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ importFrom(MASS,fitdistr)
importFrom(data.table,rbindlist)
importFrom(grDevices,rainbow)
importFrom(lmom,samlmu)
importFrom(methods,is)
importFrom(methods,new)
importFrom(methods,setClass)
importFrom(methods,setGeneric)
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
hyfo 1.4.5
==========
Date: 2023-8-11

- update Rgdal dependencies
- change class() to is() to avoid cran notes



hyfo 1.4.3
==========
Date: 2020-8-26
Expand Down
3 changes: 2 additions & 1 deletion R/analyzeTS.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@
#'
#' @import ggplot2
#' @importFrom reshape2 melt
#' @importFrom methods is
#' @export
plotTS <- function(..., type = 'line', output = 'data', plot = 'norm', name = NULL, showNA = TRUE,
x = NULL, y = NULL, title = NULL, list = NULL) {
## arrange input TS or TS list.
if (is.null(list)) {
list <- list(...)
if (!class(list[[1]]) == 'data.frame') {
if (!is(list[[1]])[1] == 'data.frame') {
warning('Your input is probably a list, but you forget to add "list = " before it.
Try again, or check help for more information.')
}
Expand Down
6 changes: 4 additions & 2 deletions R/getSpatialMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ getSpatialMap <- function(dataset, method = NULL, member = 'mean', ...) {
#' @export
#' @import ggplot2 plyr maps maptools sf
#' @importFrom stats median
#' @importFrom methods is
#' @importFrom reshape2 melt
#' @references
#'
Expand Down Expand Up @@ -260,7 +261,7 @@ getSpatialMap_mat <- function(matrix, title_d = NULL, catchment = NULL, point =
checkWord <- c('lon', 'lat', 'z', 'value')
if (is.null(attributes(matrix)$dimnames)) {
stop('Input matrix is incorrect, check help to know how to get the matrix.')
} else if (!is.null(catchment) & class(catchment) != "SpatialPolygonsDataFrame") {
} else if (!is.null(catchment) & is(catchment)[1] != "SpatialPolygonsDataFrame") {
stop('Catchment format is incorrect, check help to get more details. ')
} else if (!is.null(point) & any(is.na(match(checkWord, attributes(point)$names)))) {
stop('point should be a dataframe with colnames "lon, lat, z, value".')
Expand Down Expand Up @@ -416,6 +417,7 @@ getSpatialMap_mat <- function(matrix, title_d = NULL, catchment = NULL, point =
#' @export
#' @import ggplot2 maps
#' @importFrom data.table rbindlist
#' @importFrom methods is
#' @references
#'
#' \itemize{
Expand All @@ -433,7 +435,7 @@ getSpatialMap_comb <- function(..., list = NULL, nrow = 1, x = '', y = '', title
data_ggplot <- rbindlist(maps)
}

if (!class(data_ggplot) == 'data.frame') {
if (!is(data_ggplot)[1] == 'data.frame') {
warning('Your input is probably a list, but you forget to add "list = " before it.
Try again, or check help for more information.')
} else if (is.null(data_ggplot$Name)) {
Expand Down

0 comments on commit 2b490b6

Please sign in to comment.