Skip to content
Back to formatted view

Raw Message

Message-ID: <513E0BD6.4060801@ucalgary.ca>
Date: 2013-03-11T16:52:38Z
From: Peter Ehlers
Subject: Re move row.names column in dataframe
In-Reply-To: <898248CB-9236-4619-BB3F-F4E1B2C5A66B@civitaslearning.com>

On 2013-03-11 06:07, Jorgen Harmse wrote:
> identical(df[1,],df[2,]) is FALSE because of the row names. all( == ) is just a work-around that I attempted.
>
> Jorgen.


I would just wrap the elements in c():

  identical( c(df[1,]), c(df[2,]) )

Peter Ehlers

>
> On Mar 11, 2013, at 02:53 , PIKAL Petr wrote:
>
>>>
>>>> df <- data.frame(x=c(1,1,NA,NA), y=c(2,2,7,7))
>>>> identical(df[1,],df[2,])
>>> [1] FALSE
>>>> all(df[1,]==df[2,])
>>> [1] TRUE
>>>> all(df[3,]==df[4,])
>>> [1] NA
>>
>> I beg your pardon, whot does row names do with the above result? What do you expect as a result of
>>
>> all(df[3,]==df[4,])
>>
>> Regards
>> Petr
>>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>