Re: [R] How to Group Categorical data in R?

2012-06-13 Thread Manish Gupta
If there are some unique value in each column. How to look up in R?



--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4633235.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to Group Categorical data in R?

2012-06-13 Thread John Kane
This is not really enough information. PLEASE do read the posting guide  
http://www.R-project.org/posting-guide.html and provide commented, minimal, 
self-contained, reproducible code.

Have you looked at ?unique

John Kane
Kingston ON Canada


 -Original Message-
 From: mandecent.gu...@gmail.com
 Sent: Wed, 13 Jun 2012 04:03:00 -0700 (PDT)
 To: r-help@r-project.org
 Subject: Re: [R] How to Group Categorical data in R?
 
 If there are some unique value in each column. How to look up in R?
 
 
 
 --
 View this message in context:
 http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4633235.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks  orcas on your 
desktop!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to Group Categorical data in R?

2012-03-19 Thread Manish Gupta
 It is working fine. 

Thanks

--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4483565.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to Group Categorical data in R?

2012-03-17 Thread priyank
How about this --?

##Assumes you have read your data into data frame Msg17

## Capture unique values from data file's Column 3
Col3 - unique(Msg17$V3)

#Captures length of the unique value vector
LCol3 - length(Col3)

## Loop to sequentially select rows with the unique Col3 values
for (i in 1:LCol3) {
  print(paste(Column, Col3[i]))
  print(Msg17[Msg17$V3==Col3[i],-3])
}

Good luck!


--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4481247.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to Group Categorical data in R?

2012-03-16 Thread Manish Gupta
Hi, 

I am newbie to R and working on result presentation? My Input table is in
following format 

A   B   CD
X   TCK
Z   U   ZM
E   VZR
Z   U   ZM
E   VPR

I need to present my result in the following way.

Colum3 C
ABD
XT K

Column3 Z
Z   U  M
E   VR
Z   U  M

Column3 P
E   VR

How can i implement it? 

Thanks

--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4477622.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to Group Categorical data in R?

2012-03-16 Thread Jorge I Velez
Hi Manish,

Try

# data set
x - structure(list(V1 = structure(c(1L, 3L, 4L, 2L, 4L, 2L), .Label =
c(A,
E, X, Z), class = factor), V2 = structure(c(1L, 2L, 3L,
4L, 3L, 4L), .Label = c(B, T, U, V), class = factor),
V3 = structure(c(1L, 1L, 3L, 3L, 3L, 2L), .Label = c(C,
P, Z), class = factor), V4 = structure(c(1L, 2L, 3L,
4L, 3L, 4L), .Label = c(D, K, M, R), class = factor)), .Names
= c(V1,
V2, V3, V4), class = data.frame, row.names = c(NA, -6L
))

# result
lapply(split(x, x$V3), [, c(1, 2, 4))

See ?lapply, ?split and ?[ for more information.

HTH,
Jorge.-


On Fri, Mar 16, 2012 at 4:43 AM, Manish Gupta  wrote:

 Hi,

 I am newbie to R and working on result presentation? My Input table is in
 following format

 A   B   CD
 X   TCK
 Z   U   ZM
 E   VZR
 Z   U   ZM
 E   VPR

 I need to present my result in the following way.

 Colum3 C
 ABD
 XT K

 Column3 Z
 Z   U  M
 E   VR
 Z   U  M

 Column3 P
 E   VR

 How can i implement it?

 Thanks

 --
 View this message in context:
 http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4477622.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.