Skip to content
Back to formatted view

Raw Message

Message-ID: <A4D0AD48C137224D9E532742F418928A1CFB8D27@BL2PRD0111MB520.prod.exchangelabs.com>
Date: 2013-07-29T02:00:15Z
From: Dario Strbenac
Subject: Declare BASH Array Using R System Function

Hello,

It is difficult searching for previous posts about this since the keywords are short and ambiguous, so I hope this is not a duplicate question.

I can easily declare an array on the command line.

$ names=(X Y)
$ echo ${names[0]}
X

I am unable to do the same from within R.

> system("names=(X Y)")
sh: Syntax error: "(" unexpected

Reading the documentation for the system function, it appears to only be relevant for executing commands. What can I do instead to declare a BASH array ? Thanks.

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia