Arrays must all be the same type. Data frame columns may be of differing types.
Try to avoid creating a matrix and converting it to a data frame.
a<- data.frame(name=c(2,2,"X"), value=c(,1:3,2:4), as.is=TRUE)
str(a)
---
Jeff
On Jun 6, 2012, at 3:51 PM, Joshua Budman wrote:
Hi,
I am trying to process genomics data and the presence of both
characters and integers in an array is giving issues.
That is probably because you do not understand that it there is even
one character in an array, then that is what ALL the
Hi. Try:
as.data.frame(cbind(a[,1],a[,2]))
Andrija
On Wed, Jun 6, 2012 at 9:51 PM, Joshua Budman wrote:
> Hi,
> I am trying to process genomics data and the presence of both
> characters and integers in an array is giving issues. The following is
> an example:
> > a<-array(c(2,2,"X",1:3,2:4),
Hi,
I am trying to process genomics data and the presence of both
characters and integers in an array is giving issues. The following is
an example:
> a<-array(c(2,2,"X",1:3,2:4),dim=c(3,3))
> b<-cbind(a[,1],a[,2])
With the output being:
[,1] [,2]
[1,] "2" "1"
[2,] "2" "2"
[3,] "X" "
4 matches
Mail list logo