r-rook-package

Run R/Rook as a web server on startup

◇◆丶佛笑我妖孽 提交于 2019-12-09 11:32:40
问题 I have created a server using Rook in R - http://cran.r-project.org/web/packages/Rook Code is as follows #!/usr/bin/Rscript library(Rook) s <- Rhttpd$new() s$add( name="pingpong", app=Rook::URLMap$new( '/ping' = function(env){ req <- Rook::Request$new(env) res <- Rook::Response$new() res$write(sprintf('<h1><a href="%s">Pong</a></h1>',req$to_url("/pong"))) res$finish() }, '/pong' = function(env){ req <- Rook::Request$new(env) res <- Rook::Response$new() res$write(sprintf('<h1><a href="%s">Ping

Getting the private ip address of an Rook/Shiny page user

℡╲_俬逩灬. 提交于 2019-12-08 15:26:37
问题 I have created some web app using Rook which listen to my network ip (192.168.xx.xx) at port 8000. Everyone inside my office can connect to them just typing http://192.168.xx.xx:8000/page_name in the browser. I need to monitor these pages usage and wonder how I can get the network ip address of those connected to them. I'm not experienced in web development and from the research done so far it seems that using client side code like JavaScript it's very difficult (almost impossible) to achieve

R: adding 1 month to a date

血红的双手。 提交于 2019-11-27 17:52:40
问题 I want to get the date sequence between a startDate and endDate by adding 1 month to the startDate . ie, if startDate is 2013-01-31 and endDate is 2013-07-31, I would prefer to see dates like this: "2013-01-31" "2013-02-28" "2013-03-31" "2013-04-30" "2013-05-31" "2013-06-30" "2013-07-31" I have tried seq.Date(as.Date("2013-01-31"),by="month",length.out=7) . But the output of this code is like this > seq.Date(as.Date("2013-01-31"),by="month",length.out=7) [1] "2013-01-31" "2013-03-03" "2013-03