On Oct 17, 2012, at 12:42 PM, Charles Determan Jr wrote:
To R users,
I am trying to use cut2 function from the 'Hmisc' library. However,
when I
try and run the function on the following variable, I get an error
message
(displayed below). I suspect it is because of the NA but I have no
98 99 96 NA
cut2 <- function(x, g = 0){
cut(x, breaks = c(-Inf, seq(min(x), max(x), length.out = g)))
}
dat2<-dat1[!is.na(dat1)]
cut2(dat2,g=4)
A.K.
From: Charles Determan Jr
To: David Winsemius
Cc: arun ; R help
Sent: Wednesday, October 17, 2012 5
> #[64] (98,99] (97,98] (97,98] (98,99] (98,99] (96,97]
> (97,98]
> #[71] (97,98] (97,98] (98,99] (97,98] (97,98] (97,98]
> (98,99]
> #[78] (97,98] (97,98]
> #Levels: (-Inf,96] (96,97] (97,98] (98,99]
> A.K.
>
>
>
>
> - Original Message
9] (97,98] (97,98] (97,98] (97,98]
>>> #[57] (97,98] (97,98] (97,98] (98,99] (98,99] (97,98] (98,99]
>>> #[64] (98,99] (97,98] (97,98] (98,99] (98,99] (96,97] (97,98]
>>> #[71] (97,98] (97,98] (98,99] (97,98] (97,98] (97,98] (98,99]
ber 17, 2012 3:42 PM
Subject: [R] cut2 error
To R users,
I am trying to use cut2 function from the 'Hmisc' library.
However, when I
try and run the function on the following variable, I get an error
message
(displayed below). I suspect it is because of the NA but I have no
idea
99] (97,98] (97,98] (98,99] (98,99] (96,97] (97,98]
> #[71] (97,98] (97,98] (98,99] (97,98] (97,98] (97,98] (98,99]
> #[78] (97,98] (97,98]
> #Levels: (-Inf,96] (96,97] (97,98] (98,99]
> A.K.
>
>
>
>
> - Original Message -----
> From: Charles De
Determan Jr
To: r-help@r-project.org
Cc:
Sent: Wednesday, October 17, 2012 3:42 PM
Subject: [R] cut2 error
To R users,
I am trying to use cut2 function from the 'Hmisc' library. However, when I
try and run the function on the following variable, I get an error message
(displayed below). I s
To R users,
I am trying to use cut2 function from the 'Hmisc' library. However, when I
try and run the function on the following variable, I get an error message
(displayed below). I suspect it is because of the NA but I have no idea
how to address the error. Many thanks to any insights.
struc
8 matches
Mail list logo