Skip to content

names error message

3 messages · Julie Royster, Sarah Goslee, William Dunlap

#
Hi Julie,
On Mon, Dec 2, 2013 at 3:38 PM, Julie Royster <jsdroyster at nc.rr.com> wrote:
I'm not sure what you think you're comparing here:
[1] TRUE

I initially thought you were comparing row names to column names, but
that's also not right. Instead you're taking the first list element of
data1 and comparing its name to that of the second list element of
data2, but extracting them in a way that removes the names:
[1] 1 2 3
[1] 14 15 16
NULL
NULL

Compared to:
[1] "a"
[1] "B"

Instead, you need to look at the column names of each, which
are most conveniently accessed with
colnames(data1) and colnames(data2)
Best idea of all: provide a reproducible example, because otherwise
there's no way to tell.

dput(head(data1))

and

dput(head(data2))

and paste that into your email.

Sarha
#
The column names of the data.frames given to rbind must all be
permutations of one another.   E.g.,
    > rbind(data.frame(A=1:3,B=11:13), data.frame(B=14:17, A=4:7))
      A  B
    1 1 11
    2 2 12
    3 3 13
    4 4 14
    5 5 15
    6 6 16
    7 7 17
but not
    > rbind(data.frame(A=1:3,B=11:13), data.frame(B=14:17, C=104:107))
    Error in match.names(clabs, names(xi)) : 
      names do not match previous names

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com