==1150694== Memcheck, a memory error detector ==1150694== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1150694== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==1150694== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==1150694== R Under development (unstable) (2021-03-19 r80100) -- "Unsuffered Consequences" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "scPDSI" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('scPDSI') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("Datasets") > ### * Datasets > > flush(stderr()); flush(stdout()) > > ### Name: Datasets > ### Title: Datasets for illustrating the functions in the scPDSI package. > ### Aliases: Datasets Lubuge Sample climatic data of > ### Keywords: datasets > > ### ** Examples > > data(Lubuge) > > > > > cleanEx() > nameEx("pdsi") > ### * pdsi > > flush(stderr()); flush(stdout()) > > ### Name: pdsi > ### Title: Calculate the (sc)PDSI > ### Aliases: pdsi > > ### ** Examples > > library(scPDSI) > data(Lubuge) > > P <- Lubuge$P > PE <- Lubuge$PE > sc_pdsi <- pdsi(P, PE, start = 1960) ==1150694== Conditional jump or move depends on uninitialised value(s) ==1150694== at 0x48C1FB7: pdsi::~pdsi() (packages/tests-vg/scPDSI/src/pdsi.cpp:221) ==1150694== by 0x48C74BE: C_pdsi(Rcpp::Vector<14, Rcpp::PreserveStorage>, Rcpp::Vector<14, Rcpp::PreserveStorage>, double, int, int, int, int, bool, double, double, double, double, double, double) (packages/tests-vg/scPDSI/src/scpdsi.cpp:11) ==1150694== by 0x48BB41B: _scPDSI_C_pdsi (packages/tests-vg/scPDSI/src/RcppExports.cpp:28) ==1150694== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1150694== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1150694== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1150694== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1150694== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1150694== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1150694== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1150694== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1150694== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1150694== Uninitialised value was created by a stack allocation ==1150694== at 0x48C7333: C_pdsi(Rcpp::Vector<14, Rcpp::PreserveStorage>, Rcpp::Vector<14, Rcpp::PreserveStorage>, double, int, int, int, int, bool, double, double, double, double, double, double) (packages/tests-vg/scPDSI/src/scpdsi.cpp:9) ==1150694== > > plot(sc_pdsi) # plot PDSI > plot(sc_pdsi, index = "PHDI") # plot PHDI > plot(sc_pdsi, index = "WPLM") # plot weighted PDSI > > # Without self-calibrating. > ori_pdsi <- pdsi(P, PE, start = 1960, sc = FALSE) > plot(ori_pdsi) > > # Without self-calibrating and use standards of > # mainland China. (GB/T 20481-2017) > options(PDSI.coe.K1.1 = 1.6) > options(PDSI.coe.K1.3 = 0.4) > options(PDSI.coe.K2 = 16.84) > options(PDSI.p = 0.755) > options(PDSI.q = 1/1.63) > gb_pdsi <- pdsi(P, PE, start = 1960, sc = FALSE) > plot(gb_pdsi) > > > > > ### *