Skip to content

r-help:

1 message · Sam McClatchie

#
System info:
Linux slackware
R Version 1.6.0  (2002-10-01)
ESS 5.1.21
Emacs 21.2.1
-------------------

Colleagues

Can anyone tell me what R does with local variables when they are passed
in a system call to a shell script?

e.g. I have a string as an R variable called tripcode. I want to pass
this variable in a system call to a local bash script calling gmt
(Generic Mapping Tool) functions:

  system("source map_acoustic_transects_and_trawls.gmt", tripcode)

I think this is what is meant in Section 4.6 of Venables and Ripley(?).

When I ECHO the parameter passed into the bash script nothing is returned:

echo "TripCode" $tripcode
TripCode

Is there a way to do this efficiently without writing the string
variable to a file and re-reading it into the shell script?

Thanks for advice,

Sam