开发者

Need date picker for R application

I am searching for a simple date picker to use w开发者_如何学编程ith R. I can find many pickers written in other languages, but I would rather not mix languages if at all possible. Does anyone know of a R package which provides this functionality?


If you don't mind installing gWidgets and gWidgetstcltk you have this:

library(gWidgetstcltk)
options(guiToolkit="tcltk")
#    
pickDate <- function() {
  date <- NULL
  dlg <- gbasicdialog(handler=function(...) date <<- svalue(calendar))
  calendar <- gcalendar(cont=dlg)
  visible(dlg, set=TRUE)
  date
}


i think you can use gcalendar() from gWidgets.

options("guiToolkit"="RGtk2")
library(RGtk2)
library(gWidgets)

win <- gwindow("Test Calendar", width=12)   
Group <- ggroup(cont=win)

tmp <- gframe("Date", container=Group )
add(tmp, calStart)
add(tmp, calEnd)

calStart <- gcalendar("Debut", format = "%Y-%m-%d")
calEnd <- gcalendar("Fin", format = "%Y-%m-%d")

dateStart <- svalue(calStart) 
dateFin <- svalue(calEnd)

Perhaps, this can help you.

Regards,

YougyZ

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜