s-news
[Top] [All Lists]

Re: Indirect references in SPLUS

To: s-news@lists.biostat.wustl.edu
Subject: Re: Indirect references in SPLUS
From: Santosh <santosh2005@gmail.com>
Date: Tue, 23 Jan 2007 20:18:20 -0800
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=cnJqE0uilVsFS5x7ZoyxLMX4UJcjRhLgT64sZPTe5Joev4rzznLKSiPkDZQXkWlnbzU6ee8kJbICxCraZ6FQ0VJ7Lc3+HxaTFOVemWfeRm7zm1KdG72UZupIje+UebXG3X+839auNXch5zri5jX2WELH2FlM6yxRG7+3i56Zawk=
In-reply-to: <45B4905E.5020602@pburns.seanet.com>
References: <816b5ce40701212254m52dc49c9q8c83e27aeed8d2d6@mail.gmail.com> <45B4905E.5020602@pburns.seanet.com>
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


<Prev in Thread] Current Thread [Next in Thread>