I need you help.
The situation is that I have to use the computational power of the a remote server from my laptop.
I am using svSocket package and I have written the following:
Client side
library(svSocket)
##establish connection
con <- socketConnection(host = 'xxxxxxxxx', port = 8887, blocking = FALSE)
## I have tried both
eval_socket_server(con,nsso,"nsso()")
eval_socket_server(con,"nsso()")
## close at the end of the process
close_socket_clients()
Server side
library(svSocket)
setwd("D:/xxxxxxxxxxxxx")
source("TestSock.R") ## load the function called NSSO()
start_socket_server(local = F, port=8887)
The function load a dataframe, perform some data manipulation and output is
write_csv(dfDef, "dftest.csv") ##write the manipulated dataframe
SummDFDef ## print a summary of the manipulated dataframe
return(print("Script done")) ## let you know when it is done
Using both approach on the client side i get the following error:
Error in source(objcon, local = TRUE, echo = FALSE, verbose = FALSE) :
objcon:5:99: unexpected 'if'
4: trace = structure(list(call = list(quote(try(`<fn>`())),
5: quote(tryCatch(expr, error = function(e) { call <- conditionCall(e) if
^
How I fix it? Thank you.