I am trying to work with the "airGRTeaching" package in R. it aims to fit a simulated flow "Qs" to an observed one "Q" using some mathematical equations and input variables (P and E).
I have prepared my input file that contains among other thing a column named "jour" that refers to date. here is how the table file named Book1.CSV looks like
jour P E Q
1 1-1-1991 13.0 2.464 0.072
2 1-2-1991 15.6 1.799 0.068
3 1-3-1991 13.6 1.379 0.150
4 1-4-1991 0.0 1.628 0.605
5 1-5-1991 7.8 2.000 0.535
6 1-6-1991 15.2 1.606 0.367
7 1-7-1991 1.3 1.812 1.153
8 1-8-1991 0.0 2.222 1.768
9 1-9-1991 0.3 2.700 0.999
10 1-10-1991 0.0 2.354 0.695
As demanded, the data file should be in date.frame format so I converted using the line below:
> mydata<-read.csv("C:\\Users\\AcER PREDATOR\\Desktop\\Book1.CSV", header=TRUE)
> df<-data.frame(mydata)
Now I want to convert the date column (jour) into "POSIXt" format UTC time zone. So, I tried:
> DATE<- as.POSIXlt(df[1], tz="UTC", format= c("%Y-%m-%D %H:%M/%OS"), optional = FALSE)
but I get this error message:
Error in as.POSIXlt.default(df[1], tz = "UTC", format = c("%Y-%m-%D %H:%M/%OS"), :
do not know how to convert 'df[1]' to class “POSIXlt”
Any suggestions how to resolve this issue is appreciable. Thank's