Hi,
I have a original adjacency matrix n X n , and I want to connect certain row
with
a set of other selected columns (could be not the same as in the
original matrix).
this in each iteration I have a new row of this connections matrix , how to
create this matrix.
having original row nu
Or better:
reshape(cbind(DF, value = 1), v.names = 'value', idvar = 'V1', timevar
= 'V2', direction = 'wide')
On Tue, Mar 2, 2010 at 3:49 PM, Henrique Dallazuanna wrote:
> Try this:
>
> DF <- read.table(textConnection("1 this
> 1 is
> 1 the
> 1 first
> 1 row
> 2 this
> 2 is
> 2 the
> 2 send
> 2
Jan -
Here's one way:
tbl = data.frame(id=c(1,1,1,1,1,2,2,2,2,2),
text=c('this','is','the','first','row','this','is','the','second','row'))
xtabs(~id+text,tbl)
text
id first is row second the this
1 1 1 1 0 11
2 0 1 1 1 11
It'
Try this:
DF <- read.table(textConnection("1 this
1 is
1 the
1 first
1 row
2 this
2 is
2 the
2 send
2 row"))
reshape(DF, v.names = 'V2', idvar = 'V1', timevar = 'V2', direction = 'wide')
On Tue, Mar 2, 2010 at 3:35 PM, Jan Hornych wrote:
> Hi all,
>
> I have a table in database that is very long
Hi all,
I have a table in database that is very long and when simplified it has only
two columns in it (id, text). id is the row, and text is the column.
Technically the text is a term and and id is the document.
If simplifying this and assuming there is only one occurrence of the term
per the doc
how do i calculate the p-value of trend test
Hello,
I have two data.
x<-c(1, 2, 1, 3, 2)
y<-c(3, 1, 2, 3, 5)
1. How do i create matrix from this two.
what i want is this
x y
1 1 3
2 2 1
3 1 2
4 3 3
5 2 5
2. what is the best way to use chisq.test to get the p.value
t
Here is how you can apply the mat function mentioned by Cassardi,
x<-c(1, 2, 1, 3, 2)
y<-c(3, 1, 2, 3, 5)
mat<-matrix(c(x,y),5,2) ##the first parameter gives the data vector
wich is filled columnwise in the matrix, then comes the row and column
dimensions)
colnames(mat)<-c("x","y")
yo
See ?cbind and ?matrix.
Gabor
On Sat, May 10, 2008 at 03:21:26PM -0700, Claire_6700 wrote:
>
> Hello,
>
> I have two data.
>
> x<-c(1, 2, 1, 3, 2)
> y<-c(3, 1, 2, 3, 5)
>
> How do i create matrix from this two.
>
> what i want is this
>
> x y
> 1 1 3
> 2 2 1
> 3 1 2
> 4 3
Hello,
I have two data.
x<-c(1, 2, 1, 3, 2)
y<-c(3, 1, 2, 3, 5)
How do i create matrix from this two.
what i want is this
x y
1 1 3
2 2 1
3 1 2
4 3 3
5 2 5
thanks
Claire
--
View this message in context:
http://www.nabble.com/Creating-Matrix-tp17168173p17168173.html
Sen
9 matches
Mail list logo