Hello,
Em 05-09-2012 07:26, David Winsemius escreveu:
On Sep 4, 2012, at 4:39 PM, s.s.m. fauzi wrote:
Hi,
I have two table matrix, and I would like to compare the different between
two matrix.
For example:
Matrix 1:
A B C
A 0 1 0
B 0 0 1
C 0 0 0
Matrix 2:
A B C
A 0 1 0
B 0 0 0
On Sep 4, 2012, at 4:39 PM, s.s.m. fauzi wrote:
> Hi,
> I have two table matrix, and I would like to compare the different between
> two matrix.
> For example:
>
> Matrix 1:
>A B C
> A 0 1 0
> B 0 0 1
> C 0 0 0
>
> Matrix 2:
> A B C
> A 0 1 0
> B 0 0 0
> C 0 0 0
>
> Each column
Hi,
Not quite understand your question. Suppose the columns of one matrix
(matrix1) have multiple 1's while matrix 2 have only 0's, do you mean that the
difference should be 0 for that column?
Anyway, the result that you wanted for this example can be got from:
mat1<-read.table(text="
A B C
Vincent,
The root of this problem seems to be that you don't fully understand the
differences between matrix and data.frame. Read up on them and you'll know how
to solve this problem.
For now:
as.matrix(temp[,-1])
or
temp = read.csv("Weather.csv", sep=",", row.names=1)
temp1 <- as.matrix(t
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of vincent.deluard
> Sent: Wednesday, May 05, 2010 12:34 PM
> To: r-help@r-project.org
> Subject: [R] Read data from .csv file as a matrix
>
>
> Hi R-users,
>
>
> I have a csv fi
Hello,
I have a csv file that contains weather observation (rows) by days (in
columns).
I open using:
temp = read.csv("Weather.csv", sep=",")
and read:
X X1.Jan X2.Jan X3.Jan X4.Jan
1 Min 2 3 4 1
2 Max 6 10 8 6
3 F
6 matches
Mail list logo