On 11/10/05 6:33 AM, "Luis Ridao Cruz" <Luisr at frs.fo> wrote:
> R-help,
>
> I have two data frames with a commom column (but with different size)
> What I want is to get a column (say df1$mycolumn ) according to the
> matches of common columns in both data frames.
>
> I have tried this but it is not working:
>
> transform(fb, breidd = ifelse (match (as.character(df1$puntar),
> as.character(df2$puntar) )
> , df2$breidd, "no" ) ) )
>
> transform(fb, breidd = ifelse(as.character(df1$puntar) %in%
> as.character(df2$puntar)
> , df2$breidd, "no" ) ) )
Try looking at ?merge or ?union to see if either will do what you like.
Sean