With the package svSocket
I'm trying to execute in the server a generic expression
expr <- "demo<-new.env()"
evalServer(con, expr, expr)
> evalServer(con, parse(text=expr))
Error in source(objcon, local = TRUE, echo = FALSE, verbose = FALSE) :
objcon:1:65: unexpected '<'
1: ..Last.value <-structure(expression(demo<-new.env()), srcfile = <
How can I avoid that? PS: my need is to programmatically create object into the server. e.g. demo
would come from a user input and paste()d into the above string.
Reproducible example ### Open two rsession
# run in the 1st rsession
require(svSocket)
startSocketServer()
# run in the 2nd rsession
con <- socketConnection(host = "localhost", port = 8888, blocking = FALSE)
expr <- "demo<-new.env()"
evalServer(con, expr, expr)