From b.rowlingson at lancaster.ac.uk  Sat Jan  2 11:41:03 2010
From: b.rowlingson at lancaster.ac.uk (Barry Rowlingson)
Date: Sat, 2 Jan 2010 10:41:03 +0000
Subject: [Rd] How x[, 'colname1'] is implemented?
In-Reply-To: <366c6f341001011340g7e1ff7cbk1b006b3a2a2aee81@mail.gmail.com>
References: <366c6f340912311415qfd00d4codf366e1919ca8b5f@mail.gmail.com>
	<77EB52C6DD32BA4D87471DCD70C8D700024DD3D9@NA-PA-VBE03.na.tibco.com>
	<366c6f340912311527u52d4c62bn151fc33d2fc502fb@mail.gmail.com>
	<d8ad40b51001010452k2299b0f8kdc1376525ce3536d@mail.gmail.com>
	<366c6f341001011340g7e1ff7cbk1b006b3a2a2aee81@mail.gmail.com>
Message-ID: <d8ad40b51001020241u49cd4837u1325848297dd55d3@mail.gmail.com>

On Fri, Jan 1, 2010 at 9:40 PM, Peng Yu <pengyu.ut at gmail.com> wrote:

> I'm not complaining that it is not documented.

 Yes but you didn't answer my question. When you ask a question on
these (or any mailing lists) you should always say what efforts you've
made to answer the question. I first looked in the help for '[' but
didn't find anything there. If you had already done that and told us
then I wouldn't have wasted my time. If you'd gone on to say you'd
also looked in the source code, and in which files, then I wouldn't
have wasted my time looking in those files. Note that this is all for
your benefit as well because we'll be able to help you quicker!

>> ?As Obi-wan Kenobi may have said in Star Wars: "Use the source, Luke!":

> Could you explain what ns and nx represent?

 No, you need to take Obi-wan's advice (or Seth Falcon's, who got to
this before me) and 'Use the source'. I would hope that since you have
an understanding of what a hashing algorithm is that you should also
have some understanding of programming, and even if not in C it's not
too hard to figure out.

 You could make the effort to look in subscript.c and work it out for yourself.

 If you are very interested in the low-level working of R then you
should compile R with debugging turned on, then run R in a debugger
and set a breakpoint in the array subscript function. Then you can
inspect the C variables when you run it.

Barry



[Rd] How x[, 'colname1'] is implemented?
Barry Rowlingson