Great!! Thank you so much for your suggestions, Patrick and Rich!
That got me workin! -Santosh
On 1/22/07, Patrick Burns <
pburns@pburns.seanet.com> wrote:You could have found '[[' in the subscripting section
of chapter 1 of S Poetry.
Actually I would prefer:
df[, DataColumn]
as it works with matrices and data frames, and it doesn't presume to know how data frames are implemented.
Patrick Burns
patrick@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User")
Santosh wrote:
> Dear SPlus Users, > > Is there a way to work with indirect references in SPlus? > > For example, > > DataColumn <- "Resist" > MatrixColumn <- "ExpnsnCoeff"'
> ScalarColumn <- "Voltage" > > As I don't know the syntax, I would like illustrate using the examples > given below. > > In conventional SPLUS notation, if "df" is a generic dataframe that
> consists of vectors > "Resist", "ExpnsnCoeff", "Voltage", > > "df$Resist", "df$ExpnsnCoeff", "df$Voltage" notation may be used to > for data handling in respective vectors of the data frame.
> > Instead of the above notation, I would like to use an indirect > reference like: > > Assuming that the syntax to provide indirect references is curly > braces, e.g. ${DataColumn},
> > "df${DataColumn}" indirectly accesses the vector "df$Resist"; > similarly "df${MatrixColumn}" calls "df$ExpnsnCoeff" vector > indirectly, and so on.. >
> > Hope the above question is clear; please do feel free to ask if you > have any additional questions. > > Regards, > Santosh
|