Skip to content
Snippets Groups Projects
Commit b879fb8a authored by Mauricio Zambrano-Bigiarini's avatar Mauricio Zambrano-Bigiarini
Browse files

Fixed error that appeared when the 'plot_out' function was called from an R...

Fixed error that appeared when the 'plot_out' function was called from an R script running directly on the OS console (not within the R editor), with the following error message: 'Error in plot2(x = sim, y = obs, plot.type = single, main = paste('Daily',  : could not find function 'hasArg'
parent 37b148e9
No related branches found
No related tags found
No related merge requests found
Package: hydroPSO
Type: Package
Title: Model-Independent Particle Swarm Optimisation for Environmental Models
Version: 0.1-56-2
Date: 2012-06-25
Version: 0.1-56-3
Date: 2012-06-28
Author: Mauricio Zambrano-Bigiarini [aut, cre] and Rodrigo Rojas [ctb]
Author@R: c(person("Mauricio", "Zambrano-Bigiarini", email = "mzb.devel@gmail.com", role=c("aut", "cre") ), person("Rodrigo", "Rojas", email = "Rodrigo.RojasMujica@gmail.com", role=c("ctb") ) )
Maintainer: Mauricio Zambrano-Bigiarini <mzb.devel@gmail.com>
......
#importFrom("hydroTSM", hydroplot, hydropairs, dip, mip, yip, vector2zoo)
importFrom("Hmisc", wtd.quantile, wtd.Ecdf)
importFrom("sp", coordinates, spplot)
importFrom("lattice", xyplot, axis.default)
import(grid)
#importFrom("hydroTSM", hydroplot, hydropairs, dip, mip, yip, vector2zoo)
#importFrom("hydroGOF", ggof)
#importFrom("scatterplot3d", scatterplot3d)
#exportPattern("^[^\\.]")
export(hydroPSO,
......
......@@ -16,6 +16,13 @@ NEWS/ChangeLog for hydroPSO
-) default value for the exponent of the time-varying lambda was changed from 'TVlambda.exp= 1.7' to 'TVlambda.exp= 1'.
However, by default 'use.TVlambda= FALSE' still.
-) source code was tidy up
o 'plot_out' : -) Fixed error that appeared when the 'plot_out' function was called from an R script running directly on the OS console
(not within the R editor), with the following error message:
"Error in plot2(x = sim, y = obs, plot.type = "single", main = paste("Daily", :
could not find function "hasArg"
Calls: plot_results -> plot_out -> ggof -> plot2"
o 'plot_results': -) Same as immediately above (because 'plot_results' internally calls 'plot_out')
0.1-56 14-Jun-2012
o 'hydroPSO' : -) much less memory consumption for large values of 'maxit' and/or 'npart' (thanks to Paul Smith for reporting it !)
......
......@@ -17,7 +17,7 @@
################################################################################
# Author : Mauricio Zambrano-Bigiarini #
# Started: 03-Feb-2012 #
# Updates: 15-Feb-2012 ; 22-Feb-2012 #
# Updates: 15-Feb-2012 ; 22-Feb-2012 ; 28-Jun-2012 #
################################################################################
plot_out <- function(sim, obs,
......@@ -82,6 +82,12 @@ plot_out <- function(sim, obs,
} else if ( !(MinMax %in% c("min", "max")) )
stop("Invalid argument: 'MinMax' must be in c('min', 'max')")
} # IF end
# Checking 'hydroGOF' pacakge when ptype=="ts"
if (ptype=="ts") {
if (!require(hydroGOF))
stop("Invalid argument: You don't have the 'hydroGOF' package => You can not use 'ptype='ts' !!")
} # IF end
# Checking 'class(sim)'
if ( (ptype=="corr") | (ptype=="ts") ) {
......@@ -125,9 +131,6 @@ plot_out <- function(sim, obs,
} else if (ptype=="ts") {
main="Observed vs 'best' Simulation"
if (!require(hydroGOF))
stop("Invalid argument: You don't have the 'hydroGOF' package => You can not use 'ptype='ts' !!")
if (!is.null(dates)) {
if (!is.zoo(obs)) obs <- zoo(obs, dates)
......@@ -135,6 +138,7 @@ plot_out <- function(sim, obs,
} # IF end
# Plotting Sim vs Obs
library(hydroGOF)
ggof(sim=sim, obs=obs, main=main, ftype=ftype, FUN=FUN,
cex.main=cex.main, cex.axis=cex.axis, cex.lab=cex.lab, leg.cex=leg.cex) # dates.fmt="%Y-%m-%d")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment