[R] SPI package error

arun smartpink111 at yahoo.com
Wed Aug 28 14:59:28 CEST 2013



HI Catalin,

This seems to work:

spi(6,"spi.txt",1963,2010,"Standardized Precipitation Index - Rio Grande do Norte State",2,"years","months")

From the source code:




spi #on your R console
---------------------------

 if (nargs < 3) {
        return("Error: very small number of arguments")
    }
    else {
        if (nargs > 7) {
            return("Error: very large number of arguments")
        }


#It also requires 

 else {
            tit = paste(title, sep = "")
        }


------------------------

when I try:

spi(7,"spi.txt",1963,2010)
#Error in paste(title, sep = "") : 
 # argument "title" is missing, with no default
 spi(2,"spi.txt",1963,2010)
#[1] "Error: very small number of arguments"
 spi(12,"spi.txt",1963,2010)
#[1] "Error: very large number of arguments"




I think it would be better to contact the package maintainer regarding this:
maintainer("spi")
#[1] "Josemir Neves <josemir.neves at gmail.com>"


A.K.


_______________________________
From: catalin roibu <catalinroibu at gmail.com>
To: arun <smartpink111 at yahoo.com> 
Sent: Wednesday, August 28, 2013 8:12 AM
Subject: Re: [R] SPI package error



Thanks for help!
the reproducible example is>
data(spi_data)
write.table(spi_data,file="spi.txt",quote=FALSE,row.names=TRUE)
## Standard format with the output in the text format
spi(6,"spi.txt",1963,2010)




On 28 August 2013 15:09, arun <smartpink111 at yahoo.com> wrote:

HI,
>Could you provide a reproducible example?
>Tx.
>
>
>
>
>
>----- Original Message -----
>From: catalin roibu <catalinroibu at gmail.com>
>To: r-help at r-project.org
>Cc:
>Sent: Wednesday, August 28, 2013 8:05 AM
>Subject: [R] SPI package error
>
>Dear all!
>
>I find a problem from SPI package. When I try a 6 months scale I have this
>error:
>write.table(test,file="spi.txt",quote=FALSE,row.names=TRUE)
>spi3<-spi(6,"spi.txt",1902,2009)
>Error in paste(title, sep = "") :
>  argument "title" is missing, with no default
>If I use 3 months scale everything is ok.
>
>Please help me to solve this problem!
>
>Thank you!
>
>
>--
>---
>Catalin-Constantin ROIBU
>Lecturer PhD, Forestry engineer
>Forestry Faculty of Suceava
>Str. Universitatii no. 13, Suceava, 720229, Romania
>office phone     +4 0230 52 29 78, ext. 531
>mobile phone   +4 0745 53 18 01
>                       +4 0766 71 76 58
>FAX:                +4 0230 52 16 64
>silvic.usv.ro
>
>    [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
>
>


-- 

---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone       +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
                       +4 0766 71 76 58
FAX:                          +4 0230 52 16 64
silvic.usv.ro



More information about the R-help mailing list