FAQ
Hi,

I am trying to use the system2 function to execute external
applications(actually it is psql) inside R 2.14.0 on X64 Windows, but
the psql command has escape character inside it's full command line,
can you help to figure out the correct parameters for the system2
function,

The working command is :

psql -h 192.168.72.7 -U gpadmin -w -d miner_demo -c"\copy demo.store
to 'd:\store.csv' with csv header"

and my R code is:
psql <- "psql.exe"
gphost <- "192.168.72.7"
gpuser <- "gpadmin"
gpdb <- "miner_demo"

copycmd <- "-c \"\\copy demo.store to 'd:\\store.csv' with csv header\""
args <- c("-h", gphost, "-U", gpuser, "-w", "-d", gpdb, copycmd )
system2(psql, args)

And the return value of system2 function is 127.

Regards,

Xiaobo Gu

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupr-help @
categoriesr
postedDec 14, '11 at 10:12a
activeDec 14, '11 at 10:12a
posts1
users1
websiter-project.org
irc#r

1 user in discussion

Xiaobo Gu: 1 post

People

Translate

site design / logo © 2022 Grokbase