[R-sig-eco] SPEI index

Alexandre Villers villers.alexandre at gmail.com
Tue Dec 23 10:25:32 CET 2014


Hello,

Next time you post a message on a R list, try to be more specific
because it's harder to answer your question if one has to guess it.
So the issue is not with reading the file, this seems to be going ok,
but with the use of the SPEI package. I wonder if it's not just
because your time series is too short (but being in holidays, don't
really have much time to search through the package and methods, I'll
leave that to you).

regards

Alex



2014-12-23 9:54 GMT+01:00 Manuel Esteban Lucas Borja
<ManuelEsteban.Lucas at uclm.es>:
> This is the .txt file. thank you for your time.
> Best
> ---
> Manuel Esteban Lucas Borja
> Universidad de Castilla La Mancha
> Escuela Técnica Superior de Ingenieros Agrónomos y de Montes
> Departamento de Ciencia y Tecnología Agroforestal y Genética
> Campus Universitario s/n,
> C.P. 02071, Albacete (Spain)
> Télf.; 967599200 ext. 2818
> Mail: ManuelEsteban.Lucas at uclm.es
> Web:http://www.uclm.es/profesorado/manuelestebanlucas/
>
>
> El 23/12/2014, a las 09:31, Alexandre Villers <villers.alexandre at gmail.com>
> escribió:
>
> Hello
>
> There are some nice tutorial on the Internet which will help you with r
> basics.  Do not expect people to answer any questions like yours and whose
> answer are pretty ovious once read those documents.
> The sep symbol for tabulation is sep="\t" in the read.table function
>
> Le 23 déc. 2014 09:13, "Manuel Esteban Lucas Borja"
> <ManuelEsteban.Lucas at uclm.es> a écrit :
>>
>> Dear All,
>>
>> I am starting to use R software in order to calculate an aridity index
>> (SPEI). I have installed the spei package and the library. Then, I have
>> created a .xls file with year, month, Precip and Temp variables. The xls
>> file has been exported to txt format (separated by tabulations). Then to
>> try, the only output I have obtained can be see below. Could anyone of you
>> please help me? If you want, I can send you the txt file.
>>
>> All the best,
>>
>> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
>> 1 NA NA NA NA NA NA NA NA NA NA NA NA
>> 2 NA NA NA NA NA NA NA NA NA NA NA NA
>>
>> Script:
>> library(SPEI)
>> SPEI <- read.table("/Users/PALAN.txt", header=TRUE, sep="")
>> str(SPEI)
>> PET <- thornthwaite(SPEI$Tm,40.00000)
>> spei(SPEI$PREC-PET,1)
>>
>> ---
>> Manuel Esteban Lucas Borja
>> Universidad de Castilla La Mancha
>> Escuela Técnica Superior de Ingenieros Agrónomos y de Montes
>> Departamento de Ciencia y Tecnología Agroforestal y Genética
>> Campus Universitario s/n,
>> C.P. 02071, Albacete (Spain)
>> Télf.; 967599200 ext. 2818
>> Mail: ManuelEsteban.Lucas at uclm.es
>> Web:http://www.uclm.es/profesorado/manuelestebanlucas/
>>
>>
>>         [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> R-sig-ecology mailing list
>> R-sig-ecology at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>
>



-- 
Alexandre Villers, PhD.
Postdoctoral researcher
Team Agripop
Centre d'Etudes Biologiques de Chizé
UMR 7372
CNRS - Université de la Rochelle
79360 Beauvoir sur Niort, FR



More information about the R-sig-ecology mailing list