I agree with everyone, you need to provide a reproducible example if you
want people to help you.
I don't know where you found the meteo2STFDF function, but you can use the
spacetime package to build a STFDF

library(spacetime)
library(rgdal)

load("dprec84.rda")
load("stations1.rda")

coordinates(stations1) <- c("lon", "lat")
proj4string(stations1) <- CRS("+init=epsg:4326")

time <- as.POSIXct(unique(dprec84$date))
stfdf <- STFDF(stations1, time, data = dprec84[, "prec", drop = FALSE])

Feel free to read the vignette (vignette("jss816")) to know more about the
spacetime package.

Just a quick question, though is this source of precipitation data publicly
available for researcher (Senegal) ?

Hope it helps




On Fri, Aug 8, 2014 at 1:07 PM, Milan Kilibarda <milan.kili11@gmail.com>
wrote:

> Dear Abdoulaye,
>
> Regarding to your Error message, I guess you should check if the time
> format in your observation set was appropriate. In spacetime package
> POSIXct is preferable. See  ? as.POSIXct, for easy converting from
> string to POSIX* format. If you still have problem, than you should
> send at least  str(dprec84) and str(stations1), or even better make
> small subset in mail of your data, then people from the list could try
> to reproduce the problem; try to find solution; and it can help
> someone with a similar problem.
> Best,
> Milan
>
> > prec <- meteo2STFDF(dprec84,stations1, crs= CRS('+proj=longlat
> +datum=WGS84'))
> Joining by: staid, date
>
> Joining by: staid
> Error in  ST(sp, time, endTime) : time is not a time based class
>
> On Fri, Aug 8, 2014 at 1:55 PM, Abdoulaye Sarr <abdoulayesar@gmail.com>
> wrote:
> > I am still hoping to have a quick explanation on what is causing the
> error
> > or a suggestion on another way to do it?
> >
> > Cheers,
> > eus
> >
> >
> > On Sun, Aug 3, 2014 at 2:20 PM, Abdoulaye Sarr <abdoulayesar@gmail.com>
> > wrote:
> >
> >> I think the problem could be related to dates in precip, in fact here I
> am
> >> using dekadal precip( 10 days average therefor for each month you have
> 01,
> >> 11 and 21 as you can see in the date in sample dataframes dprec84.rda
> and
> >> the stations1.rda.
> >>
> >> After creating these dataframes I am trying to use use meteo to create a
> >> STFDF (I guess other packaged could do it?) using the command below:
> >>
> >> > prec <- meteo2STFDF(dprec84,stations1, crs= CRS('+proj=longlat
> >> +datum=WGS84'))
> >> Joining by: staid, date
> >>
> >> Joining by: staid
> >> Error in  ST(sp, time, endTime) : time is not a time based class
> >>
> >> If doable with other package also will be fine for me.
> >>
> >> asarr
> >>
> >>
> >> On Sun, Aug 3, 2014 at 9:40 AM, Edzer Pebesma <
> >> edzer.pebesma@uni-muenster.de> wrote:
> >>
> >>> Please provide a small, reproducible example.
> >>>
> >>> Wbr,
> >>>
> >>> On 07/26/2014 08:29 PM, Abdoulaye SARR wrote:
> >>> >
> >>> > Hello list,
> >>> >
> >>> > I am creating a space time full data frame but having this error
> >>> message:
> >>> >
> >>> > Joining by: staid
> >>> > Error in ST(sp, time, endTime) : time is not a time based class
> >>> >
> >>> > the data frame 10 days average precip used looks like this:
> >>> >
> >>> >      staid       time prec
> >>> > 1 38007200 1984-01-01  0.0
> >>> > 2 38008400 1984-01-01  0.8
> >>> > 3 38014000 1984-01-01  0.0
> >>> > 4 38008100 1984-01-01  0.0
> >>> > 5 38008700 1984-01-01  0.0
> >>> > 6 38009200 1984-01-01  0.0
> >>> >
> >>> >
> >>> > The next date 1984-01-11 etc..
> >>> >
> >>> > could someone help solve this urgent issue.
> >>> >
> >>> > Best regards,
> >>> >
> >>> > eus
> >>> >
> >>> >
> >>> >       [[alternative HTML version deleted]]
> >>> >
> >>> > _______________________________________________
> >>> > R-sig-Geo mailing list
> >>> > R-sig-Geo@r-project.org
> >>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>> >
> >>>
> >>> --
> >>> Edzer Pebesma
> >>> Institute for Geoinformatics (ifgi), University of Münster
> >>> Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
> >>> 83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795
> >>>
> >>>
> >>> _______________________________________________
> >>> R-sig-Geo mailing list
> >>> R-sig-Geo@r-project.org
> >>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>>
> >>>
> >>
> >
> >         [[alternative HTML version deleted]]
> >
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>
>
> --
> Dr. Milan Kilibarda
> Assistant professor
> University of Belgrade,
> Faculty of Civil Engineering,
> Department of Geodesy and Geoinformatics,
> Address: Bulevar kralja Aleksandra 73  11000 Belgrade, Serbia,
> Mail:  kili@grf.bg.ac.rs
> Web: http://www.grf.bg.ac.rs/fakultet/pro/e?nid=168 ;
> http://dailymeteo.org/
> Pub: http://scholar.google.com/citations?user=Zl2MZ3AAAAAJ&hl=en
> tel:+381 11 3218630
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Ahmadou H. DICKO
statistician economist (Ingénieur Statisticien Économiste)
PhD candidate in Climate change economics
Faculty of economics and managment - Cheikh Anta Diop University
West African Science Service Center on Climate Change and Adaptated Land
Use (WASCAL)
Center for Development Research (ZEF) - University of Bonn
email : ahmadou.dicko@ucad.edu.sn
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
tel : +221 33 827 55 16
portable: +221 77 123 81 69

	[[alternative HTML version deleted]]

