Dear all,
Need a help. I would like to count combination of two columns:
structure(list(V1 = structure(c(4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c(23,
55, 67, Env), class = factor), V2 = structure(c(9L, 7L,
7L, 7L, 2L, 1L, 11L, 11L, 11L,
Hello,
Your dataset seems to have a problem, the first row should the columns'
names. If I'm right,
nms - levels(dat[[1]])[dat[1,1]]
nms[2] - levels(dat[[2]])[dat[1,2]]
dat - dat[-1, ]
names(dat) - nms
with(dat, table(Env, place))
If I'm wrong,
with(dat, table(V1, V2))
Hope this helps,
.23 PR.67
# 3 3
Hope this helps.
A.K.
- Original Message -
From: Nico Met nicome...@gmail.com
To: R help r-help@r-project.org
Cc:
Sent: Monday, October 8, 2012 8:42 AM
Subject: [R] How to count combinations
Dear all,
Need a help. I would like to count combination of two
IN jk NO NW PK PR PT
# 23 1 1 0 0 1 2 3 0 0 4
# 55 0 0 1 0 0 0 0 1 0 0
#67 1 1 0 2 0 0 0 0 3 0
A.K.
- Original Message -
From: Nico Met nicome...@gmail.com
To: R help r-help@r-project.org
Cc:
Sent: Monday, October 8, 2012 8:42 AM
Subject: [R] How
4 matches
Mail list logo