[R] Data format problem

Joao Santos jcsantos at student.dei.uc.pt
Wed Oct 24 12:12:04 CEST 2007


Hello,

First of all, thanks everyone that reply to my questions and I sorry to
spend so many time to reply.
I'm find a way to treat this problem using the zoo package:

bbrass = scan("C:/Program Files/R/data
PTIN/bbrass_client_2471_pool_72644_percent_in_use_500_NA.dat")
regts.start = ISOdatetime(2006, 7, 1, hour=0, min=0, sec=0, tz="GMT")	#2006
07 01 00
regts.end = ISOdatetime(2006, 7, 22, hour=2, min=0, sec=0, tz="GMT")	#2006
07 22 02
regts.zoo <- zooreg(bbrass, regts.start, regts.end, deltat=3600) #I won't
the time to the hour...
summary(regts.zoo)

     Index                       regts.zoo 
 Min.   :2006-07-01 00:00:00   Min.   :48  
 1st Qu.:2006-07-06 06:15:00   1st Qu.:58  
 Median :2006-07-11 12:30:00   Median :62  
 Mean   :2006-07-11 12:30:00   Mean   :65  
 3rd Qu.:2006-07-16 18:45:00   3rd Qu.:74  
 Max.   :2006-07-22 01:00:00   Max.   :81  
                               NA's   :40

Then I create a time series and the regul fuction (pastecs package) works
fine.


Thanks again for the replies,

Joao Santos



Joao Santos wrote:
> 
> Hello,
> 
>  
> 
> I problem is in the format of the date, my time series is like this:
> 
> 2006070100      1244     61        62
> 
> 2006070101      1221     60        60
> 
> 2006070102      1214     60        60
> 
> 2006070103      1194     59        59
> 
> 2006070104      1182     58        58
> 
> 2006070105      1178     58        58
> 
> 2006070106      1176     58        58
> 
> 2006070107      1173     58        58
> 
> 2006070108      1179     58        59
> 
> 2006070109      1246     61        62
> 
> 
.
> 
>  
> 
> When I attempt to format the time like this:
> 
> A <- read.table("file", sep="\t", col.names=c("date", "my1", "my2",
> "my3"))
> 
> temp <- as.Date(A$date, format="%Y%m%d%H")
> 
> temp
> 
> I get
> 
>   [1] "4403-05-21" "4403-05-22" "4403-05-23" "4403-05-24" "4403-05-25"
> 
>   [6] "4403-05-26" "4403-05-27" "4403-05-28" "4403-05-29" "4403-05-30"
> 
>  
> 
> Another problem is in REGUL, I using the variables created in the
> extraction
> of the data but the regulation is not possible
> 
>  
> 
> REGUL
> 
> Ts.regul<-regul(A$date, y=A$my2, xmin=2006070100, n=800, units="hours",
> frequency=1,
> 
>         deltat=1/3600, datemin=NULL, dateformat="m/d/Y", tol=NULL,
> 
>         tol.type="both", methods="linear", rule=1, f=0, periodic=FALSE,
> 
>         window=(2006080316 - 2006070100)/(800 - 1), split=100, specs=NULL)
> 
>  
> 
> I think if the question is resolved the function REGUL will work to.
> 
> Can someone help me? I new to this forum and in the utilisation of R.
> 
>  
> 
>  
> 
> Thanks for the help in advance,
> 
>  
> 
>             João Santos
> 
>  
> 
>  
> 
> 
> 	[[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.
> 
> 

-- 
View this message in context: http://www.nabble.com/%28no-subject%29-tf4602032.html#a13382815
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list