If the file is tab delimited then you need to use read.table(sep = "\t") 
instead of read.table(sep = ""). read.delim() is another option.

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than 
asking him to perform a post-mortem examination: he may be able to say what the 
experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure 
that a reasonable answer can be extracted from a given body of data.
~ John Tukey

Van: R-sig-ecology [mailto:r-sig-ecology-boun...@r-project.org] Namens Manuel 
Esteban Lucas Borja
Verzonden: dinsdag 23 december 2014 9:13
Aan: r-sig-ecology@r-project.org
Onderwerp: [R-sig-eco] SPEI index

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.lu...@uclm.es
Web:http://www.uclm.es/profesorado/manuelestebanlucas/


        [[alternative HTML version deleted]]
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Disclaimer Bezoek onze website / Visit our 
website<https://drupal.inbo.be/nl/disclaimer-mailberichten-van-het-inbo>
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to