cient than cut.
>
> Regards
> Petr
>
>
>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
>> project.org] On Behalf Of arun
>> Sent: Thursday, October 25, 2012 3:32 AM
>> To: Jorge I Velez; bibek sharma
>
From: PIKAL Petr
To: arun ; Jorge I Velez ;
bibek sharma
Cc: R help
Sent: Thursday, October 25, 2012 5:29 AM
Subject: RE: [R] Defining categories
Hi
Maybe also findInterval can be used
dat1$cat<-findInterval(dat1$V1, 1:6, rightmost.closed = T, all.inside = T)
It is said to be more ef
:32 AM
>> To: Jorge I Velez; bibek sharma
>> Cc: R help
>> Subject: Re: [R] Defining categories
>>
>> Hi,
>> (Jorge: Thanks for the suggestion.)
>> cut? will be much easier.
>>
>> dat1<-read.table(text="
>> 2.880556
>>
On Behalf Of arun
> Sent: Thursday, October 25, 2012 3:32 AM
> To: Jorge I Velez; bibek sharma
> Cc: R help
> Subject: Re: [R] Defining categories
>
> Hi,
> (Jorge: Thanks for the suggestion.)
> cut? will be much easier.
>
> dat1<-read.table(text="
>
*","\\1",dat1$Categ))
#formats the Categ column.
head(dat1)
# V1 Categ
#1 2.880556 3
#2 0.616667 1
#3 5.08 6
#4 0.858333 1
#5 0.47 1
#6 2.936111 3
A.K.
________
From: Jorge I Velez
To: arun
Cc: bibek sharma ; R h
> #6 2.936111 3
> A.K.
>
>
>
> - Original Message -
> From: bibek sharma <>
> To: r-help@r-project.org
> Cc:
> Sent: Wednesday, October 24, 2012 6:52 PM
> Subject: [R] Defining categories
>
> Hello R user,
>
> Data below represent y
1
#5 0.47 1
#6 2.936111 3
A.K.
- Original Message -
From: bibek sharma
To: r-help@r-project.org
Cc:
Sent: Wednesday, October 24, 2012 6:52 PM
Subject: [R] Defining categories
Hello R user,
Data below represent year in decimal. I would like to catagorize it
in such a w
Hello R user,
Data below represent year in decimal. I would like to catagorize it
in such a way that any valye [0,1] goes to catagory 1 , (1,2] goes to
catagory 2 and so on..
Any suggestion how it can be done with if else statement or any other way?
2.880556
0.616667
5.08
0.858333
0.47
2.
8 matches
Mail list logo