Hello,
Inline.
Em 23-10-2012 15:23, Bert Gunter escreveu:
I don't think so. The OP wanted the list by columns, not rows, if I
understand correctly.
unlist(df)
provides this. Of course, the request probably does not makes sense in
the first place, as the different types/classes in the data.fram
Hi again,
It seems that you want the modes to be conserved. This is just not
possible; everything will be coerced to characters, as Rui highlighted.
But the question is why do you want to do this? You would loose helpful
information (i.e. modes). Maybe there is a better way to do what you
wa
I don't think so. The OP wanted the list by columns, not rows, if I
understand correctly.
unlist(df)
provides this. Of course, the request probably does not makes sense in
the first place, as the different types/classes in the data.frame will
be coerced to one type/class. Moreover, factors will b
Hello,
Sorry for my earlier post, I misunderstood what you want.
dat <- data.frame(letters, 1:26)
as.vector(sapply(d, as.character))
Hope this helps,
Rui Barradas
Em 23-10-2012 14:13, brunosm escreveu:
Hi Ivan, thanks for your help!
For example:
df
num letters
1 1 A
2 2
2 15.1836433242221
#col1.3 14.16437138759
#col1.4 16.5952808021378
#col1.5 15.3295077718154
#col1.6 14.179531615882
A.K.
- Original Message -
From: brunosm
To: r-help@r-project.org
Cc:
Sent: Tuesday, October 23, 2012 7:45 AM
Subject: [R] Join data frame columns
Hi,
I have a data frame wi
Hi Ivan, thanks for your help!
For example:
> df
num letters
1 1 A
2 2 B
3 3 C
4 4 D
5 5 E
What i want is to join "num" and "letters" in a single column. Something
like this
> new_df
1 1
2 2
3 3
4 4
5 5
6 A
Hello,
Use apply/paste.
apply(df, 1, paste, collapse = "") # outputs a vector
Also, df is the name of an R function, you should choose something else,
it can become confusing.
Hope this helps,
Rui Barradas
Em 23-10-2012 12:45, brunosm escreveu:
Hi,
I have a data frame with 100 variables
Hi!
Either I don't understand what you want to do, or it doesn't make any sense.
First, a vector cannot have different modes. If you want a single vector
it will most likely be coerced in to characters; probably not what you want.
Second, what you do is build a data.frame with another data.fr
Hi,
I have a data frame with 100 variables (numeric and non numeric types), and
I want to join them in only one column, like a vector, but i want to keep
the non numeric variables like they are.
I know that i can do something like this:
Suppose that my data is in df variable
new_df<-data.frame(
9 matches
Mail list logo