On 11/2/2012 11:11 AM, Ni, Shenghua wrote:
r-c(1,1,9,1,1,1)
col_no-cut(r,c(0,2,3,6,8,10,100))
levels(col_no)-c(2%,2-4%,4-6%,6-8%,8-10%,10%)
col_no
[1] 2% 2% 8-10% 2% 2% 2%
Levels: 2% 2-4% 4-6% 6-8% 8-10% 10%
Yes.
(Or, I get the same output from this code. What is the question?)
On Nov 2, 2012, at 11:51 AM, Berend Hasselman wrote:
On 02-11-2012, at 19:11, Ni, Shenghua wrote:
r-c(1,1,9,1,1,1)
col_no-cut(r,c(0,2,3,6,8,10,100))
levels(col_no)-c(2%,2-4%,4-6%,6-8%,8-10%,10%)
col_no
[1] 2% 2% 8-10% 2% 2% 2%
Levels: 2% 2-4% 4-6% 6-8% 8-10% 10%
Where is
On Nov 6, 2012, at 22:16 , Brian Diggs wrote:
On 11/2/2012 11:11 AM, Ni, Shenghua wrote:
r-c(1,1,9,1,1,1)
col_no-cut(r,c(0,2,3,6,8,10,100))
levels(col_no)-c(2%,2-4%,4-6%,6-8%,8-10%,10%)
col_no
[1] 2% 2% 8-10% 2% 2% 2%
Levels: 2% 2-4% 4-6% 6-8% 8-10% 10%
Yes.
(Or, I get the
r-c(1,1,9,1,1,1)
col_no-cut(r,c(0,2,3,6,8,10,100))
levels(col_no)-c(2%,2-4%,4-6%,6-8%,8-10%,10%)
col_no
[1] 2% 2% 8-10% 2% 2% 2%
Levels: 2% 2-4% 4-6% 6-8% 8-10% 10%
[[alternative HTML version deleted]]
__
R-help@r-project.org
On 02-11-2012, at 19:11, Ni, Shenghua wrote:
r-c(1,1,9,1,1,1)
col_no-cut(r,c(0,2,3,6,8,10,100))
levels(col_no)-c(2%,2-4%,4-6%,6-8%,8-10%,10%)
col_no
[1] 2% 2% 8-10% 2% 2% 2%
Levels: 2% 2-4% 4-6% 6-8% 8-10% 10%
Where is the question?
Berend
Dear all,
I would like to use cut() to make numerics to factors, the sample codes are as
follows. However, the result is not what I want, since r[3] = 9 should be in
the interval of 8-10% rather than 2-4%. Maybe cut() is not the right
function to use for my situation. Please help. r -
On Tue, 2010-12-14 at 15:40 +, Tianchan Niu wrote:
Dear all,
I would like to use cut() to make numerics to factors, the sample codes are
as follows. However, the result is not what I want, since r[3] = 9 should be
in the interval of 8-10% rather than 2-4%. Maybe cut() is not the right
Tianchan Niu niu at isis.georgetown.edu writes:
Dear all,
I would like to use cut() to make numerics to factors, the sample codes are as
follows. However, the result is
not what I want, since r[3] = 9 should be in the interval of 8-10% rather
than 2-4%. Maybe cut() is not
the right function
Tianchan, why aren't you just using
col_no - cut(r,c(0,2,4,6,8,10,100))
levels(col_no) - c(2%,2-4%,4-6%,6-8%,8-10%,10%)
?
Your use of as.numeric() is nonsensical; check step by step what is
happening with that.
Hth,
Gerrit
On Tue, 14 Dec 2010, Tianchan Niu wrote:
Dear all,
I would like
9 matches
Mail list logo