Re: [R] Any container in R?

From: Feng Qiu <hustqiufeng_at_sohu.com>
Date: Mon 01 Jan 2007 - 18:45:11 GMT

Hi Duncan:

         Thank you very much! I checked out unique(), it does exactly what I want. But I'm still curious about if R provides "STL"(standard template library).

Best,

Feng

> On 1/1/2007 11:22 AM, Feng Qiu wrote:
>> Hi Duncan:
>> Thanks for your hints.
>> I'm trying to collect distinct elements in one column in a
>> matrix. If there is a map, I can easily build up such a collection. While
>> if using list, I have to check by myself if this element already exists
>> in the collection every time I examine a new entry in the column.
>
> You might want to use the unique() function, or duplicated(), rather than
> doing this yourself.
>
> Duncan Murdoch
>
>>
>> Best,
>>
>> Feng
>>
>> ----- Original Message -----
>> From: "Duncan Murdoch" <murdoch@stats.uwo.ca>
>> To: "Feng Qiu" <hustqiufeng@sohu.com>
>> Cc: <r-help@stat.math.ethz.ch>
>> Sent: Monday, January 01, 2007 10:37 AM
>> Subject: Re: [R] Any container in R?
>>
>>
>>> On 1/1/2007 10:17 AM, Feng Qiu wrote:
>>>> R has list and array to contain elements. But does R have more powerful
>>>> container, such as "map" as in C++ STL? or is there such a package?
>>> In what way are maps more powerful than lists? You can use names to
>>> index lists.
>>>
>>> The other container in R is the environment; they have fairly strange
>>> semantics, though.
>>>
>>> Duncan Murdoch
>>>
>>>
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Jan 02 05:53:30 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 01 Jan 2007 - 20:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.