[R] Change Julian function in SPlus to R date code
Adams, Jean
jvadams at usgs.gov
Wed Jun 10 14:08:44 CEST 2015
Try looking at the julian() function in base ...
?julian
Jean
On Wed, Jun 10, 2015 at 2:46 AM, roslinazairimah zakaria <
roslinaump at gmail.com> wrote:
> Dear r-users,
>
> I have a code in SPlus which use julian function. What is the similar code
> used in R?
>
> define.date1<-function(dt1,mt1,mt2,nn,da)
> { mt2<-mt2+1
> start<-julian(mt1, 1, nn, origin=c(month=1, day=1, year=1971))+1
> end<-julian(mt2, 1, nn, origin=c(month=1, day=1, year=1971))+da
> a<-dt1[start:end,]
> am<-as.matrix(a[,5])
> }
>
> I have check the Date package in R but not so sure how to adjust it.
>
> Thank you for any help given.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>
[[alternative HTML version deleted]]
More information about the R-help
mailing list