Re: [R] Comparing the components of a data frame without levels interfering

2011-10-13 Thread swonder03
Thank you both. For my purposes I need the for statement. I looked into merge but what I wound up doing was installing the package 'compare' and using the if statement /if((compare(dfCity[k,1], dfState[j,1], dropLevels=TRUE)==TRUE){do something}/. This seemed to behave the way I wanted. -- View t

Re: [R] Comparing the components of a data frame without levels interfering

2011-10-12 Thread Jeff Newmiller
Factors include a comprehensive list of all possible values they can assume. Your name columns have different numbers of names, so they are really very different factors. The best solution for you is to convert those columns to character. You also ought to learn how to use the merge function be

Re: [R] Comparing the components of a data frame without levels interfering

2011-10-12 Thread Petr PIKAL
Hi > *Bottom Line: How can I compare the individual components of two data frames > with different row lengths without the levels interfering?* > > Example: I have two data frames to those respectively named 'dfCity' and > 'dfState' that have the following output: > > dfCity > > Name

[R] Comparing the components of a data frame without levels interfering

2011-10-12 Thread swonder03
*Bottom Line: How can I compare the individual components of two data frames with different row lengths without the levels interfering?* Example: I have two data frames to those respectively named 'dfCity' and 'dfState' that have the following output: dfCity Name City 1Bill